From be10223df977a814beb022a5af159dd09e62884f Mon Sep 17 00:00:00 2001 From: Ammar Arif Date: Tue, 11 Jun 2024 10:06:33 -0400 Subject: [PATCH] Improve policy list scrolling (#346) * MAKE SCROLLING BETTER * fix * update example with more policies to showcase the fix * Change overflow scroll to auto --------- Co-authored-by: JunichiSugiura --- .../src/components/StarknetProvider.tsx | 16 ++++++++++-- .../layout/Footer/SessionDetails.tsx | 26 +++++++++++-------- .../src/components/layout/Footer/index.tsx | 16 ++---------- 3 files changed, 31 insertions(+), 27 deletions(-) diff --git a/examples/starknet-react-next/src/components/StarknetProvider.tsx b/examples/starknet-react-next/src/components/StarknetProvider.tsx index 7e3a41562..c245eb499 100644 --- a/examples/starknet-react-next/src/components/StarknetProvider.tsx +++ b/examples/starknet-react-next/src/components/StarknetProvider.tsx @@ -42,12 +42,24 @@ const connectors = [ { target: ETH_TOKEN_ADDRESS, method: "approve", - description: "Lorem Ipsum is simply dummy text of the printing and typesetting industry." + 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." + }, + { + target: ETH_TOKEN_ADDRESS, + method: "mint", + }, + { + target: ETH_TOKEN_ADDRESS, + method: "burn", + }, + { + target: ETH_TOKEN_ADDRESS, + method: "allowance", }, ], { diff --git a/packages/keychain/src/components/layout/Footer/SessionDetails.tsx b/packages/keychain/src/components/layout/Footer/SessionDetails.tsx index 897d8ef49..46eb1dc02 100644 --- a/packages/keychain/src/components/layout/Footer/SessionDetails.tsx +++ b/packages/keychain/src/components/layout/Footer/SessionDetails.tsx @@ -12,26 +12,27 @@ import { CodeUtilIcon, WedgeRightIcon } from "@cartridge/ui"; import { motion } from "framer-motion"; import { usePolicies } from "hooks/connection"; -export function SessionDetails({ - isOpen, -}: { - isOpen: boolean; -}) { +export function SessionDetails() { const policies = usePolicies(); return ( - + - + {policies.map((p, i) => ( diff --git a/packages/keychain/src/components/layout/Footer/index.tsx b/packages/keychain/src/components/layout/Footer/index.tsx index f45f2389d..13fa36e67 100644 --- a/packages/keychain/src/components/layout/Footer/index.tsx +++ b/packages/keychain/src/components/layout/Footer/index.tsx @@ -58,19 +58,7 @@ export function Footer({ layout="position" animate={{ height, transition: { bounce: 0 } }} > - + {isOpen && ( - + )}