-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[UserMenu] Create a new Item component that contains the user menu changes #9771
Conversation
f753005
to
52b3405
Compare
/snapit |
🫰✨ Thanks @zakwarsame! Your snapshots have been published to npm. Test the snapshots by updating your yarn add @shopify/[email protected] yarn add @shopify/[email protected] |
/snapit |
🫰✨ Thanks @zakwarsame! Your snapshots have been published to npm. Test the snapshots by updating your yarn add @shopify/[email protected] yarn add @shopify/[email protected] |
0cb50c8
to
cb77783
Compare
/snapit |
🫰✨ Thanks @zakwarsame! Your snapshots have been published to npm. Test the snapshots by updating your yarn add @shopify/[email protected] yarn add @shopify/[email protected] |
@@ -0,0 +1,46 @@ | |||
import React, {useRef, useState} from 'react'; |
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.
Moving this component to the top-level since multiple components are now using it.
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'll let the Polaris folk chime in but I'm not sure if this makes sense as a top level component named a such since it seems like it would be a replacement for <Text truncate />
.
Maybe we can rename it to like: TextWithTooltipWhenTruncated
but that's a bit wordy 😛
/snapit |
🫰✨ Thanks @zakwarsame! Your snapshots have been published to npm. Test the snapshots by updating your yarn add @shopify/[email protected] yarn add @shopify/[email protected] |
polaris-react/src/components/TopBar/components/UserMenu/UserMenu.tsx
Outdated
Show resolved
Hide resolved
@henryyi Please see this thread for why we're going with this approach: https://shopify.slack.com/archives/C4Y8N30KD/p1689780576017759 |
@henryyi I've refactored the code so that we pass in a |
/snapit |
🫰✨ Thanks @zakwarsame! Your snapshots have been published to npm. Test the snapshots by updating your yarn add @shopify/[email protected] yarn add @shopify/[email protected] |
#9820) <!-- ☝️How to write a good PR title: - Prefix it with [ComponentName] (if applicable), for example: [Button] - Start with a verb, for example: Add, Delete, Improve, Fix… - Give as much context as necessary and as little as possible - Prefix it with [WIP] while it’s a work in progress --> ### WHY are these changes introduced? Fixes #0000 <!-- link to issue if one exists --> Fixes Shopify/archive-polaris-backlog-2024#785 Fixes Shopify/core-workflows#1029 Fixes Shopify/archive-polaris-backlog-2024#789 <!-- Context about the problem that’s being addressed. --> <details> <summary> Expand to see specifications/designs for this PR: </summary> ![image](https://github.com/Shopify/polaris/assets/42528878/752f0a05-ffad-4361-b84e-db96cdf8ec84) </details> ### WHAT is this pull request doing? <!-- Summary of the changes committed. Before / after screenshots are appreciated for UI changes. Make sure to include alt text that describes the screenshot. If you include an animated gif showing your change, wrapping it in a details tag is recommended. Gifs usually autoplay, which can cause accessibility issues for people reviewing your PR: <details> <summary>Summary of your gif(s)</summary> <img src="..." alt="Description of what the gif shows"> </details> --> <!-- ℹ️ Delete the following for small / trivial changes --> - This PR takes an alternative approach to [this PR](#9771) - It adds a new prop to `ActionList`'s `Item` component called `indent`. This prop adds some space and a border to the left of the individual items. - Given that the indentation only applies to `Plus` stores in the original design, we can simply specify the prop in the consumer. ### How to 🎩 Non-Plus: https://admin.web.mn.zakaria-warsame.us.spin.dev/store/shop1 Plus: https://admin.web.mn.zakaria-warsame.us.spin.dev/store/shop2 Ensure the user menu matches the designs ### 🎩 checklist - [x] Tested on [mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing) - [x] Tested on [multiple browsers](https://help.shopify.com/en/manual/shopify-admin/supported-browsers) - [x] Tested for [accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md) ~- [ ] Updated the component's `README.md` with documentation changes~ - [x] [Tophatted documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md) changes in the style guide --------- Co-authored-by: Sam Rose <[email protected]>
Shopify#9820) <!-- ☝️How to write a good PR title: - Prefix it with [ComponentName] (if applicable), for example: [Button] - Start with a verb, for example: Add, Delete, Improve, Fix… - Give as much context as necessary and as little as possible - Prefix it with [WIP] while it’s a work in progress --> ### WHY are these changes introduced? Fixes #0000 <!-- link to issue if one exists --> Fixes https://github.com/Shopify/polaris-summer-editions/issues/785 Fixes https://github.com/Shopify/core-workflows/issues/1029 Fixes https://github.com/Shopify/polaris-summer-editions/issues/789 <!-- Context about the problem that’s being addressed. --> <details> <summary> Expand to see specifications/designs for this PR: </summary> ![image](https://github.com/Shopify/polaris/assets/42528878/752f0a05-ffad-4361-b84e-db96cdf8ec84) </details> ### WHAT is this pull request doing? <!-- Summary of the changes committed. Before / after screenshots are appreciated for UI changes. Make sure to include alt text that describes the screenshot. If you include an animated gif showing your change, wrapping it in a details tag is recommended. Gifs usually autoplay, which can cause accessibility issues for people reviewing your PR: <details> <summary>Summary of your gif(s)</summary> <img src="..." alt="Description of what the gif shows"> </details> --> <!-- ℹ️ Delete the following for small / trivial changes --> - This PR takes an alternative approach to [this PR](Shopify#9771) - It adds a new prop to `ActionList`'s `Item` component called `indent`. This prop adds some space and a border to the left of the individual items. - Given that the indentation only applies to `Plus` stores in the original design, we can simply specify the prop in the consumer. ### How to 🎩 Non-Plus: https://admin.web.mn.zakaria-warsame.us.spin.dev/store/shop1 Plus: https://admin.web.mn.zakaria-warsame.us.spin.dev/store/shop2 Ensure the user menu matches the designs ### 🎩 checklist - [x] Tested on [mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing) - [x] Tested on [multiple browsers](https://help.shopify.com/en/manual/shopify-admin/supported-browsers) - [x] Tested for [accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md) ~- [ ] Updated the component's `README.md` with documentation changes~ - [x] [Tophatted documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md) changes in the style guide --------- Co-authored-by: Sam Rose <[email protected]>
Hi! We noticed there hasn’t been activity on this PR in a while. After 30 days, it will close automatically. If it’s still relevant, or you have updates, comment and let us know. And don’t worry, you can always re-open later if needed. |
WHY are these changes introduced?
Fixes https://github.com/Shopify/polaris-summer-editions/issues/785
Fixes https://github.com/Shopify/core-workflows/issues/1029
Fixes https://github.com/Shopify/polaris-summer-editions/issues/789
WHAT is this pull request doing?
ActionList
'sItem
being used in the Menu item. Instead we create a customMenuItem
that can easily support features likeindentation
and removing constraints on theavatar
.MenuItem
, they provide atopSection
prop that's passed to the UserMenu. The prop should specify to values:indentItems
anditems
Menu
which applies these changes by rendering the newMenuItem
actions
normally passed toUserMenu
is not affected, thus anyone usingUserMenu
today does not need to make any changes.A follow up to this PR is required after it's released, opened here: https://github.com/Shopify/web/pull/98734
How to 🎩
🎩 checklist
-[] Updated the component'sREADME.md
with documentation changesv