fix: Course payment modal is overflowing in mobile

This commit is contained in:
swve 2025-01-24 22:06:14 +01:00
parent d8f77aec4c
commit 9f457561d8
2 changed files with 13 additions and 11 deletions

View file

@ -23,21 +23,21 @@ type ModalParams = {
const Modal = (params: ModalParams) => { const Modal = (params: ModalParams) => {
const getMinHeight = () => { const getMinHeight = () => {
switch (params.minHeight) { switch (params.minHeight) {
case 'sm': return 'min-h-[300px]' case 'sm': return 'min-h-[300px] max-h-[90vh]'
case 'md': return 'min-h-[500px]' case 'md': return 'min-h-[400px] max-h-[90vh]'
case 'lg': return 'min-h-[700px]' case 'lg': return 'min-h-[500px] max-h-[90vh]'
case 'xl': return 'min-h-[900px]' case 'xl': return 'min-h-[600px] max-h-[90vh]'
default: return '' default: return 'max-h-[90vh]'
} }
} }
const getMinWidth = () => { const getMinWidth = () => {
switch (params.minWidth) { switch (params.minWidth) {
case 'sm': return 'min-w-[600px]' case 'sm': return 'w-[95vw] sm:w-[90vw] md:w-[600px]'
case 'md': return 'min-w-[800px]' case 'md': return 'w-[95vw] sm:w-[90vw] md:w-[800px]'
case 'lg': return 'min-w-[1000px]' case 'lg': return 'w-[95vw] sm:w-[90vw] lg:w-[1000px]'
case 'xl': return 'min-w-[1200px]' case 'xl': return 'w-[95vw] sm:w-[90vw] xl:w-[1200px]'
default: return '' default: return 'w-[95vw] sm:w-[90vw]'
} }
} }
@ -47,7 +47,8 @@ const Modal = (params: ModalParams) => {
<DialogTrigger asChild>{params.dialogTrigger}</DialogTrigger> <DialogTrigger asChild>{params.dialogTrigger}</DialogTrigger>
)} )}
<DialogContent className={cn( <DialogContent className={cn(
"overflow-auto", "overflow-auto mx-auto",
"p-4 md:p-6",
getMinHeight(), getMinHeight(),
getMinWidth(), getMinWidth(),
params.customHeight, params.customHeight,

View file

@ -65,6 +65,7 @@ function ActivityIndicators(props: Props) {
key={activity.activity_uuid} key={activity.activity_uuid}
> >
<Link <Link
prefetch={true}
href={ href={
getUriWithOrg(orgslug, '') + getUriWithOrg(orgslug, '') +
`/course/${courseid}/activity/${activity.activity_uuid.replace( `/course/${courseid}/activity/${activity.activity_uuid.replace(