-
Notifications
You must be signed in to change notification settings - Fork 145
Store details step - add contextual information and skip link #4735
Conversation
Changes: * Add tooltips * Use @wordpress/components Card and Flex * Adjust styles to match new designs
|
||
class StoreDetails extends Component { | ||
constructor( props ) { | ||
super( ...arguments ); | ||
super( props ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was just a formatting change, really no need to pass anything but props to Component
.
</H> | ||
<H className="woocommerce-profile-wizard__header-subtitle"> | ||
{ __( | ||
'This will help us configure your store and get you started quickly', | ||
"Tell us about your store and we'll get you set up in no time", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A question: do I need to do anything for translations in other languages here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, its wrapped in __()
, so the translations are handled elsewhere.
validate={ validateStoreAddress } | ||
<Tooltip | ||
text={ __( | ||
'Your store address will help us configure currency\n options and shipping rules automatically.\n This information will not be publicly visible and can\n easily be changed later.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used newlines and whitespace: pre to get this displaying as close to the designs as possible. This seems problematic for translations?
I tried modifying elements on popover more with styles, but it was quite constrained, I could not retain the exact width of the design.
) } | ||
</Form> | ||
</Card> | ||
<CardFooter> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making use of the new Card, CardFooter etc from @wordpress/components
.
I've used 2 footers here to match the design
</FlexItem> | ||
</CardFooter> | ||
|
||
<CardFooter justify="center"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Card elements are flex components, so we can justify them or align them as desired to match the designs.
|
||
> * { | ||
max-width: 476px; | ||
max-width: 504px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The designs have made the card bigger to compensate for the larger amount of text content.
@@ -93,9 +99,31 @@ | |||
font-weight: 400; | |||
} | |||
|
|||
.components-popover__content { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Customizing the tooltip's popover element to get the desired display.
.woocommerce-card ~ p { | ||
font-size: 14px; | ||
} | ||
|
||
.woocommerce-profile-wizard__footer { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a new footer element that holds the "skip wizard" link.
@@ -6,6 +6,8 @@ | |||
@import 'node_modules/@wordpress/base-styles/animations'; | |||
@import 'node_modules/@wordpress/base-styles/z-index'; | |||
|
|||
@include wordpress-admin-schemes; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need this to generate the css var that $theme-color
is replaced by
0 6px 10px rgba(0, 0, 0, 0.14); | ||
$muriel-box-shadow-8dp: 0 5px 5px -3px rgba(0, 0, 0, 0.2), 0 8px 10px 1px rgba(0, 0, 0, 0.14), | ||
0 3px 14px 2px rgba(0, 0, 0, 0.12); | ||
$muriel-box-shadow-1dp: 0 2px 1px -1px rgba(0, 0, 0, 0.2), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My editor formatted these probably a prettier setting. Happy to revert this if its a pain.
@@ -53,7 +54,7 @@ | |||
$background-color: $white; | |||
$background-color-hover: $light-gray-100; | |||
$border-color: $light-gray-tertiary; | |||
$foreground-color: $theme-color; | |||
$foreground-color: var(--wp-admin-theme-color); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use the new css var
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$theme-color
was derived from theme(button)
in Gutenberg and evaluated in using postCSS. In our codebase we have variations like theme(primary)
or theme(outlines)
. Those may need to be replaced as well.
@@ -24,7 +22,22 @@ | |||
} | |||
} | |||
|
|||
.components-text-control__input { | |||
// @wordpress/components styles for text control target all types, so we must also do that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a change from the latest update to @wordpress/components
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job @samueljseay ! This is a nice change and clean up. I made a couple comments, but have run out of time and will give it a deeper look tomorrow. I am also getting an error when I npm start, Error: Undefined variable: "$blue-medium-focus".
I think that variable needs to be removed or mapped.
I think, as mentioned below, the update to base styles and components may have more issues lurking in the codebase and I'm wondering if those updates don't warrant a separate PR. This way we can discuss and test those changes in isolation. What do you think?
</H> | ||
<H className="woocommerce-profile-wizard__header-subtitle"> | ||
{ __( | ||
'This will help us configure your store and get you started quickly', | ||
"Tell us about your store and we'll get you set up in no time", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, its wrapped in __()
, so the translations are handled elsewhere.
@@ -53,7 +54,7 @@ | |||
$background-color: $white; | |||
$background-color-hover: $light-gray-100; | |||
$border-color: $light-gray-tertiary; | |||
$foreground-color: $theme-color; | |||
$foreground-color: var(--wp-admin-theme-color); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$theme-color
was derived from theme(button)
in Gutenberg and evaluated in using postCSS. In our codebase we have variations like theme(primary)
or theme(outlines)
. Those may need to be replaced as well.
@psealock thanks for the feedback. I will separate out a PR for the base-styles update. and I'll look at the other theme variations. Strange I didn't see that CSS variable error in my environment, but I'll investigate. About the translations, sorry my question wasn't very clear, I was more wondering, is there anything we need to do to provide translations for these new strings in other languages? |
I'll close this for now and separate out a PR for the base-styles update first. |
No we don't. Once on the .org repository, translators will translate the strings into different languages. See https://translate.wordpress.org/projects/wp-plugins/woocommerce/ for more on how thats done. |
Fixes #4566
Changes:
@wordpress/components
and@wordpress/base-styles
Card
andFlex
from@wordpress/components
Accessibility
prefers-reduced-motion
Screenshots
Detailed test instructions:
WooCommerce > Settings > Help > Setup Wizard
)