-
Notifications
You must be signed in to change notification settings - Fork 146
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
refactor(send-form): remove custom dropdown type #4975
Conversation
@@ -1,7 +1,7 @@ | |||
import { fetchBtcNameOwner } from '@app/query/stacks/bns/bns.utils'; | |||
|
|||
import { GenericRecipientField } from '../../../components/recipient-fields/generic-recipient-field'; | |||
import { RecipientField } from '../../../components/recipient-fields/recipient-field'; |
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.
It'd be nice to refactor the path while we're 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.
This LGTM. It might be nice to wrap the Dropdown
and then pass the trigger in a slot prop
@kyranjamie I think commits are included here that you didn't intend to be reviewed again? Will just review the dropdown changes here. |
Yep, fixing now |
@@ -33,13 +34,23 @@ interface FlagProps extends FlexProps { | |||
export function Flag({ | |||
spacing = 'space.03', | |||
align = 'middle', | |||
reverse = false, |
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 will be helpful, was thinking about this yesterday with the Callout.
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.
It prob does make sense to make the trigger customizable. 👍
361ff1d
to
d17861e
Compare
see 3b57aa2 and LMK what you think. Now thinking it should be a |
d17861e
to
3b57aa2
Compare
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.
lgtm 👍
re: unstyled trigger, I'm ok with the current solution, just think we can put this trigger you created to a "DefaultDropdownTrigger" variable or smth like that. so we don't copy paste it in future?
also think it would be nice to add rotate animation there
...s/send/send-crypto-asset-form/components/recipient-type-dropdown/recipient-type-dropdown.tsx
Outdated
Show resolved
Hide resolved
If that ends up working better, def fine with it. |
9e0ed71
to
e9f211e
Compare
I've made some updates to the dropdown animations: Before 2024-02-23-000109.mp4After 2024-02-23-000111.mp4Improvements
|
e9f211e
to
1c28777
Compare
@kyranjamie your improvements lgtm, I think I just wasn't sure what we wanted or where it would be applied when implemented ...so, I believe I used the primitive example properties from Radix dropdown menu for the animations. |
In regards to the focused state, we do seem to have a really bold focused state everywhere, I wonder if that should be less emphasized overall and NOT a bright blue? It was in the designs for the |
Nice! I'd recommend to remove the open/close animation for the chevron here, it's too much. Fine to just leave it stay static, sometimes, less is more — How about adding a hover state using |
@kyranjamie awesome improvements!! love it! Wondering if updating to this would make sense? If so, let me know as we need to review the design with the team. https://www.figma.com/file/FlmF7ropcijOb7iVSDqNn0/%F0%9F%9F%A7-Web-App-Explorations-2024-H1?type=design&node-id=1214-134266&mode=design&t=vjpn8FdOAx69G198-4 |
1c28777
to
b35e5c0
Compare
I will make a new issue for this work @mica000 so we can merge this one as is |
b35e5c0
to
604e0b4
Compare
userSelect: 'none', | ||
'[data-state=open] &': { bg: 'ink.component-background-pressed' }, | ||
}); | ||
function Button({ children, ...props }: HTMLStyledProps<'div'>) { |
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.
@kyranjamie rebased on these changes and slightly confused bc this doesn't appear to be used? You coming back to 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.
Nvm, I see what is happening here, you used the 'unstyled' trigger in code and left this for use as the styled button. I am working on fixing the settings menu trigger button in Pete's work, so in this code a bit.
Making a separate PR so changes are easier to review. Related to #4960.
This PR removes the custom dropdown we had implemented for the recipient type dropdown: address or bns name. This simplifies our code in removing a duplicate component, and using a legit dropdown component. @fbwoolf knows how thrilled I will be to remove it haha.
Unable to use custom trigger
Our Dropdown component assumes we'll always use the same trigger. In this instance we need a custom trigger. Temp solution here is to export an Unstyled trigger and use that instead. But curious to hear ideas how we might do better than this? Should we never assume the trigger styles and always pass it in?
From the looks of the designs, the normal trigger is just a button with an arrow in it. Should we could make a separate
<DropdownButton />
component and pass that into<Dropdown.Trigger />
? Leaving Trigger unstyled in the core dropdown? Pretty sure we'll need custom trigger dropdowns again in future.Added
reverse
prop to<Flag />
Per definition of Flag object, it can have a
reverse
prop, which I wanted to utilise for this bit of UI, so I just added it.