Skip to content

Commit

Permalink
feat/takumi0616/236-releaseボタンの修正
Browse files Browse the repository at this point in the history
  • Loading branch information
takumi0616 committed May 8, 2024
1 parent 2ccd943 commit 4305251
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,6 @@ const RecordAddModal: FC<ModalProps> = (props) => {
const [placeholder, setPlaceholder] = useState('Record Name');
const [isActive, setIsActive] = useState(false);

const toggleSwitch = () => {
setIsActive(!isActive);
};

const handleFocus = () => {
setIsFocused(true);
setPlaceholder('');
Expand Down Expand Up @@ -141,6 +137,11 @@ const RecordAddModal: FC<ModalProps> = (props) => {
getUsers(getUsersUrl);
}, []);

const toggleSwitch = () => {
setRelease(!release);
setIsActive(!isActive);
};

const handleRecord =
(input: string) =>
(
Expand Down Expand Up @@ -223,7 +224,7 @@ const RecordAddModal: FC<ModalProps> = (props) => {
<div className={s.modalButtons}>
<div className={s.releaseToggle}>
<div className={`${s.toggle} ${isActive ? s.checked : ''}`} onClick={toggleSwitch}>
<input type='checkbox' name='check' checked={isActive} onChange={() => {}} />
<input type='checkbox' name='check' checked={release} onChange={() => {}} />
</div>
</div>
<div className={s.modalSubmitButton}>
Expand Down

0 comments on commit 4305251

Please sign in to comment.