Skip to content

Commit 05ab445

Browse files
committed
Votes page: adjust filter positions on layout
1 parent 606617b commit 05ab445

3 files changed

Lines changed: 15 additions & 2 deletions

File tree

.changelog/1994.trivial.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Votes page: adjust filter positions

src/app/components/Proposals/VoteTypeFilter.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { FilterButtons } from '../FilterButtons'
66
type VoteTypeFilterProps = {
77
onSelect: (voteType: VoteType) => void
88
value?: VoteType
9+
fullWidth?: boolean
910
}
1011

1112
export const VoteTypeFilter: FC<VoteTypeFilterProps> = props => {

src/app/pages/ProposalDetailsPage/ProposalVotesCard.tsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { ErrorBoundary } from '../../components/ErrorBoundary'
1616
import Box from '@mui/material/Box'
1717
import { NoMatchingDataMaybeClearFilters, TableSearchBar } from '../../components/Search/TableSearchBar'
1818
import { CardEmptyState } from '../../components/CardEmptyState'
19+
import { useScreenSize } from '../../hooks/useScreensize'
1920

2021
type ProposalVotesProps = {
2122
isLoading: boolean
@@ -115,21 +116,31 @@ export const ProposalVotesView: FC = () => {
115116

116117
export const ProposalVotesCard: FC = () => {
117118
const { t } = useTranslation()
119+
const { isMobile, isTablet } = useScreenSize()
118120

119121
const { wantedType, setWantedType, wantedNameInput, setWantedNameInput, nameError } = useVoteFiltering()
120122

121123
return (
122124
<SubPageCard>
123125
<CardHeaderWithResponsiveActions
124126
action={
125-
<Box sx={{ display: 'inline-flex', gap: 5 }}>
127+
<Box
128+
sx={{
129+
display: 'flex',
130+
justifyContent: 'space-between',
131+
flexWrap: isTablet ? 'wrap' : 'nowrap',
132+
gap: 4,
133+
paddingRight: isMobile ? 4 : 0,
134+
}}
135+
>
136+
<VoteTypeFilter onSelect={setWantedType} value={wantedType} />
126137
<TableSearchBar
127138
value={wantedNameInput}
128139
onChange={setWantedNameInput}
129140
placeholder={t('networkProposal.searchForVoter')}
130141
warning={nameError}
142+
fullWidth={isTablet}
131143
/>
132-
<VoteTypeFilter onSelect={setWantedType} value={wantedType} />
133144
</Box>
134145
}
135146
disableTypography

0 commit comments

Comments
 (0)