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: show settings panel on mobile #2018

Merged
merged 4 commits into from
Oct 24, 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
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export const SettingsDialog = () => {
isOpen={settingsOpen}
heading="Settings"
onClose={closeSettings}
dialogWrapperClassName="z-[1001]"
panelClassNameOverrides="lg:!w-[644px] !min-w-[350px]" // custom width
>
<div className="flex w-full flex-col items-center gap-6 text-white">
Expand Down
11 changes: 8 additions & 3 deletions packages/arb-token-bridge-ui/src/components/common/SidePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ type SidePanelProps = {
children: React.ReactNode
panelClassNameOverrides?: string
scrollable?: boolean
dialogWrapperClassName?: string
}

export const SidePanel = ({
Expand All @@ -19,7 +20,8 @@ export const SidePanel = ({
onClose,
children,
panelClassNameOverrides = '',
scrollable = true
scrollable = true,
dialogWrapperClassName
}: SidePanelProps) => {
const [open, setOpen] = useState(false)
const [isClosing, setIsClosing] = useState(false)
Expand All @@ -41,15 +43,18 @@ export const SidePanel = ({
// prevent flickering caused by race conditions
setTimeout(() => {
setIsClosing(false)
}, 0)
}, 10)
}, [onClose, setIsClosing])

return (
<Transition show={open && !isClosing} as={Fragment}>
<Dialog
open={open}
onClose={handleCloseStart}
className="fixed z-40 h-screen max-h-screen"
className={twMerge(
'fixed z-40 h-screen max-h-screen',
dialogWrapperClassName
)}
>
<Transition.Child
as={Fragment}
Expand Down