Skip to content

Commit

Permalink
[feat] boostcampwm-2022#85 배경음악 정보 전역 저장
Browse files Browse the repository at this point in the history
- 배경 음악 토클 시, 전역 정보 변경
  • Loading branch information
ktmihs committed Nov 28, 2022
1 parent 055bce7 commit fcb690e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 4 additions & 3 deletions frontend/src/component/Sidebar/Setting/backgroundSetting.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { useState } from 'react';
import { useRecoilState } from 'recoil';
import Content from '../Content';
import { backgroundSettingWrapper } from './setting.styled';
import Toggle from './toggle';
import { musicState, snowState } from '../../../store/atom/backgroundSetting';

const BackgroundSetting = () => {
const [isMusicOn, setMusic] = useState<boolean>(false);
const [isSnowing, setSnowing] = useState<boolean>(false);
const [isMusicOn, setMusic] = useRecoilState(musicState);
const [isSnowing, setSnowing] = useRecoilState(snowState);

const handleMusicStatus = () => {
setMusic(!isMusicOn);
Expand Down
5 changes: 4 additions & 1 deletion frontend/src/component/Sidebar/Setting/deviceSetting.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import { useEffect, useState } from 'react';
import { useRecoilValue } from 'recoil';
import { devicePermissionState } from '../../../store/atom/deviceSetting';
import Device from './device';
import { deviceListType } from './setting';
import { deviceWrapper } from './setting.styled';

const DeviceSetting = (permission: { permission: boolean }) => {
const DeviceSetting = () => {
const permission = useRecoilValue(devicePermissionState);
const [deviceList, setDeviceList] = useState<deviceListType>();

useEffect(() => {
Expand Down

0 comments on commit fcb690e

Please sign in to comment.