-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feature/archiving/#311-manage-teamId
- Loading branch information
Showing
69 changed files
with
1,046 additions
and
897 deletions.
There are no files selected for viewing
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
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,7 +1,11 @@ | ||
import { css } from '@emotion/react'; | ||
|
||
export const containerStyle = css({ | ||
display: 'flex', | ||
flexDirection: 'column', | ||
position: 'relative', | ||
}); | ||
export const containerStyle = (width: string) => | ||
css({ | ||
display: 'flex', | ||
flexDirection: 'column', | ||
gap: '1.2rem', | ||
position: 'relative', | ||
|
||
width, | ||
}); |
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
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
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,43 @@ | ||
import { useState } from 'react'; | ||
|
||
type DataHasIdKey<T> = { | ||
[key in keyof T]: T[key]; | ||
}; | ||
|
||
/** | ||
* identifier: "fileId"와 같이 해당 아이템을 구분할 수 있는 식별자 | ||
* select할 시 특정 아이템의 identifier 값을 ids에 넣음 | ||
*/ | ||
export const useMultiSelect = <T extends object>(identifier: keyof T, data: DataHasIdKey<T>[]) => { | ||
const [ids, setIds] = useState<number[]>([]); | ||
|
||
const handleItemClick = (id: number) => { | ||
if (ids.includes(id)) { | ||
setIds((prev) => { | ||
const origin = [...prev]; | ||
|
||
return origin.filter((i) => i !== id); | ||
}); | ||
} else { | ||
setIds((prev) => [...prev, id]); | ||
} | ||
}; | ||
|
||
const handleAllClick = () => { | ||
if (ids.length !== data.length) { | ||
const totalIds: number[] = []; | ||
|
||
data.forEach((item) => totalIds.push(item[identifier] as number)); | ||
|
||
setIds(totalIds); | ||
} else { | ||
setIds([]); | ||
} | ||
}; | ||
|
||
const handleReset = () => { | ||
setIds([]); | ||
}; | ||
|
||
return { ids, handleItemClick, handleAllClick, handleReset }; | ||
}; |
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
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
Oops, something went wrong.