Refactor modals to use ResponsiveModal for improved responsiveness and consistency

This commit is contained in:
Mo Tarbin
2025-08-21 01:39:03 -04:00
parent 0102ce2144
commit 4dcd4483e9
18 changed files with 529 additions and 74 deletions

View File

@@ -1,6 +1,6 @@
import { Box, Button, Option, Select, Typography } from '@mui/joy'
import React from 'react'
import FadeModal from '../../../components/common/FadeModal'
import { useResponsiveModal } from '../../../hooks/useResponsiveModal'
function SelectModal({
isOpen,
@@ -11,6 +11,8 @@ function SelectModal({
displayKey,
placeholder,
}) {
const { ResponsiveModal } = useResponsiveModal()
const [selected, setSelected] = React.useState(null)
const handleSave = () => {
onSave(options.find(item => item.id === selected))
@@ -18,7 +20,7 @@ function SelectModal({
}
return (
<FadeModal open={isOpen} onClose={onClose}>
<ResponsiveModal open={isOpen} onClose={onClose}>
<Typography variant='h4'>{title}</Typography>
<Select placeholder={placeholder}>
{options.map((item, index) => (
@@ -42,7 +44,7 @@ function SelectModal({
Cancel
</Button>
</Box>
</FadeModal>
</ResponsiveModal>
)
}
export default SelectModal