diff --git a/src/components/floor-plan/modal/settoing01/FirstOption.jsx b/src/components/floor-plan/modal/settoing01/FirstOption.jsx index f191421b..e91f81ab 100644 --- a/src/components/floor-plan/modal/settoing01/FirstOption.jsx +++ b/src/components/floor-plan/modal/settoing01/FirstOption.jsx @@ -1,27 +1,21 @@ -import { useEffect, useState } from 'react' - -export default function FirstOption(props) { - const { options1, options2 } = props - const { option1Selected, setOption1Selected } = useState() - const { option2Selected, setOption2Selected } = useState() +import { useRecoilState } from 'recoil' +import { settingModalFirstOptionsState } from '@/store/settingAtom' +export default function FirstOption() { + const [settingsModalOptions, setSettingModalOptions] = useRecoilState(settingModalFirstOptionsState) + const { option1, option2 } = settingsModalOptions const onClickOption = (option) => { option.selected = !option.selected - console.log('options1', options1) - console.log('option2', options2) - } - useEffect(() => { - setOption1Selected(options1) - // setOption1Selected(props.options1) - }, [options1]) + setSettingModalOptions({ option1, option2 }) + } return ( <>

※図面に表示する項目をクリックすると適用されます。

- {options1.map((item) => ( + {settingsModalOptions?.option1?.map((item) => ( @@ -15,8 +24,8 @@ export default function SecondOption(props) {

吸着範囲の設定

- {options.option2.map((item) => ( - diff --git a/src/components/floor-plan/modal/settoing01/SettingModal01.jsx b/src/components/floor-plan/modal/settoing01/SettingModal01.jsx index e2c2cd89..5a79c795 100644 --- a/src/components/floor-plan/modal/settoing01/SettingModal01.jsx +++ b/src/components/floor-plan/modal/settoing01/SettingModal01.jsx @@ -3,15 +3,7 @@ import { useState } from 'react' import FirstOption from './FirstOption' import WithDraggable from '@/components/common/draggable/withDraggable' - -const HandleBtnClick = (e) => { - const button = e.target - if (!button.classList.contains('act')) { - button.classList.add('act') - } else { - button.classList.remove('act') - } -} +import SecondOption from '@/components/floor-plan/modal/settoing01/SecondOption' export default function SettingModal01({ modalOpen, setModalOpen }) { const [buttonAct, setButtonAct] = useState(1) @@ -24,42 +16,6 @@ export default function SettingModal01({ modalOpen, setModalOpen }) { }, 180) } - const firstOptions = { - option1: [ - { id: 1, name: '割り当て表示', selected: false }, - { id: 2, name: '実寸表示', selected: false }, - { id: 3, name: '図面表示', selected: false }, - { id: 4, name: '寸法表示なし', selected: false }, - { id: 5, name: 'グリッド表示', selected: false }, - { id: 6, name: '架台表示', selected: false }, - { id: 7, name: '文字表示', selected: false }, - { id: 8, name: '座標表示', selected: false }, - { id: 9, name: '流れ方向表示', selected: false }, - { id: 10, name: '図面切替表示', selected: false }, - { id: 11, name: 'ü廊下寸法表示', selected: false }, - ], - option2: [ - { id: 1, name: 'ボーダーのみ', selected: false }, - { id: 2, name: 'ラインハッチ', selected: false }, - { id: 3, name: 'All painted', selected: false }, - ], - } - - const secondOptions = { - option1: [ - { id: 1, name: '文字フォントの変更' }, - { id: 2, name: 'フロー方向フォントの変更' }, - { id: 3, name: '寸法フォントの変更' }, - { id: 4, name: '回路番号フォントの変更' }, - ], - option2: [ - { id: 1, name: '極小', selected: false }, - { id: 2, name: '牛', selected: false }, - { id: 3, name: '中', selected: false }, - { id: 4, name: 'ティーン', selected: false }, - ], - } - return (
@@ -79,8 +35,8 @@ export default function SettingModal01({ modalOpen, setModalOpen }) { フォントと図面サイズの設定
- {buttonAct === 1 && } - {/*{buttonAct === 2 && }*/} + {buttonAct === 1 && } + {buttonAct === 2 && }