Skip to content

Conversation

@KimSH39
Copy link
Contributor

@KimSH39 KimSH39 commented Oct 11, 2022

주요 변경 사항

  • 업로드 페이지에 있는 저작권자, 가수 검색 기능 추가
  • 분배 위한 정산 비율을 배열로 return

코드 설명


중요도

  • 낮음
  • 보통
  • 높음

기타 특이사항

  • 정산 비율 합해서 1 넘으면 에러 띄우는 부분 추가해야 함
  • 백앤드 axios 연결 필요

Copy link
Member

@MinsuKim21 MinsuKim21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

지현이누나 코드랑 같은거야?

Copy link
Member

@MinsuKim21 MinsuKim21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

컴포넌트 분리해줘

Comment on lines +474 to 569
const [state, setState] = React.useState({
bottom: false,
});

const anchor = 'bottom';

const toggleDrawer = (anchor, open) => (event) => {
handleOnClick();

if (event.type === 'keydown' && (event.key === 'Tab' || event.key === 'Shift')) {
return;
}
setState({ ...state, [anchor]: open });
};

// const Navigate = useNavigate();
const [holder, setholder] = useState([]);
const holderlist = (item) => {
setholder((holder) => {
console.log(holder);
return [...holder, item];
});
};
const list = (anchor) => (
<Box
style={{ fontColor: 'red' }}
sx={{ width: anchor === 'top' || anchor === 'bottom' ? 'auto' : 250 }}
role="presentation"
onClick={toggleDrawer(anchor, false)}
onKeyDown={toggleDrawer(anchor, false)}
>
<List>
{data.map((item) => (
<ListItem style={{ color: 'Black' }} key={item.id}>
<ListItemButton onClick={() => holderlist(item.id)}>
<ListItemText primary={item.nickname} />
</ListItemButton>
</ListItem>
))}
</List>
<Divider />
</Box>
);

const [data, setData] = useState([]);

const token = localStorage.getItem('jwtToken');

const [search, setSearch] = useState('');

const [copyright, setcopyright] = useState([]);

const copyrightlist = (e) => {
setcopyright((copyright) => {
return [...copyright, e.target.value];
});
};

const handleOnKeyPress = (e) => {
if (e.key == ' ') {
copyrightlist(e);
}
};

const onChangeSearch = (e) => {
setSearch(e.target.value);
toggleDrawer(anchor, true);
};

const handleOnClick = async () => {
// console.log(token);

await axios
.get(`http://${process.env.REACT_APP_BACKEND_URL}/api/v1/user?search=${search}`, {
headers: {
authorization: token,
},
params: {
holder,
},
})
.then((res) => {
setData(res.data.data);
console.log(data);
console.log(search);
console.log(holder);
console.log(copyright);
})
.catch((err) => {
console.log(err);
});
};

return (
<DetailDiv>
{props.countComposerList &&
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

컴포넌트 분리 할것

Comment on lines +611 to +662
const [state, setState] = React.useState({
bottom: false,
});

const anchor = 'bottom';

const toggleDrawer = (anchor, open) => (event) => {
handleOnClick();
if (event.type === 'keydown' && (event.key === 'Tab' || event.key === 'Shift')) {
return;
}
setState({ ...state, [anchor]: open });
};
const [holder2, setholder2] = useState([]);
const holderlist2 = (item) => {
setholder2((holder2) => {
console.log(holder2);
return [...holder2, item];
});
};

const list = (anchor) => (
<Box
sx={{ width: anchor === 'top' || anchor === 'bottom' ? 'auto' : 250 }}
role="presentation"
onClick={toggleDrawer(anchor, false)}
onKeyDown={toggleDrawer(anchor, false)}
>
<List>
{data.map((item) => (
<ListItem style={{ color: 'Black' }} key={item.id}>
<ListItemButton onClick={() => holderlist2(item.id)}>
<ListItemText primary={item.nickname}></ListItemText>
</ListItemButton>
</ListItem>
))}
</List>
<Divider />
</Box>
);

const [data, setData] = useState([]);

const token = localStorage.getItem('jwtToken');

const [search, setSearch] = useState('');
const [copyright2, setcopyright2] = useState([]);

const copyrightlist2 = (e) => {
setcopyright2((copyright2) => {
return [...copyright2, e.target.value];
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

드레그 빡세네 이것도 컴포넌트 분리

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants