Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: market filters going out of screen #8091

Merged
merged 2 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/components/OrderDropdown/OrderDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ type OrderDropdownProps = {
buttonProps?: ButtonProps
}

const colWidth = { base: '50%', md: 'max-content' }
const marginBottomProp = { base: 2, md: 0 }
const colWidth = { base: '50%', lg: 'max-content' }
const marginBottomProp = { base: 2, lg: 0 }

const chevronDownIcon = <ChevronDownIcon />

Expand Down
9 changes: 5 additions & 4 deletions src/components/SortDropdown/SortDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ type SortDropdownProps = {
options: SortOptionsKeys[]
}

const colWidth = { base: '50%', md: 'max-content' }
const marginYProp = { base: 2, md: 0 }
const marginBottomProp = { base: 4, md: 0 }
const colWidth = { base: '50%', lg: 'max-content' }
const marginYProp = { base: 2, lg: 0 }
const marginBottomProp = { base: 4, lg: 0 }
const justifyContentProp = { base: 'space-between', lg: 'flex-end' }

const chevronDownIcon = <ChevronDownIcon />

Expand Down Expand Up @@ -60,7 +61,7 @@ export const SortDropdown: React.FC<SortDropdownProps> = ({
mx={2}
my={marginYProp}
mb={marginBottomProp}
justifyContent='flex-end'
justifyContent={justifyContentProp}
>
<Text width={colWidth} me={4}>
{translate('common.sortBy')}
Expand Down
9 changes: 6 additions & 3 deletions src/pages/Markets/components/MarketsRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,13 @@ const chevronDownIcon = <ChevronDownIcon />

const flexAlign = { base: 'flex-start', md: 'flex-end' }
const flexDirection: FlexProps['flexDir'] = { base: 'column', md: 'row' }
const colWidth = { base: '50%', md: 'max-content' }

const colWidth = { base: 'auto', lg: 'max-content' }
const colMinWidth = { base: '50%', lg: 'auto' }
const chainButtonProps = {
width: colWidth,
my: { base: 2, md: 0 },
minWidth: colMinWidth,
my: { base: 2, lg: 0 },
}
const headerMx = { base: 0, xl: -2 }

Expand Down Expand Up @@ -163,7 +166,7 @@ export const MarketsRow: React.FC<MarketsRowProps> = ({
{showOrderFilter ? (
<OrderDropdown value={selectedOrder} onClick={setSelectedOrder} />
) : null}
<Flex alignItems='center' mx={2}>
<Flex alignItems='center' justifyContent='space-between' mx={2}>
<Text width={colWidth} me={4}>
{translate('common.filterBy')}
</Text>
Expand Down
Loading