-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat: account list select component #3287
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -16,7 +16,7 @@ export class WuiShimmer extends LitElement { | |||
|
|||
@property() public height = '' | |||
|
|||
@property() public borderRadius: BorderRadiusType = 'm' | |||
@property() public borderRadius: BorderRadiusType = '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.
I changed this to "2" for now to not get any errors. Will come back to shimmer component and fix it.
font-feature-settings: | ||
'liga' off, | ||
'clig' off; |
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 added this css font feature setting to KHTeka font only
let borderRadius: BorderRadiusType = '1' | ||
if (this.size === 'lg') { | ||
borderRadius = 'm' | ||
borderRadius = '3' | ||
} else if (this.size === 'md') { | ||
borderRadius = 'xs' | ||
borderRadius = '2' | ||
} else { | ||
borderRadius = 'xxs' | ||
borderRadius = '1' | ||
} |
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.
Same here just a tweaked it for now
<wui-avatar size="sm" address=${this.address}></wui-avatar> | ||
<wui-icon class="avatarIcon" size="xs" name=${this.icon}></wui-icon> |
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 should create avatar + badge component instead of doing it manually. I created a ticket called APKT-1507 where we comment down all todos so we don't forget.
<wui-text color="secondary" variant="lg-regular-mono" lineClamp="1"> | ||
$${this.dollars}.${this.pennies} | ||
</wui-text> |
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.
Same here would be better to have dollar balance component
dollars: '1740', | ||
pennies: '72', |
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.
Why these two are different properties? We should instead format the number inside. We should have such utilities
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.
Also tried removing penny value in story and there is still dot after dollars value: https://appkit-gallery-brxkv59qj-reown-com.vercel.app/?path=/docs/composites-wui-list-select-account--docs
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.
Same when you remove dollar value, you see "$." in the component
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.
Just added UiHelperUtil.formatCurrency
function which will convert numbers into formatted dollar value 🙏
font-feature-settings: | ||
'liga' off, | ||
'clig' off; |
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.
Why do we need these?
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 noticed i forgot to add these from figma heading designs. Apparently it'll provide more advanced typographic features and make fonts cleaner 👌
@property() pennies = '00' | ||
|
||
@property() address = '' |
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.
Same for the comment above, I think better practice instead of getting these values separately, getting the value and format it here with floating numbers. Also for such components it's important to make sure we're testing them with different values like very small values and very big numbers
|
||
@property() icon: IconType = 'mail' | ||
|
||
@property({ type: Number }) dollarAmount = 0 |
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.
For future features, maybe we would start showing different currencies depending on the user's choice, what about separating amount
and currency
and we would keep the currency USD by default for now?
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.
Good idea. Let me do that.
columnGap="2" | ||
> | ||
<wui-text color="secondary" variant="lg-regular-mono" lineClamp="1"> | ||
${UiHelperUtil.formatCurrency(this.dollarAmount)} |
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.
Awesome
@@ -16,6 +16,24 @@ export const UiHelperUtil = { | |||
return new Intl.DateTimeFormat('en-US', { month: 'short', day: 'numeric' }).format(date) | |||
}, | |||
|
|||
formatCurrency(amount: number | string = 0, options: Intl.NumberFormatOptions = {}) { | |||
const numericAmount = Number(amount) |
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.
Should we cast it to number? What if the number is comes float? and when there are many floating numbers, isn't this will remove them?
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.
Okay seems like not yeah
Description
font-feature-settings
option to<wui-text>
Type of change
Associated Issues
For Linear issues: Closes APKT-1500
Showcase (Optional)
Checklist