-
Notifications
You must be signed in to change notification settings - Fork 557
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
73b0267
commit bb11d5a
Showing
5 changed files
with
33 additions
and
33 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
24 changes: 12 additions & 12 deletions
24
...ages/snaps-sdk/src/jsx/components/Cell.ts → ...ages/snaps-sdk/src/jsx/components/Card.ts
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,42 +1,42 @@ | ||
import { createSnapComponent } from '../component'; | ||
|
||
/** | ||
* The props of the {@link Cell} component. | ||
* The props of the {@link Card} component. | ||
* | ||
* @property image - The image to show as part of the Cell, must be an SVG string. | ||
* @property image - The image to show as part of the card, 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 = { | ||
export type CardProps = { | ||
image?: string | undefined; | ||
title: string; | ||
description?: string | undefined; | ||
value: string; | ||
extra?: string | undefined; | ||
}; | ||
|
||
const TYPE = 'Cell'; | ||
const TYPE = 'Card'; | ||
|
||
/** | ||
* A cell component which can be used to display values within a cell structure. | ||
* A card component which can be used to display values within a card 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.image - The image to show as part of the card, 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. | ||
* @returns A card element. | ||
* @example | ||
* <Cell image="<svg />" title="Title" description="Description" value="$1200" extra="0.12 ETH" /> | ||
* <Card image="<svg />" title="Title" description="Description" value="$1200" extra="0.12 ETH" /> | ||
*/ | ||
export const Cell = createSnapComponent<CellProps, typeof TYPE>(TYPE); | ||
export const Card = createSnapComponent<CardProps, typeof TYPE>(TYPE); | ||
|
||
/** | ||
* A cell element. | ||
* A card element. | ||
* | ||
* @see Cell | ||
* @see Card | ||
*/ | ||
export type CellElement = ReturnType<typeof Cell>; | ||
export type CardElement = ReturnType<typeof Card>; |
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