-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #366 from sj0724/part2-박상준-week11
[박상준] Week11
- Loading branch information
Showing
42 changed files
with
1,076 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"folders": [ | ||
{ | ||
"path": ".." | ||
} | ||
], | ||
"settings": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,24 @@ | ||
import styled from "styled-components"; | ||
import styled from 'styled-components'; | ||
|
||
const Container = styled.div` | ||
gap: 20px; | ||
display: grid; | ||
grid-template-columns: repeat(3, 1fr); | ||
grid-template-columns: ${(props) => | ||
props.empty > 0 ? 'repeat(3, 1fr)' : 'none'}; | ||
margin: 0 auto; | ||
position: relative; | ||
@media (max-width: 1199px) { | ||
grid-template-columns: 1fr 1fr; | ||
grid-template-columns: ${(props) => (props.empty > 0 ? '1fr 1fr' : '1fr')}; | ||
} | ||
@media (max-width: 767px) { | ||
grid-template-columns: 1fr; | ||
} | ||
`; | ||
|
||
function ContentsContainer({ children }) { | ||
return <Container>{children}</Container>; | ||
function ContentsContainer({ children, content }) { | ||
return <Container empty={content}>{children}</Container>; | ||
} | ||
|
||
export default ContentsContainer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
src/components/FolderButtonContainer/FolderButtonContainer.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import { useState } from 'react'; | ||
import * as S from './FolderButtonContainer.styled'; | ||
import FolderButton from '../FolderButton/FolderButton'; | ||
|
||
function FolderButtonContainer({ | ||
link, | ||
setFolderName, | ||
setFolderId, | ||
toggleModal, | ||
}) { | ||
const [linkSelected, setLinkSelected] = useState(false); | ||
const [totalBtn, setTotalBtn] = useState(true); | ||
|
||
const handleMenuClick = (index) => { | ||
const booleanArr = [...link].fill(false); | ||
booleanArr[index] = true; | ||
setLinkSelected(booleanArr); | ||
setTotalBtn(false); | ||
}; | ||
|
||
const setTotal = () => { | ||
const totalArr = [...link].fill(false); | ||
setLinkSelected(totalArr); | ||
setFolderId(''); | ||
setFolderName(''); | ||
setTotalBtn(true); | ||
}; | ||
|
||
return ( | ||
<S.FolderMenu> | ||
<S.FolderButtons> | ||
<S.TotalFolderButton onClick={setTotal} $select={totalBtn}> | ||
전체 | ||
</S.TotalFolderButton> | ||
{link | ||
? link.map((item, index) => ( | ||
<FolderButton | ||
item={item} | ||
key={item.name} | ||
setFolderId={setFolderId} | ||
setFolderName={setFolderName} | ||
isSelected={linkSelected[index]} | ||
handleMenuClick={handleMenuClick} | ||
index={index} | ||
/> | ||
)) | ||
: null} | ||
</S.FolderButtons> | ||
<S.AddFolderButton onClick={() => toggleModal('addFolder')}> | ||
폴더 추가 | ||
<S.PlusIcon /> | ||
</S.AddFolderButton> | ||
</S.FolderMenu> | ||
); | ||
} | ||
|
||
export default FolderButtonContainer; |
Oops, something went wrong.