-
Notifications
You must be signed in to change notification settings - Fork 556
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
882232c
commit e759aa2
Showing
3 changed files
with
59 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { createSnapComponent } from '../component'; | ||
|
||
/** | ||
* The props of the {@link Cell} component. | ||
* | ||
* @property image - The image to show as part of the Cell, must be an SVG string. | ||
* @property title - The title. | ||
* @property description - The description, shown below the title. | ||
* @property value - The value, shown on the right side. | ||
* @property extra - An additional optional value shown below the value. | ||
*/ | ||
export type CellProps = { | ||
image?: string | undefined; | ||
title: string; | ||
description?: string | undefined; | ||
value: string; | ||
extra?: string | undefined; | ||
}; | ||
|
||
const TYPE = 'Cell'; | ||
|
||
/** | ||
* A cell component which can be used to display values within a cell structure. | ||
* | ||
* @param props - The props of the component. | ||
* @param props.image - The image to show as part of the Cell, must be an SVG string. | ||
* @param props.title - The title. | ||
* @param props.description - The description, shown below the title. | ||
* @param props.value - The value, shown on the right side. | ||
* @param props.extra - An additional optional value shown below the value. | ||
* @returns A box element. | ||
* @example | ||
* <Cell image="<svg />" title="Title" description="Description" value="$1200" extra="0.12 ETH" /> | ||
*/ | ||
export const Cell = createSnapComponent<CellProps, typeof TYPE>(TYPE); | ||
|
||
/** | ||
* A cell element. | ||
* | ||
* @see Cell | ||
*/ | ||
export type CellElement = ReturnType<typeof Cell>; |
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