Skip to content

Commit

Permalink
[#13] Feat InformationPage - scheduler 컴포넌트 함수 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
ppacman committed Mar 29, 2023
1 parent 95a4c10 commit b624ecd
Showing 1 changed file with 4 additions and 23 deletions.
27 changes: 4 additions & 23 deletions src/components/infoPage/components/Scheduler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,36 +15,20 @@ import styled from "styled-components";
import character from "../../../assets/img/information/character.png";
import Image from "next/image";
import { useRecoilState } from "recoil";
import { personState,PersonState } from "../../../recoil/infoCard";
import { personState, PersonState } from "../../../recoil/infoCard";

setOptions({
locale: localeKo,
theme: "windows",
themeVariant: "light",
});


const Scheduler = () => {
const [state, setState] = useRecoilState<PersonState>(personState);

function toggleState(key: keyof PersonState) {
setState((prevState) => ({ ...prevState, [key]: !prevState[key] }));
}

function InfotoggleState(key: keyof PersonState) {
setState((prevState) => {
const newState = { ...prevState };
Object.keys(newState).forEach((k) => {
if (k !== key) {
newState[k as keyof PersonState] = false;
}
});
newState[key] = !prevState[key];
return newState;
});
}


function toggleState(key: keyof PersonState) {
setState((prevState) => ({ ...prevState, [key]: !prevState[key] }));
}

const [calView] = React.useState<MbscEventcalendarView>({
schedule: {
Expand Down Expand Up @@ -117,7 +101,6 @@ const Scheduler = () => {

return (
<Wrapper>
<Btn />
<Eventcalendar
renderHeader={customWithNavButtons}
view={calView}
Expand Down Expand Up @@ -195,8 +178,6 @@ const Scheduler = () => {

export default Scheduler;

const Btn = styled.button``;

const Wrapper = styled.div`
.md-header-filter-controls {
flex: 1 0 auto;
Expand Down

0 comments on commit b624ecd

Please sign in to comment.