-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(sandbox): allow setting GM package manually
- Loading branch information
1 parent
e6249cc
commit 5d61043
Showing
3 changed files
with
42 additions
and
1 deletion.
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
35 changes: 35 additions & 0 deletions
35
examples/integration-tests/GumballMachine/SetGumballMachinePackageCard.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,35 @@ | ||
import * as React from 'react' | ||
import { Card } from '../../components/Card' | ||
import { setGumballMachineState, useGumballMachineState } from '../state' | ||
import { Button, FormControl, FormLabel, Input } from '@mui/joy' | ||
|
||
export const SetGumballMachinePackageCard = () => { | ||
const [address, setAddress] = React.useState('') | ||
const { gumballMachinePackageAddress } = useGumballMachineState() | ||
return gumballMachinePackageAddress ? null : ( | ||
<Card title="Set Gumball Machine Package"> | ||
<FormControl> | ||
<FormLabel>Gumball Machine Package Address</FormLabel> | ||
<Input | ||
size="sm" | ||
placeholder="e.g. package_tdx_e_1pkdkzp9qs7pe9nd....." | ||
onChange={(e) => { | ||
setAddress(e.target.value) | ||
}} | ||
/> | ||
</FormControl> | ||
<Button | ||
sx={{ mt: 1 }} | ||
disabled={!address} | ||
onClick={() => { | ||
setGumballMachineState({ | ||
gumballMachinePackageAddress: address, | ||
components: {}, | ||
}) | ||
}} | ||
> | ||
Set Package Address | ||
</Button> | ||
</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