diff --git a/hyperglass/ui/components/location-card.tsx b/hyperglass/ui/components/location-card.tsx index 4970130..6a56447 100644 --- a/hyperglass/ui/components/location-card.tsx +++ b/hyperglass/ui/components/location-card.tsx @@ -17,9 +17,8 @@ const LocationCardWrapper = motionChakra('div', { baseStyle: { py: 4, px: 6, - w: '100%', minW: 'xs', - maxW: 'sm', + maxW: 'md', mx: 'auto', shadow: 'sm', rounded: 'lg', diff --git a/hyperglass/ui/components/query-location.tsx b/hyperglass/ui/components/query-location.tsx index 8d8db04..793bdb6 100644 --- a/hyperglass/ui/components/query-location.tsx +++ b/hyperglass/ui/components/query-location.tsx @@ -1,5 +1,5 @@ import { useMemo } from 'react'; -import { Wrap, VStack, Flex, chakra } from '@chakra-ui/react'; +import { Wrap, Stack, Flex, chakra } from '@chakra-ui/react'; import { useFormContext } from 'react-hook-form'; import { Select, LocationCard } from '~/components'; import { useConfig } from '~/context'; @@ -114,13 +114,16 @@ export const QueryLocation = (props: QueryLocationProps): JSX.Element => { if (element === 'cards') { return ( - - {options.map(group => ( - - - {group.label} - - {group.options.map(opt => { + <> + {options.length === 1 ? ( + + {options[0].options.map(opt => { return ( { /> ); })} - - ))} - + + ) : ( + <> + {options.map(group => ( + + + {group.label} + + {group.options.map(opt => { + return ( + + ); + })} + + ))} + + )} + ); } else if (element === 'select') { return (