Skip to content

Commit

Permalink
fix(fe): delete scrollbar (#2116)
Browse files Browse the repository at this point in the history
  • Loading branch information
jihorobert authored Sep 25, 2024
1 parent e1bfcac commit 81b6730
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions apps/frontend/app/(main)/settings/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,16 +159,20 @@ export default function Page() {
options?: NavigateOptions | undefined
): void => {
if (updateNow) {
!bypassConfirmation
? toast.error('You must update your information')
: originalPush(href as Route, options)
if (!bypassConfirmation) {
toast.error('You must update your information')
} else {
originalPush(href as Route, options)
}
return
}
if (!bypassConfirmation) {
const isConfirmed = window.confirm(
'Are you sure you want to leave?\nYour changes have not been saved.\nIf you leave this page, all changes will be lost.\nDo you still want to proceed?'
)
isConfirmed ? originalPush(href as Route, options) : null
if (isConfirmed) {
originalPush(href as Route, options)
}
return
}
originalPush(href as Route, options)
Expand Down Expand Up @@ -252,7 +256,11 @@ export default function Page() {
toast.success('Successfully updated your information')
setBypassConfirmation(true)
setTimeout(() => {
updateNow ? router.push('/') : window.location.reload()
if (updateNow) {
router.push('/')
} else {
window.location.reload()
}
}, 1500)
}
} catch (error) {
Expand Down Expand Up @@ -324,7 +332,7 @@ export default function Page() {

<form
onSubmit={handleSubmit(onSubmit)}
className="flex h-svh max-h-[846px] w-full flex-col justify-between gap-4 px-4"
className="flex h-svh max-h-[846px] w-full flex-col justify-between gap-4 overflow-y-auto px-4"
>
<h1 className="-mb-1 text-center text-2xl font-bold">Settings</h1>
<p className="text-center text-sm text-neutral-500">
Expand Down Expand Up @@ -551,10 +559,10 @@ export default function Page() {
<PopoverContent className="w-[555px] p-0">
<Command>
<CommandInput placeholder="Search major..." />
<ScrollArea className="h-40">
<ScrollArea>
<CommandEmpty>No major found.</CommandEmpty>
<CommandGroup>
<CommandList>
<CommandList className="h-40">
{majors?.map((major) => (
<CommandItem
key={major}
Expand Down

0 comments on commit 81b6730

Please sign in to comment.