Skip to content

Commit

Permalink
Merge branch 'stage' into charts-period-selector
Browse files Browse the repository at this point in the history
  • Loading branch information
RabeeAbuBaker authored Oct 12, 2023
2 parents a2e5fad + 491040c commit 80d8033
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,61 +42,59 @@ const ChainWhitelistTable = ({
[blockchainWhitelist, blockchains],
)

return (
data && (
<DataTable
data={data?.map((chain) => {
return {
chain: {
element: <Chain chain={chain as Blockchain} />,
value: `${chain?.description} ${chain?.blockchain}`,
cellProps: {
style: { minWidth: "250px" },
width: "30%",
},
},
endpointUrl: {
element: (
<TextInput
readOnly
bg={theme.colors.gray[9]}
miw={300}
value={chain.whitelistValue}
/>
),
return data && data.length > 0 ? (
<DataTable
data={data?.map((chain) => {
return {
chain: {
element: <Chain chain={chain as Blockchain} />,
value: `${chain?.description} ${chain?.blockchain}`,
cellProps: {
style: { minWidth: "250px" },
width: "30%",
},
action: {
element: (
<Flex gap="lg" justify="flex-end">
<CopyTextButton value={chain.whitelistValue} />
{!readOnly && (
<ActionIcon
className={commonClasses.grayOutlinedButton}
radius="xl"
size={40}
variant="outline"
onClick={() =>
onDelete({
blockchainID: chain.id as string,
whitelistValue: chain.whitelistValue,
})
}
>
<LuTrash2 size={18} />
</ActionIcon>
)}
</Flex>
),
cellProps: {
style: { minWidth: "130px" },
width: "130px",
},
},
endpointUrl: {
element: (
<TextInput
readOnly
bg={theme.colors.gray[9]}
miw={300}
value={chain.whitelistValue}
/>
),
},
action: {
element: (
<Flex gap="lg" justify="flex-end">
<CopyTextButton value={chain.whitelistValue} />
{!readOnly && (
<ActionIcon
className={commonClasses.grayOutlinedButton}
radius="xl"
size={40}
variant="outline"
onClick={() =>
onDelete({
blockchainID: chain.id as string,
whitelistValue: chain.whitelistValue,
})
}
>
<LuTrash2 size={18} />
</ActionIcon>
)}
</Flex>
),
cellProps: {
style: { minWidth: "130px" },
width: "130px",
},
}
})}
paginate={false}
/>
)
)
},
}
})}
paginate={false}
/>
) : null
}
export default ChainWhitelistTable
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Stack, Switch, Text } from "@pokt-foundation/pocket-blocks"
import { Form, useParams, useSubmit } from "@remix-run/react"
import { useState } from "react"
import { AnalyticActions, AnalyticCategories, trackEvent } from "~/utils/analytics"

type PrivateSecretKeyProps = {
Expand All @@ -10,6 +11,7 @@ type PrivateSecretKeyProps = {
const PrivateSecretKey = ({ secretKeyRequired, readOnly }: PrivateSecretKeyProps) => {
const submit = useSubmit()
const { appId } = useParams()
const [checked, setChecked] = useState(Boolean(secretKeyRequired))

return (
<Stack py={32}>
Expand All @@ -20,13 +22,14 @@ const PrivateSecretKey = ({ secretKeyRequired, readOnly }: PrivateSecretKeyProps
origins.
</Text>
<Form method="post" onChange={(event) => submit(event.currentTarget)}>
<input hidden readOnly name="secretKeyRequired" value={checked ? "off" : "on"} />
<Switch
aria-label="Private Secret Key Required"
defaultChecked={Boolean(secretKeyRequired)}
checked={checked}
disabled={readOnly}
id="secretRequired"
name="secretKeyRequired"
onChange={() => {
onChange={(event) => {
setChecked(event.currentTarget.checked)
trackEvent({
category: AnalyticCategories.app,
action: AnalyticActions.app_settings_update,
Expand Down

0 comments on commit 80d8033

Please sign in to comment.