Skip to content
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: migrate DisplayedPrice and create DisplayedPriceWithSymbol #361

Open
wants to merge 47 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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 Aug 21, 2024
3513deb
feat: [SC-25297] Update formattedPrice function to render different P…
FrancoAguzzi Aug 21, 2024
e8bd561
feat: [SC-25520] Create stories for DisplayedPriceWithAltText
FrancoAguzzi Aug 21, 2024
4352362
feat: [SC-25297] Optimize alt price and main price alignments | Creat…
FrancoAguzzi Aug 21, 2024
8cc1b5a
feat: [SC-25520] Create changesets for Price components creation PR
FrancoAguzzi Aug 21, 2024
98019e2
feat: [SC-25520] Add DisplayedPriceWithAltPrice export to namekit-rea…
FrancoAguzzi Aug 21, 2024
b967b85
feat: [SC-25297] Created examples of DisplayedPrice for each Currency…
FrancoAguzzi Aug 21, 2024
b5102af
feat: [SC-25297] Delete DisplayedPriceWithAltPrice and update Display…
FrancoAguzzi Aug 22, 2024
9be7ba6
feat: [SC-25297] Set DisplayedPrice to receive custom symbol | Create…
FrancoAguzzi Aug 23, 2024
9d082f4
feat: [SC-25297] Refine DisplayedPrice | Create DomainCardPrice
FrancoAguzzi Aug 24, 2024
3518c5f
Update packages/namekit-react/src/components/DisplayedPrice.tsx
FrancoAguzzi Aug 27, 2024
6d43526
Update packages/namekit-react/src/components/DisplayedPrice.tsx
FrancoAguzzi Aug 27, 2024
1bc48fe
feat: optimized props config of DisplayedPrice and CurrencySymbol
FrancoAguzzi Aug 27, 2024
1145913
Merge branch 'francoaguzzi/sc-25297/migrate-displayed-price' of https…
FrancoAguzzi Aug 27, 2024
0dfb5f9
feat: [SC-25297] Optimized DisplayedPrice and DisplayedPriceConversio…
FrancoAguzzi Aug 29, 2024
5d9f8f1
Update packages/namekit-react/src/components/CurrencySymbol/CurrencyS…
FrancoAguzzi Aug 31, 2024
7e1ff72
Update packages/namekit-react/src/components/CurrencySymbol/CurrencyS…
FrancoAguzzi Aug 31, 2024
b4102df
Update packages/namekit-react/src/components/CurrencySymbol/CurrencyS…
FrancoAguzzi Aug 31, 2024
638108e
Update packages/namekit-react/src/components/DisplayedPrice.tsx
FrancoAguzzi Aug 31, 2024
ac9d1a5
feat: [SC-25297] Move CurrencySymbol related components in namekit-react
FrancoAguzzi Sep 3, 2024
96e8914
feat: [SC-25297] Optimize DisplayedPrice const defining in namekit-react
FrancoAguzzi Sep 3, 2024
577f5c3
feat: [SC-25297] Update namekit-react Storybook stories
FrancoAguzzi Sep 3, 2024
3e16064
Merge remote-tracking branch 'origin/main' into francoaguzzi/sc-25297…
FrancoAguzzi Sep 6, 2024
ba90eea
feat: [SC-25297] Update exporting of Price components to reside in cl…
FrancoAguzzi Sep 6, 2024
cbde6b6
feat: [SC-25297] Update namekit-react Price comps. docs.
FrancoAguzzi Sep 6, 2024
af9334e
Update packages/namekit-react/src/components/CurrencySymbol.tsx
FrancoAguzzi Sep 8, 2024
1965f32
Update packages/namekit-react/src/components/CurrencySymbol.tsx
FrancoAguzzi Sep 8, 2024
7db6237
Update packages/namekit-react/src/components/CurrencySymbol.tsx
FrancoAguzzi Sep 10, 2024
12be939
Update .changeset/quick-ads-pretend.md
FrancoAguzzi Sep 10, 2024
d736ba5
Merge remote-tracking branch 'origin/main' into francoaguzzi/sc-25297…
FrancoAguzzi Sep 10, 2024
7514805
feat: [SC-25297] Refine DisplayedConversionPrice Storybook stories
FrancoAguzzi Sep 10, 2024
31ee390
feat: Update `CurrencySymbol` default prop
FrancoAguzzi Sep 10, 2024
e83797b
Update apps/storybook.namekit.io/stories/Namekit/CurrencySymbol.stori…
FrancoAguzzi Sep 10, 2024
f680557
Update packages/namekit-react/src/components/CurrencySymbol.tsx
FrancoAguzzi Sep 10, 2024
2b3e62f
Update packages/namekit-react/src/components/CurrencySymbol.tsx
FrancoAguzzi Sep 10, 2024
b8e2cbe
feat: [SC-25297] Create GasIcon
FrancoAguzzi Sep 10, 2024
5242ef0
feat: [SC-25297] Refactor Price related stories examples
FrancoAguzzi Sep 10, 2024
f9c7e02
feat: [SC-25297] Rename CurrencySymbology and CurrencySymbolSize props
FrancoAguzzi Sep 10, 2024
a3112ba
feat: [SC-25297] Rename namekit-react icons
FrancoAguzzi Sep 10, 2024
32e3d6d
Merge branch 'francoaguzzi/sc-25297/migrate-displayed-price' of https…
FrancoAguzzi Sep 10, 2024
ab8efc5
Update packages/namekit-react/src/components/CurrencySymbol.tsx
FrancoAguzzi Sep 11, 2024
c190533
feat: [SC-25297] Remove need of UsdTextSymbol
FrancoAguzzi Sep 11, 2024
f068154
feat: [SC-25297] Create explicit className for CurrencySymbol setting
FrancoAguzzi Sep 11, 2024
b3631c1
feat: [SC-25297] Add CurrencySymbol Storybook stories
FrancoAguzzi Sep 11, 2024
792b0c3
feat: [SC-25297] Remove prop as per new alignment to its default value
FrancoAguzzi Sep 11, 2024
a401367
Update packages/namekit-react/src/components/CurrencySymbol.tsx
FrancoAguzzi Nov 4, 2024
7f1a998
Update packages/namekit-react/src/components/CurrencySymbol.tsx
FrancoAguzzi Nov 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/quick-ads-pretend.md
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
1 change: 0 additions & 1 deletion apps/storybook.namekit.io/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@

.colorful-text {
font-weight: 700;
text-decoration: underline;
color: lightgreen;
}
134 changes: 71 additions & 63 deletions apps/storybook.namekit.io/stories/Namekit/CurrencySymbol.stories.tsx
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";

FrancoAguzzi marked this conversation as resolved.
Show resolved Hide resolved
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>;
Loading