diff --git a/packages/keychain/src/components/layout/container/index.tsx b/packages/keychain/src/components/layout/container/index.tsx index fa9abc6e7..c64d8878c 100644 --- a/packages/keychain/src/components/layout/container/index.tsx +++ b/packages/keychain/src/components/layout/container/index.tsx @@ -1,11 +1,3 @@ -import { - Container as ChakraContainer, - VStack, - StyleProps, - Flex, - Show, -} from "@chakra-ui/react"; -import { motion } from "framer-motion"; import { PropsWithChildren, createContext, useContext, useState } from "react"; import { Header, HeaderProps } from "./header"; import { useDisclosure } from "@cartridge/ui-next"; @@ -20,88 +12,54 @@ export function Container({ icon, title, description, - variant, + variant = "compressed", + className, }: { variant?: LayoutVariant; } & PropsWithChildren & - StyleProps & - HeaderProps) { - return ( - -
+ HeaderProps & { className?: string }) { + const [height, setHeight] = useState(0); - {children} - + const { isOpen, onToggle } = useDisclosure(); + return ( + + +
+
{children}
+ + ); } export const FOOTER_HEIGHT = 40; export const PORTAL_WINDOW_HEIGHT = 600; -function Wrapper({ - variant = "compressed", - children, - ...rest -}: React.PropsWithChildren & { variant?: LayoutVariant }) { - const [height, setHeight] = useState(0); - const { isOpen, onToggle } = useDisclosure(); - +function ResponsiveWrapper({ children }: PropsWithChildren) { return ( - - {/** Show as full page */} - - + <> + {/* for desktop */} +
+
{children} - - +
+
- {/** Show as modal */} - - - - {children} - - - -
+ {/* device smaller than desktop width */} +
+ {children} +
+ ); } diff --git a/packages/keychain/src/components/layout/footer/index.tsx b/packages/keychain/src/components/layout/footer/index.tsx index 24a3dccd7..0d6a14e37 100644 --- a/packages/keychain/src/components/layout/footer/index.tsx +++ b/packages/keychain/src/components/layout/footer/index.tsx @@ -18,7 +18,9 @@ export function Footer({ const observer = new ResizeObserver((entries) => { for (const entry of entries) { - footer.setHeight(entry.contentRect.height); + if (entry.contentRect.height > 0) { + footer.setHeight(entry.contentRect.height); + } } });