-
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.
Update preinstalled example to make buttons actually work
- Loading branch information
Showing
5 changed files
with
94 additions
and
6 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
1 change: 1 addition & 0 deletions
1
packages/examples/packages/preinstalled/src/components/index.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 +1,2 @@ | ||
export * from './dialog'; | ||
export * from './result'; |
34 changes: 34 additions & 0 deletions
34
packages/examples/packages/preinstalled/src/components/result.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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import type { SnapComponent } from '@metamask/snaps-sdk/jsx'; | ||
import { | ||
Copyable, | ||
Box, | ||
Container, | ||
Heading, | ||
Text, | ||
Footer, | ||
Button, | ||
} from '@metamask/snaps-sdk/jsx'; | ||
|
||
export type ResultProps = { | ||
value: string; | ||
}; | ||
|
||
/** | ||
* A result component. | ||
* | ||
* @param props - The props of the component. | ||
* @param props.value - The value to display. | ||
* @returns The result component. | ||
*/ | ||
export const Result: SnapComponent<ResultProps> = ({ value }) => ( | ||
<Container> | ||
<Box> | ||
<Heading>Custom Dialog</Heading> | ||
<Text>The form was submitted with the following value:</Text> | ||
<Copyable value={value} /> | ||
</Box> | ||
<Footer> | ||
<Button name="ok">Ok</Button> | ||
</Footer> | ||
</Container> | ||
); |
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