-
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.
- Loading branch information
Showing
20 changed files
with
261 additions
and
84 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import styled from '@emotion/styled'; | ||
import theme from '../../styles/theme'; | ||
|
||
export const Wrapper = styled.div` | ||
width: 100%; | ||
max-width: 412px; | ||
height: 90px; | ||
position: fixed; | ||
z-index: 3; | ||
bottom: 0; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: space-between; | ||
`; | ||
|
||
export const BottomWrapper = styled.div` | ||
width: 100%; | ||
border-top: 1px solid ${theme.colors.gray02}; | ||
background: ${theme.colors.gray01}; | ||
display: flex; | ||
justify-content: space-between; | ||
padding: 10px 20px 28px 20px; | ||
`; | ||
|
||
export const ResetButtonWrapper = styled.div` | ||
width: 52px; | ||
height: 52px; | ||
border-radius: 50%; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
background: ${theme.colors.gray01}; | ||
filter: drop-shadow(0px 0px 7px rgba(0, 0, 0, 0.1)); | ||
cursor: pointer; | ||
`; | ||
|
||
export const ResetButton = styled.img` | ||
width: 20px; | ||
height: 20px; | ||
`; | ||
|
||
export const ResetText = styled.span` | ||
color: ${theme.colors.gray05}; | ||
${theme.typography.medium06}; | ||
`; | ||
|
||
export const BottomButton = styled.button` | ||
width: 273px; | ||
height: 52px; | ||
border-radius: 6px; | ||
${theme.typography.semibold03}; | ||
color: ${theme.colors.gray01}; | ||
background: ${theme.colors.purple06}; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
`; |
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,52 @@ | ||
import reset from '../../assets/icons/reset.svg'; | ||
|
||
import { | ||
BottomButton, | ||
BottomWrapper, | ||
ResetButton, | ||
ResetButtonWrapper, | ||
ResetText, | ||
Wrapper, | ||
} from './AddButton.styles'; | ||
|
||
interface TableSelectedTypes { | ||
[key: number]: string[]; | ||
} | ||
|
||
interface AddButtonTypes { | ||
handleApplyClick: () => void; | ||
setTableSelected: React.Dispatch<React.SetStateAction<TableSelectedTypes>>; | ||
setIsResetButtonClick: React.Dispatch<React.SetStateAction<boolean>>; | ||
} | ||
|
||
const AddButton = ({ | ||
setTableSelected, | ||
handleApplyClick, | ||
setIsResetButtonClick, | ||
}: AddButtonTypes) => { | ||
const handleResetClick = () => { | ||
setTableSelected({}); | ||
|
||
const selected = document.querySelectorAll('.selected'); | ||
|
||
selected.forEach((element) => { | ||
element.classList.remove('selected'); | ||
}); | ||
|
||
setIsResetButtonClick(true); | ||
}; | ||
|
||
return ( | ||
<Wrapper> | ||
<BottomWrapper> | ||
<ResetButtonWrapper onClick={handleResetClick}> | ||
<ResetButton src={reset} alt="reset" /> | ||
<ResetText>초기화</ResetText> | ||
</ResetButtonWrapper> | ||
<BottomButton onClick={handleApplyClick}>등록하기</BottomButton> | ||
</BottomWrapper> | ||
</Wrapper> | ||
); | ||
}; | ||
|
||
export default AddButton; |
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 was deleted.
Oops, something went wrong.
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,21 @@ | ||
import React, { useEffect } from 'react'; | ||
|
||
const useInputScroll = (ref: React.RefObject<HTMLInputElement>) => { | ||
useEffect(() => { | ||
window.addEventListener('touchmove', handleScroll); | ||
return () => { | ||
window.removeEventListener('touchmove', handleScroll); | ||
}; | ||
}, []); | ||
|
||
const handleScroll = (e: TouchEvent) => { | ||
if ( | ||
document.activeElement == ref.current || | ||
ref.current?.contains(e.target as Node) | ||
) { | ||
(document.activeElement as HTMLElement).blur(); | ||
} | ||
}; | ||
}; | ||
|
||
export default useInputScroll; |
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.