-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #178 from vtex-apps/feature/migrate-to-CSS-Handles
Feature/migrate to css handles
- Loading branch information
Showing
26 changed files
with
267 additions
and
257 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,18 +8,18 @@ | |
"eslint-config-vtex": "10.x", | ||
"prettier": "^1.18.2", | ||
"typescript": "3.8.3", | ||
"vtex.address-form": "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.address-form@4.5.4/public/_types/react", | ||
"vtex.address-form": "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.address-form@4.6.2/public/_types/react", | ||
"vtex.country-codes": "http://vtex.vtexassets.com/_v/public/typings/v1/[email protected]/public/_types/react", | ||
"vtex.my-account": "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.my-account@1.13.5/public/@types/vtex.my-account", | ||
"vtex.my-account-commons": "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.my-account-commons@1.3.0/public/@types/vtex.my-account-commons", | ||
"vtex.my-cards": "http://vtex.vtexassets.com/_v/public/typings/v1/[email protected].0/public/@types/vtex.my-cards", | ||
"vtex.my-orders-app": "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.my-orders-app@3.5.2/public/_types/react", | ||
"vtex.my-account": "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.my-account@1.15.0/public/@types/vtex.my-account", | ||
"vtex.my-account-commons": "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.my-account-commons@1.4.1/public/@types/vtex.my-account-commons", | ||
"vtex.my-cards": "http://vtex.vtexassets.com/_v/public/typings/v1/[email protected].1/public/@types/vtex.my-cards", | ||
"vtex.my-orders-app": "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.my-orders-app@3.6.2/public/_types/react", | ||
"vtex.pixel-manager": "http://vtex.vtexassets.com/_v/public/typings/v1/[email protected]/public/@types/vtex.pixel-manager", | ||
"vtex.profile-form": "http://vtex.vtexassets.com/_v/public/typings/v1/[email protected].1/public/_types/react", | ||
"vtex.react-vtexid": "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.react-vtexid@4.22.0/public/_types/react", | ||
"vtex.store-graphql": "http://vtex.vtexassets.com/_v/public/typings/v1/[email protected].1/public/@types/vtex.store-graphql", | ||
"vtex.store-messages": "http://vtex.vtexassets.com/_v/public/typings/v1/[email protected].0/public/_types/react", | ||
"vtex.styleguide": "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.styleguide@9.116.0/public/@types/vtex.styleguide" | ||
"vtex.profile-form": "http://vtex.vtexassets.com/_v/public/typings/v1/[email protected].2/public/_types/react", | ||
"vtex.react-vtexid": "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.react-vtexid@4.28.1/public/_types/react", | ||
"vtex.store-graphql": "http://vtex.vtexassets.com/_v/public/typings/v1/[email protected].4/public/@types/vtex.store-graphql", | ||
"vtex.store-messages": "http://vtex.vtexassets.com/_v/public/typings/v1/[email protected].2/public/_types/react", | ||
"vtex.styleguide": "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.styleguide@9.124.0/public/@types/vtex.styleguide" | ||
}, | ||
"dependencies": { | ||
"@vtex/api": "^3.48.2" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2080,53 +2080,53 @@ uuid@^3.1.0: | |
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.3.tgz#4568f0216e78760ee1dbf3a4d2cf53e224112866" | ||
integrity sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ== | ||
|
||
"vtex.address-form@http://vtex.vtexassets.com/_v/public/typings/v1/vtex.address-form@4.5.4/public/_types/react": | ||
"vtex.address-form@http://vtex.vtexassets.com/_v/public/typings/v1/vtex.address-form@4.6.2/public/_types/react": | ||
version "0.0.0" | ||
resolved "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.address-form@4.5.4/public/_types/react#fa7a0347e046eab3dd768998fc9252b2c0dd5aef" | ||
resolved "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.address-form@4.6.2/public/_types/react#fa7a0347e046eab3dd768998fc9252b2c0dd5aef" | ||
|
||
"vtex.country-codes@http://vtex.vtexassets.com/_v/public/typings/v1/[email protected]/public/_types/react": | ||
version "0.0.0" | ||
resolved "http://vtex.vtexassets.com/_v/public/typings/v1/[email protected]/public/_types/react#fa7a0347e046eab3dd768998fc9252b2c0dd5aef" | ||
|
||
"vtex.my-account-commons@http://vtex.vtexassets.com/_v/public/typings/v1/vtex.my-account-commons@1.3.0/public/@types/vtex.my-account-commons": | ||
version "1.3.0" | ||
resolved "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.my-account-commons@1.3.0/public/@types/vtex.my-account-commons#6ca2e5e0ec266b2aa4048b4094052771aa524aae" | ||
"vtex.my-account-commons@http://vtex.vtexassets.com/_v/public/typings/v1/vtex.my-account-commons@1.4.1/public/@types/vtex.my-account-commons": | ||
version "1.4.1" | ||
resolved "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.my-account-commons@1.4.1/public/@types/vtex.my-account-commons#789abf1a5725623250a56c300e100b74d1ce73bb" | ||
|
||
"vtex.my-account@http://vtex.vtexassets.com/_v/public/typings/v1/vtex.my-account@1.13.5/public/@types/vtex.my-account": | ||
version "1.13.5" | ||
resolved "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.my-account@1.13.5/public/@types/vtex.my-account#fb351d9c7d6992479b4375041bcc2507f9515ac3" | ||
"vtex.my-account@http://vtex.vtexassets.com/_v/public/typings/v1/vtex.my-account@1.15.0/public/@types/vtex.my-account": | ||
version "1.15.0" | ||
resolved "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.my-account@1.15.0/public/@types/vtex.my-account#6088dd61c1184cf8cb60139256c6edad29f9af8c" | ||
|
||
"vtex.my-cards@http://vtex.vtexassets.com/_v/public/typings/v1/[email protected].0/public/@types/vtex.my-cards": | ||
version "1.9.0" | ||
resolved "http://vtex.vtexassets.com/_v/public/typings/v1/[email protected].0/public/@types/vtex.my-cards#2aecb3fc14d856e25ac1c3bf1ff78036c6712f1e" | ||
"vtex.my-cards@http://vtex.vtexassets.com/_v/public/typings/v1/[email protected].1/public/@types/vtex.my-cards": | ||
version "1.9.1" | ||
resolved "http://vtex.vtexassets.com/_v/public/typings/v1/[email protected].1/public/@types/vtex.my-cards#9d279e9341a87cea32d02cb51368ef7e568492ff" | ||
|
||
"vtex.my-orders-app@http://vtex.vtexassets.com/_v/public/typings/v1/vtex.my-orders-app@3.5.2/public/_types/react": | ||
"vtex.my-orders-app@http://vtex.vtexassets.com/_v/public/typings/v1/vtex.my-orders-app@3.6.2/public/_types/react": | ||
version "0.0.0" | ||
resolved "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.my-orders-app@3.5.2/public/_types/react#fa7a0347e046eab3dd768998fc9252b2c0dd5aef" | ||
resolved "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.my-orders-app@3.6.2/public/_types/react#fa7a0347e046eab3dd768998fc9252b2c0dd5aef" | ||
|
||
"vtex.pixel-manager@http://vtex.vtexassets.com/_v/public/typings/v1/[email protected]/public/@types/vtex.pixel-manager": | ||
version "1.1.4" | ||
resolved "http://vtex.vtexassets.com/_v/public/typings/v1/[email protected]/public/@types/vtex.pixel-manager#96907e17f4e5c584162a47dc425cb5afb2267d00" | ||
|
||
"vtex.profile-form@http://vtex.vtexassets.com/_v/public/typings/v1/[email protected].1/public/_types/react": | ||
"vtex.profile-form@http://vtex.vtexassets.com/_v/public/typings/v1/[email protected].2/public/_types/react": | ||
version "0.0.0" | ||
resolved "http://vtex.vtexassets.com/_v/public/typings/v1/[email protected].1/public/_types/react#fa7a0347e046eab3dd768998fc9252b2c0dd5aef" | ||
resolved "http://vtex.vtexassets.com/_v/public/typings/v1/[email protected].2/public/_types/react#fa7a0347e046eab3dd768998fc9252b2c0dd5aef" | ||
|
||
"vtex.react-vtexid@http://vtex.vtexassets.com/_v/public/typings/v1/vtex.react-vtexid@4.22.0/public/_types/react": | ||
"vtex.react-vtexid@http://vtex.vtexassets.com/_v/public/typings/v1/vtex.react-vtexid@4.28.1/public/_types/react": | ||
version "0.0.0" | ||
resolved "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.react-vtexid@4.22.0/public/_types/react#fa7a0347e046eab3dd768998fc9252b2c0dd5aef" | ||
resolved "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.react-vtexid@4.28.1/public/_types/react#fa7a0347e046eab3dd768998fc9252b2c0dd5aef" | ||
|
||
"vtex.store-graphql@http://vtex.vtexassets.com/_v/public/typings/v1/[email protected].1/public/@types/vtex.store-graphql": | ||
version "2.123.1" | ||
resolved "http://vtex.vtexassets.com/_v/public/typings/v1/[email protected].1/public/@types/vtex.store-graphql#0d3137dc505f7e1a38cdc8499ad12e6327cac657" | ||
"vtex.store-graphql@http://vtex.vtexassets.com/_v/public/typings/v1/[email protected].4/public/@types/vtex.store-graphql": | ||
version "2.123.4" | ||
resolved "http://vtex.vtexassets.com/_v/public/typings/v1/[email protected].4/public/@types/vtex.store-graphql#f570a189a1b37d84e5215917efac2e5fb21af548" | ||
|
||
"vtex.store-messages@http://vtex.vtexassets.com/_v/public/typings/v1/[email protected].0/public/_types/react": | ||
"vtex.store-messages@http://vtex.vtexassets.com/_v/public/typings/v1/[email protected].2/public/_types/react": | ||
version "0.0.0" | ||
resolved "http://vtex.vtexassets.com/_v/public/typings/v1/[email protected].0/public/_types/react#fa7a0347e046eab3dd768998fc9252b2c0dd5aef" | ||
resolved "http://vtex.vtexassets.com/_v/public/typings/v1/[email protected].2/public/_types/react#fa7a0347e046eab3dd768998fc9252b2c0dd5aef" | ||
|
||
"vtex.styleguide@http://vtex.vtexassets.com/_v/public/typings/v1/vtex.styleguide@9.116.0/public/@types/vtex.styleguide": | ||
version "9.116.0" | ||
resolved "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.styleguide@9.116.0/public/@types/vtex.styleguide#f17be9afb6ee66c71f2ea8d5ba81b2d18b2caa76" | ||
"vtex.styleguide@http://vtex.vtexassets.com/_v/public/typings/v1/vtex.styleguide@9.124.0/public/@types/vtex.styleguide": | ||
version "9.124.0" | ||
resolved "http://vtex.vtexassets.com/_v/public/typings/v1/vtex.styleguide@9.124.0/public/@types/vtex.styleguide#5c79d53204ea7e52b5fe5118c6ba0579cbc9ed8c" | ||
|
||
which@^1.2.9: | ||
version "1.3.1" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,34 +2,43 @@ import React, { FunctionComponent } from 'react' | |
import { graphql } from 'react-apollo' | ||
import { compose, branch, renderComponent } from 'recompose' | ||
import { FormattedMessage } from 'react-intl' | ||
import { useCssHandles } from 'vtex.css-handles' | ||
|
||
import GREETING, { Result } from '../../graphql/customerGreeting.gql' | ||
import Loading from './UserInfoLoading' | ||
import styles from '../../styles.css' | ||
import PictureRenderer from './ProfilePicture/PictureRenderer' | ||
|
||
const CSS_HANDLES = [ | ||
'userInfo', | ||
'userImage', | ||
'userGreeting', | ||
'userName', | ||
'userGreeting', | ||
] as const | ||
|
||
const UserInfo: FunctionComponent<Props> = ({ profilePicture, firstName }) => { | ||
const cssHandles = useCssHandles(CSS_HANDLES) | ||
return ( | ||
<div className={`${styles.userInfo} flex flex-wrap items-end mb7`}> | ||
<div className={`${styles.userImage} relative mr5 h3 w3`}> | ||
<div className={`${cssHandles.userInfo} flex flex-wrap items-end mb7`}> | ||
<div className={`${cssHandles.userImage} relative mr5 h3 w3`}> | ||
<PictureRenderer imagePath={profilePicture} /> | ||
</div> | ||
{firstName ? ( | ||
<div> | ||
<div | ||
className={` | ||
${styles.userGreeting} f5 fw3 c-muted-1 mb2 mt0-l mt2-m | ||
${cssHandles.userGreeting} f5 fw3 c-muted-1 mb2 mt0-l mt2-m | ||
`} | ||
> | ||
<FormattedMessage id="[email protected]::userInfo.greeting" /> | ||
, | ||
</div> | ||
<div className={`${styles.userName} f4 c-on-base fw3 nowrap`}> | ||
<div className={`${cssHandles.userName} f4 c-on-base fw3 nowrap`}> | ||
{firstName}! | ||
</div> | ||
</div> | ||
) : ( | ||
<div className={`${styles.userGreeting} f4 fw3 nowrap`}> | ||
<div className={`${cssHandles.userGreeting} f4 fw3 nowrap`}> | ||
<FormattedMessage id="[email protected]::userInfo.greeting" />! | ||
</div> | ||
)} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,11 +5,12 @@ import { | |
FormattedMessage, | ||
defineMessages, | ||
} from 'react-intl' | ||
import { useCssHandles } from 'vtex.css-handles' | ||
|
||
import ContentBox from '../shared/ContentBox' | ||
import DataEntry from '../shared/DataEntry' | ||
import styles from '../../styles.css' | ||
import className from '../../styles/ContentBox.css' | ||
|
||
const CSS_HANDLES = ['passwordBoxContainer', 'passwordBox'] as const | ||
|
||
const PASSWORD_MASK = '*******************' | ||
const messages = defineMessages({ | ||
|
@@ -24,18 +25,19 @@ const PasswordBox: FunctionComponent<Props> = ({ | |
onEditClick, | ||
intl, | ||
}) => { | ||
const cssHandles = useCssHandles(CSS_HANDLES) | ||
const lowerButtonId = passwordLastUpdate | ||
? '[email protected]::personalData.redefinePassword' | ||
: '[email protected]::personalData.definePassword' | ||
|
||
return ( | ||
<div className={`${className.passwordBoxContainer}`}> | ||
<div className={cssHandles.passwordBoxContainer}> | ||
<ContentBox | ||
shouldAllowGrowing | ||
lowerButton={<FormattedMessage id={lowerButtonId} />} | ||
onLowerButtonClick={onEditClick} | ||
> | ||
<div className={`${styles.passwordBox} w-100`}> | ||
<div className={`${cssHandles.passwordBox} w-100`}> | ||
<DataEntry label={intl.formatMessage(messages.password)}> | ||
{passwordLastUpdate ? ( | ||
PASSWORD_MASK | ||
|
Oops, something went wrong.