Skip to content

Commit

Permalink
Add storybook, remove CSS
Browse files Browse the repository at this point in the history
  • Loading branch information
darkwing committed May 16, 2023
1 parent fdc5339 commit 2d0bbf8
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export default function CurrencyDisplay({
<Text
as="span"
className="currency-display-component__text"
ellipsis
{...textProps}
>
{parts.prefix}
Expand Down
60 changes: 60 additions & 0 deletions ui/components/ui/currency-display/currency-display.stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import React from 'react';
import { decimalToHex } from '../../../../shared/modules/conversion.utils';
import CurrencyDisplay from '.';

export default {
title: 'Components/UI/CurrencyDisplay',

argTypes: {
value: {
control: {
type: 'text',
},
},
displayValue: {
control: {
type: 'text',
},
},
currency: {
control: {
type: 'text',
},
},
prefix: {
control: {
type: 'text',
},
},
suffix: {
control: {
type: 'text',
},
},
numberOfDecimals: {
control: {
type: 'text',
},
},
denomination: {
control: {
type: 'text',
},
},
},
args: {
denomination: 'ETH',
value: decimalToHex('123.45'),
numberOfDecimals: '2',
currency: 'USD',
prefix: '$',
},
};

export const DefaultStory = (args) => <CurrencyDisplay {...args} />;
DefaultStory.storyName = 'Default';

export const DisplayValueStory = (args) => (
<CurrencyDisplay {...args} displayValue="44.43" />
);
DefaultStory.storyName = 'Display Value';
9 changes: 0 additions & 9 deletions ui/components/ui/currency-display/index.scss

This file was deleted.

1 change: 0 additions & 1 deletion ui/components/ui/ui-components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
@import 'chip/chip';
@import 'color-indicator/color-indicator';
@import 'confusable/index';
@import 'currency-display/index';
@import 'definition-list/definition-list';
@import 'dialog/dialog';
@import 'dropdown/dropdown';
Expand Down

0 comments on commit 2d0bbf8

Please sign in to comment.