diff --git a/examples/starknet-react-next/src/components/StarknetProvider.tsx b/examples/starknet-react-next/src/components/StarknetProvider.tsx index bf8ba4800..7625caf9b 100644 --- a/examples/starknet-react-next/src/components/StarknetProvider.tsx +++ b/examples/starknet-react-next/src/components/StarknetProvider.tsx @@ -42,10 +42,12 @@ const connectors = [ { target: ETH_TOKEN_ADDRESS, method: "approve", + description: "Lorem Ipsum is simply dummy text of the printing and typesetting industry." }, { target: ETH_TOKEN_ADDRESS, method: "transfer", + // description: "Lorem Ipsum is simply dummy text of the printing and typesetting industry." }, ], { diff --git a/packages/controller/src/types.ts b/packages/controller/src/types.ts index 81c692a97..b4096754d 100644 --- a/packages/controller/src/types.ts +++ b/packages/controller/src/types.ts @@ -41,6 +41,7 @@ export type Session = { export type Policy = { target: string; method?: string; + description?: string; }; export enum ResponseCodes { diff --git a/packages/keychain/src/components/Auth/Login.tsx b/packages/keychain/src/components/Auth/Login.tsx index ccd9b4f40..a8341e35e 100644 --- a/packages/keychain/src/components/Auth/Login.tsx +++ b/packages/keychain/src/components/Auth/Login.tsx @@ -1,4 +1,4 @@ -import { Field, FingerprintIcon } from "@cartridge/ui"; +import { Field } from "@cartridge/ui"; import { VStack, Button } from "@chakra-ui/react"; import { Container } from "../Container"; import { Form as FormikForm, Field as FormikField, Formik } from "formik"; @@ -103,7 +103,10 @@ export function Login({ description="Enter your Controller username" /> - + } > Log in diff --git a/packages/keychain/src/components/Container/index.tsx b/packages/keychain/src/components/Container/index.tsx index 3fea228ea..159256f1d 100644 --- a/packages/keychain/src/components/Container/index.tsx +++ b/packages/keychain/src/components/Container/index.tsx @@ -52,14 +52,14 @@ export function Container({ justify="center" minH={FOOTER_HEIGHT / 4} bottom={0} - position="fixed" + position={["fixed", "fixed", "absolute"]} > Controller by Cartridge - + ); } @@ -85,9 +85,14 @@ function Wrapper({ children }: React.PropsWithChildren) { {/** Show as modal */} - + - + Session details - - Allow {hostname} to execute following actions on your behalf - - + {policies.map((p, i) => ( {({ isExpanded }) => ( <> @@ -73,22 +62,25 @@ export function SessionDetails({ }} > - {} + {p.method} - + {p.description && ( + + )} - TODO: description + {p.description && ( + {p.description} + )} )} diff --git a/packages/keychain/src/components/PortalFooter/TransactionSummary.tsx b/packages/keychain/src/components/PortalFooter/TransactionSummary.tsx index f2c46ab7c..042b2b626 100644 --- a/packages/keychain/src/components/PortalFooter/TransactionSummary.tsx +++ b/packages/keychain/src/components/PortalFooter/TransactionSummary.tsx @@ -1,13 +1,7 @@ import { HStack, VStack, Text, Link, IconProps } from "@chakra-ui/react"; -import { - CodeUtilIcon, - JoystickIcon, - LockIcon, - WrenchIcon, -} from "@cartridge/ui"; +import { LockIcon, WrenchIcon } from "@cartridge/ui"; export function TransactionSummary({ - isSignup, isSlot, showTerm, hostname, @@ -19,18 +13,15 @@ export function TransactionSummary({ }) { return ( - {isSignup && ( - - )} - {hostname && ( - - Create a session for{" "} + + Create a session for + + {hostname}{" "} + + and allow the game to{" "} - {hostname} + perform actions on your behalf )} @@ -73,12 +64,12 @@ export function Summary({ title, children, }: React.PropsWithChildren & { - Icon: React.ComponentType; + Icon?: React.ComponentType; title?: string; }) { return ( - + {Icon && } {title || children} diff --git a/packages/keychain/src/components/PortalFooter/index.tsx b/packages/keychain/src/components/PortalFooter/index.tsx index d06a11d6e..7e2f2cc28 100644 --- a/packages/keychain/src/components/PortalFooter/index.tsx +++ b/packages/keychain/src/components/PortalFooter/index.tsx @@ -1,5 +1,5 @@ import { - Box, + HStack, IconButton, Spacer, VStack, @@ -63,42 +63,12 @@ export function PortalFooter({ p={4} pt={0} borderTopWidth={1} - borderColor="solid.tertiary" + borderColor="solid.spacer" zIndex="999999" as={motion.div} layout="position" animate={{ height, transition: { bounce: 0 } }} > - {isExpandable && ( - - - } - size="lg" - variant="round" - bg="solid.bg" - zIndex="999999" - onClick={onToggle} - /> - - )} - - - - {isOpen && hostname && policies && ( - + + + + + {isExpandable && ( + + } + size="sm" + bg="solid.primary" + zIndex="999999" + onClick={onToggle} + /> + )} + + + {isOpen && policies && ( + )} {/* TODO: starter pack diff --git a/packages/keychain/src/pages/slot/auth/consent.tsx b/packages/keychain/src/pages/slot/auth/consent.tsx index b3c69757f..905df4d3c 100644 --- a/packages/keychain/src/pages/slot/auth/consent.tsx +++ b/packages/keychain/src/pages/slot/auth/consent.tsx @@ -1,5 +1,4 @@ import Controller from "utils/controller"; -import { PlugActiveDuoIcon } from "@cartridge/ui"; import { Button, Text } from "@chakra-ui/react"; import { Container, PortalBanner, PortalFooter } from "components"; import { NextPage } from "next"; @@ -32,7 +31,6 @@ const Consent: NextPage = () => { return (