Skip to content

Commit

Permalink
Responsive fixes
Browse files Browse the repository at this point in the history
- Properly show user account info and menu hamburger for mobile devices
- Properly shrink contents in processes list. This ensures no additional
  horizontal scrollbar is shown
  • Loading branch information
elboletaire committed Nov 12, 2024
1 parent 9dcd8ad commit f815c4f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/components/Organization/Dashboard/ProcessCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const ProcessCard = () => {
fontWeight='500'
isTruncated
/>
<Box flexGrow={1} flexShrink={0} flexBasis={60} whiteSpace='nowrap' fontWeight='500'>
<Box flexGrow={1} flexShrink={0} flexBasis={60} fontWeight='500'>
<Text as='span'>{format(election.startDate, t('organization.date_format'))}</Text> -{' '}
<Text as='span'>{format(election.endDate, t('organization.date_format'))}</Text>
</Box>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Organization/Dashboard/ProcessesList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const ProcessesList = ({ loading, processes, error, limit }: ProcessesListProps)
const { t } = useTranslation()

return (
<VStack w='full' overflowX='scroll' borderRadius='lg' py={{ base: 2.5, lg: 5 }} px={{ base: 5, lg: 10 }}>
<VStack w='full' overflowX='auto' borderRadius='lg' py={{ base: 2.5, lg: 5 }} px={{ base: 5, lg: 10 }}>
{loading && <Progress isIndeterminate w='full' colorScheme='primary' size='xs' />}
{error && (
<Alert>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Organization/Dashboard/Votings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const VotingsList = () => {
const { elections, pagination } = data

return (
<Flex flexDirection='column' flexGrow={1} gap={5}>
<Flex flexDirection='column' flexGrow={1} gap={5} height='full'>
<ProcessesList processes={elections} error={error} loading={isLoading} />
<Flex mt='auto' justifyContent='end'>
{!!elections?.length && <RoutedPagination pagination={pagination} />}
Expand Down
16 changes: 6 additions & 10 deletions src/elements/LayoutDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,12 @@ const LayoutDashboard: React.FC = () => {
{title}
</Heading>
)}
{/* User profile & menu */}
<AccountMenu ml='auto' />
{/* Hamburger button to open sidebar on small screens */}
<IconButton
icon={<HamburgerIcon />}
onClick={onOpen}
display={{ lg: 'none' }}
aria-label='Open menu'
ml='auto'
/>
<Box ml='auto' display='flex' gap={3} alignItems='center'>
{/* User profile & menu */}
<AccountMenu />
{/* Hamburger button to open sidebar on small screens */}
<IconButton icon={<HamburgerIcon />} onClick={onOpen} display={{ lg: 'none' }} aria-label='Open menu' />
</Box>
</Box>

{/* Sidebar for large screens */}
Expand Down

2 comments on commit f815c4f

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.