-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: extend sandbox with PoO request
PoO - proof of ownership
- Loading branch information
1 parent
ff4363f
commit 4ddb5b6
Showing
6 changed files
with
231 additions
and
12 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 |
---|---|---|
|
@@ -76,7 +76,6 @@ export const PersonaDataCard = () => { | |
) | ||
} | ||
)} | ||
; | ||
<Box mt={2}> | ||
<Checkbox | ||
disabled={!enabled} | ||
|
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,92 @@ | ||
import Box from '@mui/joy/Box' | ||
import Checkbox from '@mui/joy/Checkbox' | ||
import { Card } from '../components/Card' | ||
import { Button, Input } from '@mui/joy' | ||
|
||
export const AccountsProofCard = ({ | ||
state, | ||
updateState | ||
}: { | ||
state: { | ||
enabled: boolean | ||
data: { | ||
addresses: string[] | ||
} | ||
} | ||
updateState: (state: { | ||
enabled: boolean | ||
data: { | ||
addresses: string[] | ||
} | ||
}) => void | ||
}) => { | ||
const enabled = !!state.enabled | ||
return ( | ||
<Card | ||
title="Accounts Proof of Ownership" | ||
side={ | ||
<Checkbox | ||
checked={enabled} | ||
onChange={(ev) => { | ||
updateState({ ...state, enabled: ev.target.checked }) | ||
}} | ||
/> | ||
} | ||
> | ||
<Box | ||
sx={{ | ||
p: 2, | ||
display: 'grid', | ||
gap: 2 | ||
}} | ||
> | ||
<Button | ||
color="primary" | ||
onClick={() => { | ||
updateState({ | ||
...state, | ||
data: { | ||
addresses: [...state.data.addresses, ''] | ||
} | ||
}) | ||
}} | ||
> | ||
Add | ||
</Button> | ||
{state.data.addresses.map((address, index) => ( | ||
<Box sx={{ display: 'flex', gap: 1 }} key={index}> | ||
<Input | ||
sx={{ width: '100%' }} | ||
placeholder="account address" | ||
value={address} | ||
onChange={(ev) => { | ||
const addresses = [...state.data.addresses] | ||
addresses[index] = ev.target.value | ||
updateState({ | ||
...state, | ||
data: { | ||
addresses | ||
} | ||
}) | ||
}} | ||
/> | ||
<Button | ||
onClick={() => { | ||
const addresses = [...state.data.addresses] | ||
addresses.splice(index, 1) | ||
updateState({ | ||
...state, | ||
data: { | ||
addresses | ||
} | ||
}) | ||
}} | ||
> | ||
x | ||
</Button> | ||
</Box> | ||
))} | ||
</Box> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import Box from '@mui/joy/Box' | ||
import Checkbox from '@mui/joy/Checkbox' | ||
import { Card } from '../components/Card' | ||
import { Input } from '@mui/joy' | ||
|
||
export const PersonaProofCard = ({ | ||
state, | ||
updateState | ||
}: { | ||
state: { | ||
enabled: boolean | ||
data: { | ||
address: string | ||
} | ||
} | ||
updateState: (state: { | ||
enabled: boolean | ||
data: { | ||
address: string | ||
} | ||
}) => void | ||
}) => { | ||
const enabled = !!state.enabled | ||
return ( | ||
<Card | ||
title="Persona Proof of Ownership" | ||
side={ | ||
<Checkbox | ||
checked={enabled} | ||
onChange={(ev) => { | ||
updateState({ ...state, enabled: ev.target.checked }) | ||
}} | ||
/> | ||
} | ||
> | ||
<Box sx={{ p: 2 }}> | ||
<Input | ||
placeholder="Identity address" | ||
onChange={(event) => { | ||
updateState({ | ||
...state, | ||
data: { address: event.target.value.toString() } | ||
}) | ||
}} | ||
/> | ||
</Box> | ||
</Card> | ||
) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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