-
Notifications
You must be signed in to change notification settings - Fork 2
feat: migrate DisplayedPrice and create DisplayedPriceWithSymbol #361
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
Open
FrancoAguzzi
wants to merge
47
commits into
main
Choose a base branch
from
francoaguzzi/sc-25297/migrate-displayed-price
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
47 commits
Select commit
Hold shift + click to select a range
386f653
feat: [SC-25297] Migrate DisplayedPrice comp. to namekit-react
FrancoAguzzi 3513deb
feat: [SC-25297] Update formattedPrice function to render different P…
FrancoAguzzi e8bd561
feat: [SC-25520] Create stories for DisplayedPriceWithAltText
FrancoAguzzi 4352362
feat: [SC-25297] Optimize alt price and main price alignments | Creat…
FrancoAguzzi 8cc1b5a
feat: [SC-25520] Create changesets for Price components creation PR
FrancoAguzzi 98019e2
feat: [SC-25520] Add DisplayedPriceWithAltPrice export to namekit-rea…
FrancoAguzzi b967b85
feat: [SC-25297] Created examples of DisplayedPrice for each Currency…
FrancoAguzzi b5102af
feat: [SC-25297] Delete DisplayedPriceWithAltPrice and update Display…
FrancoAguzzi 9be7ba6
feat: [SC-25297] Set DisplayedPrice to receive custom symbol | Create…
FrancoAguzzi 9d082f4
feat: [SC-25297] Refine DisplayedPrice | Create DomainCardPrice
FrancoAguzzi 3518c5f
Update packages/namekit-react/src/components/DisplayedPrice.tsx
FrancoAguzzi 6d43526
Update packages/namekit-react/src/components/DisplayedPrice.tsx
FrancoAguzzi 1bc48fe
feat: optimized props config of DisplayedPrice and CurrencySymbol
FrancoAguzzi 1145913
Merge branch 'francoaguzzi/sc-25297/migrate-displayed-price' of https…
FrancoAguzzi 0dfb5f9
feat: [SC-25297] Optimized DisplayedPrice and DisplayedPriceConversio…
FrancoAguzzi 5d9f8f1
Update packages/namekit-react/src/components/CurrencySymbol/CurrencyS…
FrancoAguzzi 7e1ff72
Update packages/namekit-react/src/components/CurrencySymbol/CurrencyS…
FrancoAguzzi b4102df
Update packages/namekit-react/src/components/CurrencySymbol/CurrencyS…
FrancoAguzzi 638108e
Update packages/namekit-react/src/components/DisplayedPrice.tsx
FrancoAguzzi ac9d1a5
feat: [SC-25297] Move CurrencySymbol related components in namekit-react
FrancoAguzzi 96e8914
feat: [SC-25297] Optimize DisplayedPrice const defining in namekit-react
FrancoAguzzi 577f5c3
feat: [SC-25297] Update namekit-react Storybook stories
FrancoAguzzi 3e16064
Merge remote-tracking branch 'origin/main' into francoaguzzi/sc-25297…
FrancoAguzzi ba90eea
feat: [SC-25297] Update exporting of Price components to reside in cl…
FrancoAguzzi cbde6b6
feat: [SC-25297] Update namekit-react Price comps. docs.
FrancoAguzzi af9334e
Update packages/namekit-react/src/components/CurrencySymbol.tsx
FrancoAguzzi 1965f32
Update packages/namekit-react/src/components/CurrencySymbol.tsx
FrancoAguzzi 7db6237
Update packages/namekit-react/src/components/CurrencySymbol.tsx
FrancoAguzzi 12be939
Update .changeset/quick-ads-pretend.md
FrancoAguzzi d736ba5
Merge remote-tracking branch 'origin/main' into francoaguzzi/sc-25297…
FrancoAguzzi 7514805
feat: [SC-25297] Refine DisplayedConversionPrice Storybook stories
FrancoAguzzi 31ee390
feat: Update `CurrencySymbol` default prop
FrancoAguzzi e83797b
Update apps/storybook.namekit.io/stories/Namekit/CurrencySymbol.stori…
FrancoAguzzi f680557
Update packages/namekit-react/src/components/CurrencySymbol.tsx
FrancoAguzzi 2b3e62f
Update packages/namekit-react/src/components/CurrencySymbol.tsx
FrancoAguzzi b8e2cbe
feat: [SC-25297] Create GasIcon
FrancoAguzzi 5242ef0
feat: [SC-25297] Refactor Price related stories examples
FrancoAguzzi f9c7e02
feat: [SC-25297] Rename CurrencySymbology and CurrencySymbolSize props
FrancoAguzzi a3112ba
feat: [SC-25297] Rename namekit-react icons
FrancoAguzzi 32e3d6d
Merge branch 'francoaguzzi/sc-25297/migrate-displayed-price' of https…
FrancoAguzzi ab8efc5
Update packages/namekit-react/src/components/CurrencySymbol.tsx
FrancoAguzzi c190533
feat: [SC-25297] Remove need of UsdTextSymbol
FrancoAguzzi f068154
feat: [SC-25297] Create explicit className for CurrencySymbol setting
FrancoAguzzi b3631c1
feat: [SC-25297] Add CurrencySymbol Storybook stories
FrancoAguzzi 792b0c3
feat: [SC-25297] Remove prop as per new alignment to its default value
FrancoAguzzi a401367
Update packages/namekit-react/src/components/CurrencySymbol.tsx
FrancoAguzzi 7f1a998
Update packages/namekit-react/src/components/CurrencySymbol.tsx
FrancoAguzzi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| "@namehash/namekit-react": minor | ||
| "@namehash/ens-utils": minor | ||
| --- | ||
|
|
||
| Create DisplayedPrice and DisplayedPriceConversion components + new price utilities |
This file contains hidden or 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,6 +5,5 @@ | |
|
|
||
| .colorful-text { | ||
| font-weight: 700; | ||
| text-decoration: underline; | ||
| color: lightgreen; | ||
| } | ||
134 changes: 71 additions & 63 deletions
134
apps/storybook.namekit.io/stories/Namekit/CurrencySymbol.stories.tsx
This file contains hidden or 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 |
|---|---|---|
| @@ -1,96 +1,104 @@ | ||
| import { Currency } from "@namehash/ens-utils"; | ||
| import { CurrencySymbol } from "@namehash/namekit-react/client"; | ||
| import { CurrencySymbolSize } from "@namehash/namekit-react/client"; | ||
| import { | ||
| CurrencySymbol, | ||
| CurrencySymbology, | ||
| } from "@namehash/namekit-react/client"; | ||
| import { CurrencyIconSize } from "@namehash/namekit-react/client"; | ||
| import type { Meta, StoryObj } from "@storybook/react"; | ||
|
|
||
| export const ETH: Story = { | ||
| args: { | ||
| currency: Currency.Eth, | ||
| size: CurrencySymbolSize.Large, | ||
| }, | ||
| }; | ||
| export const USD: Story = { | ||
| args: { | ||
| currency: Currency.Usd, | ||
| size: CurrencySymbolSize.Large, | ||
| const meta: Meta<typeof CurrencySymbol> = { | ||
| component: CurrencySymbol, | ||
| title: "Namekit/CurrencySymbol", | ||
| argTypes: { | ||
| currency: { | ||
| options: Object.values(Currency), | ||
| control: { | ||
| labels: Object.keys(Currency), | ||
| type: "select", | ||
| }, | ||
| }, | ||
| iconSize: { | ||
| options: Object.values(CurrencyIconSize), | ||
| if: { arg: "symbology", eq: CurrencySymbology.Icon }, | ||
| control: { | ||
| labels: { | ||
| [CurrencyIconSize.Small]: "Small (16px)", | ||
| [CurrencyIconSize.Large]: "Large (20px)", | ||
| }, | ||
| type: "select", | ||
| }, | ||
| }, | ||
| className: { | ||
| if: { arg: "symbology", neq: CurrencySymbology.Icon }, | ||
| control: { | ||
| type: "text", | ||
| }, | ||
| }, | ||
| describeCurrencyInTooltip: { control: { type: "boolean" } }, | ||
| symbology: { | ||
| options: Object.keys(CurrencySymbology), | ||
| control: { type: "select" }, | ||
| }, | ||
| }, | ||
| }; | ||
| export const USDC: Story = { | ||
| args: { | ||
FrancoAguzzi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| currency: Currency.Usdc, | ||
| size: CurrencySymbolSize.Large, | ||
| iconSize: CurrencyIconSize.Small, | ||
| describeCurrencyInTooltip: false, | ||
| symbology: CurrencySymbology.TextSymbol, | ||
| }, | ||
| }; | ||
| export const WETH: Story = { | ||
|
|
||
| export default meta; | ||
|
|
||
| type Story = StoryObj<typeof CurrencySymbol>; | ||
|
|
||
| export const AsAnAcronym: Story = { | ||
| args: { | ||
| currency: Currency.Weth, | ||
| size: CurrencySymbolSize.Large, | ||
| currency: Currency.Eth, | ||
| symbology: CurrencySymbology.Acronym, | ||
| }, | ||
| }; | ||
| export const DAI: Story = { | ||
| export const AsATextSymbol: Story = { | ||
| args: { | ||
| currency: Currency.Dai, | ||
| size: CurrencySymbolSize.Large, | ||
| currency: Currency.Eth, | ||
| symbology: CurrencySymbology.TextSymbol, | ||
| }, | ||
| }; | ||
| export const SmallSize: Story = { | ||
| export const AsASmallIcon: Story = { | ||
| args: { | ||
| size: CurrencySymbolSize.Small, | ||
| currency: Currency.Eth, | ||
| iconSize: CurrencyIconSize.Small, | ||
| symbology: CurrencySymbology.Icon, | ||
| }, | ||
| }; | ||
| export const LargeSize: Story = { | ||
FrancoAguzzi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| export const AsALargeIcon: Story = { | ||
| args: { | ||
| size: CurrencySymbolSize.Large, | ||
| currency: Currency.Eth, | ||
| iconSize: CurrencyIconSize.Large, | ||
| symbology: CurrencySymbology.Icon, | ||
| }, | ||
| }; | ||
| export const WithCustomSymbolColor: Story = { | ||
| export const WithCustomIconColor: Story = { | ||
| argTypes: { | ||
| fill: { control: { type: "color" } }, | ||
| }, | ||
| args: { | ||
| symbolFillColor: "#007bff", | ||
| size: CurrencySymbolSize.Large, | ||
| currency: Currency.Eth, | ||
| symbology: CurrencySymbology.Icon, | ||
| fill: "#007bff", | ||
| }, | ||
| }; | ||
| export const ShowingTooltipDescription: Story = { | ||
| export const WithCustomFontStyle: Story = { | ||
| argTypes: { | ||
| className: { control: { type: "text" } }, | ||
| }, | ||
| args: { | ||
| describeCurrencyInTooltip: true, | ||
| size: CurrencySymbolSize.Large, | ||
| currency: Currency.Eth, | ||
| className: "nk-text-3xl colorful-text", | ||
| }, | ||
| }; | ||
| export const NotShowingTooltipDescription: Story = { | ||
| export const ShowingTooltipDescription: Story = { | ||
| args: { | ||
| describeCurrencyInTooltip: false, | ||
| size: CurrencySymbolSize.Large, | ||
| currency: Currency.Eth, | ||
| describeCurrencyInTooltip: true, | ||
| }, | ||
| }; | ||
|
|
||
| const meta: Meta<typeof CurrencySymbol> = { | ||
| component: CurrencySymbol, | ||
| title: "Namekit/CurrencySymbol", | ||
| argTypes: { | ||
| symbolFillColor: { control: "color" }, | ||
| currency: { | ||
| options: [ | ||
| Currency.Eth, | ||
| Currency.Usd, | ||
| Currency.Usdc, | ||
| Currency.Weth, | ||
| Currency.Dai, | ||
| ], | ||
| control: { type: "select" }, | ||
| }, | ||
| size: { | ||
| options: Object.keys(CurrencySymbolSize), | ||
| mapping: CurrencySymbolSize, | ||
| control: { type: "select" }, | ||
| }, | ||
| describeCurrencyInTooltip: { control: { type: "boolean" } }, | ||
| }, | ||
| }; | ||
|
|
||
| export default meta; | ||
|
|
||
| type Story = StoryObj<typeof CurrencySymbol>; | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.