-
-
Notifications
You must be signed in to change notification settings - Fork 259
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(suite): refactor staking modals
- Loading branch information
Showing
12 changed files
with
125 additions
and
154 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
52 changes: 27 additions & 25 deletions
52
packages/suite/src/components/suite/StakingProcess/InfoRow.tsx
This file contains 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,33 +1,35 @@ | ||
import { Badge, Column, List, Paragraph, Row } from '@trezor/components'; | ||
|
||
import { Subheading } from './Subheading'; | ||
import { RowContent, RowSubheading } from './types'; | ||
import { Badge, BulletList, Paragraph, Row } from '@trezor/components'; | ||
|
||
interface InfoRowProps { | ||
heading: React.ReactNode; | ||
subheading: RowSubheading; | ||
content: RowContent; | ||
subheading?: React.ReactNode; | ||
content?: { | ||
text: React.ReactNode; | ||
isBadge?: boolean; | ||
}; | ||
isExpanded?: boolean; | ||
} | ||
|
||
export const InfoRow = ({ heading, subheading, content, isExpanded = false }: InfoRowProps) => { | ||
const displayContent = content.isBadge ? ( | ||
<Badge size="tiny">{content.text}</Badge> | ||
) : ( | ||
<Paragraph variant="tertiary" typographyStyle="hint"> | ||
{content.text} | ||
</Paragraph> | ||
); | ||
|
||
return ( | ||
<List.Item> | ||
export const InfoRow = ({ heading, subheading, content, isExpanded = false }: InfoRowProps) => ( | ||
<BulletList.Item | ||
title={ | ||
<Row justifyContent="space-between"> | ||
<Column> | ||
{heading} | ||
<Subheading isExpanded={isExpanded} subheading={subheading} /> | ||
</Column> | ||
{displayContent} | ||
{heading} | ||
{content && | ||
(content.isBadge ? ( | ||
<Badge size="tiny">{content.text}</Badge> | ||
) : ( | ||
<Paragraph variant="tertiary" typographyStyle="hint"> | ||
{content.text} | ||
</Paragraph> | ||
))} | ||
</Row> | ||
</List.Item> | ||
); | ||
}; | ||
} | ||
> | ||
{subheading && isExpanded && ( | ||
<Paragraph variant="tertiary" typographyStyle="hint"> | ||
{subheading} | ||
</Paragraph> | ||
)} | ||
</BulletList.Item> | ||
); |
This file contains 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
27 changes: 0 additions & 27 deletions
27
packages/suite/src/components/suite/StakingProcess/Subheading.tsx
This file was deleted.
Oops, something went wrong.
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.