diff --git a/components/Group/Form/Fields/AreaCheckbox.jsx b/components/Group/Form/Fields/AreaCheckbox.jsx index 17feb88c..13030b8e 100644 --- a/components/Group/Form/Fields/AreaCheckbox.jsx +++ b/components/Group/Form/Fields/AreaCheckbox.jsx @@ -57,12 +57,14 @@ export default function AreaCheckbox({ } label="實體活動" + disabled={value.includes('待討論')} checked={isPhysicalArea} /> control.setRef?.(name, element)} value={input} onCompositionStart={() => { isComposing.current = true; diff --git a/components/Group/Form/Fields/TextField.jsx b/components/Group/Form/Fields/TextField.jsx index edf16965..7409e59a 100644 --- a/components/Group/Form/Fields/TextField.jsx +++ b/components/Group/Form/Fields/TextField.jsx @@ -13,6 +13,7 @@ export default function TextField({ return ( <> control.setRef?.(name, element)} fullWidth id={id} name={name} @@ -21,7 +22,7 @@ export default function TextField({ placeholder={placeholder} value={value} multiline={multiline} - rows={multiline && 10} + rows={multiline && 6} helperText={helperText} {...control} /> diff --git a/components/Group/Form/Fields/index.jsx b/components/Group/Form/Fields/index.jsx index f8383205..629cb82d 100644 --- a/components/Group/Form/Fields/index.jsx +++ b/components/Group/Form/Fields/index.jsx @@ -5,6 +5,8 @@ import TagsField from './TagsField'; import TextField from './TextField'; import Upload from './Upload'; import Wrapper from './Wrapper'; +import CheckboxGroup from './CheckboxGroup'; +import DateRadio from './DateRadio'; const withWrapper = (Component) => (props) => { const id = useId(); @@ -25,6 +27,8 @@ const withWrapper = (Component) => (props) => { const Fields = { AreaCheckbox: withWrapper(AreaCheckbox), + CheckboxGroup: withWrapper(CheckboxGroup), + DateRadio: withWrapper(DateRadio), Select: withWrapper(Select), TagsField: withWrapper(TagsField), TextField: withWrapper(TextField), diff --git a/components/Group/Form/Form.styled.jsx b/components/Group/Form/Form.styled.jsx index 634d1de6..f527d2c4 100644 --- a/components/Group/Form/Form.styled.jsx +++ b/components/Group/Form/Form.styled.jsx @@ -43,7 +43,9 @@ export const StyledLabel = styled(InputLabel)` `; export const StyledGroup = styled.div` - margin-bottom: 20px; + & + & { + margin-top: 20px; + } .error-message { font-size: 14px; diff --git a/components/Group/Form/index.jsx b/components/Group/Form/index.jsx index ab635d72..e3e71c94 100644 --- a/components/Group/Form/index.jsx +++ b/components/Group/Form/index.jsx @@ -1,8 +1,13 @@ -import { useEffect } from 'react'; +import { useEffect, useState } from 'react'; +import Link from 'next/link'; +import styled from '@emotion/styled'; import Box from '@mui/material/Box'; import Switch from '@mui/material/Switch'; import CircularProgress from '@mui/material/CircularProgress'; import Button from '@/shared/components/Button'; +import Checkbox from '@mui/material/Checkbox'; +import FormControlLabel from '@mui/material/FormControlLabel'; +import { activityCategoryList } from '@/constants/activityCategory'; import StyledPaper from '../Paper.styled'; import { StyledHeading, @@ -18,6 +23,16 @@ import useGroupForm, { eduOptions, } from './useGroupForm'; +const StyledDesc = styled.p` + font-size: 14px; + color: #92989a; + + a { + color: #92989a; + text-decoration: underline; + } +`; + export default function GroupForm({ mode, defaultValues, @@ -33,6 +48,7 @@ export default function GroupForm({ setValues, handleSubmit, } = useGroupForm(); + const [isChecked, setIsChecked] = useState(false); const isCreateMode = mode === 'create'; useEffect(() => { @@ -43,6 +59,19 @@ export default function GroupForm({ }); }, [defaultValues]); + const desc = ( + + 請確認揪團未涉及不雅內容並符合本網站{' '} + + 使用者條款 + + + ); + + const checkbox = ( + setIsChecked((pre) => !pre)} /> + ); + if (notLogin) { return ; } @@ -72,6 +101,22 @@ export default function GroupForm({ value={values.photoURL} control={control} /> + { + if (action === 'add' && value === 'Other') { + return ['Other']; + } + if (action === 'remove' && !activityCategory.length) { + return ['Other']; + } + return activityCategory.filter((item) => item !== 'Other'); + }} + control={control} + value={values.activityCategory} + options={activityCategoryList} + /> + - + + + + @@ -142,6 +225,16 @@ export default function GroupForm({ helperText="標籤填寫完成後,會用 Hashtag 的形式呈現,例如: #一起學日文" /> + + + {!isCreateMode && ( @@ -158,10 +251,19 @@ export default function GroupForm({ )} + + + + +