-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'fe-dev' into feature/#623
- Loading branch information
Showing
47 changed files
with
309 additions
and
299 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
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
32 changes: 32 additions & 0 deletions
32
client/src/components/Design/components/NumberKeyboard/useNumberKeyboardBottomSheet.ts
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,32 @@ | ||
import {useEffect, useRef} from 'react'; | ||
|
||
interface Props { | ||
isOpened: boolean; | ||
} | ||
|
||
const useNumberKeyboardBottomSheet = ({isOpened}: Props) => { | ||
const bottomSheetRef = useRef<HTMLDivElement>(null); | ||
|
||
useEffect(() => { | ||
const bottomSheet = bottomSheetRef.current; | ||
if (!bottomSheet) return; | ||
|
||
const preventScroll = (e: TouchEvent) => { | ||
if (bottomSheet.contains(e.target as Node)) { | ||
e.preventDefault(); | ||
} | ||
}; | ||
|
||
if (isOpened) { | ||
document.addEventListener('touchmove', preventScroll, {passive: false}); | ||
} | ||
|
||
return () => { | ||
document.removeEventListener('touchmove', preventScroll); | ||
}; | ||
}, [isOpened]); | ||
|
||
return {bottomSheetRef}; | ||
}; | ||
|
||
export default useNumberKeyboardBottomSheet; |
35 changes: 0 additions & 35 deletions
35
client/src/components/Design/components/Switch/Switch.stories.tsx
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
client/src/components/Design/components/Switch/Switch.style.ts
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
client/src/components/Design/components/Switch/Switch.type.ts
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
2 changes: 1 addition & 1 deletion
2
client/src/components/Design/components/TextButton/TextButton.type.ts
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.
9 changes: 9 additions & 0 deletions
9
client/src/components/Design/components/TopNav/NavItem.style.ts
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,9 @@ | ||
import {css} from '@emotion/react'; | ||
|
||
export const navItemStyle = css({ | ||
padding: '0 0.5rem', | ||
|
||
':first-of-type': { | ||
paddingLeft: 0, | ||
}, | ||
}); |
55 changes: 55 additions & 0 deletions
55
client/src/components/Design/components/TopNav/NavItem.tsx
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,55 @@ | ||
/** @jsxImportSource @emotion/react */ | ||
import type {NavItemProps} from './NavItem.type'; | ||
|
||
import {useLocation, useNavigate} from 'react-router-dom'; | ||
|
||
import getDeletedLastPath from '@utils/getDeletedLastPath'; | ||
|
||
import TextButton from '../TextButton/TextButton'; | ||
|
||
import {navItemStyle} from './NavItem.style'; | ||
|
||
const NavItem = ({displayName, routePath, onHandleRouteInFunnel, noEmphasis = false, children}: NavItemProps) => { | ||
const navigate = useNavigate(); | ||
const location = useLocation(); | ||
const matchPath = location.pathname.includes(routePath); | ||
|
||
const handleNavigation = () => { | ||
if (onHandleRouteInFunnel) { | ||
onHandleRouteInFunnel(); | ||
return; | ||
} | ||
|
||
switch (routePath) { | ||
case '/': | ||
navigate('/'); | ||
break; | ||
case '-1': | ||
navigate(-1); | ||
break; | ||
default: | ||
navigate(`${getDeletedLastPath(location.pathname)}${routePath}`); | ||
break; | ||
} | ||
}; | ||
|
||
const getTextColor = () => { | ||
if (noEmphasis) return 'gray'; | ||
|
||
return matchPath ? 'onTertiary' : 'gray'; | ||
}; | ||
|
||
return ( | ||
<li css={navItemStyle} onClick={handleNavigation}> | ||
{children ? ( | ||
children | ||
) : ( | ||
<TextButton textColor={getTextColor()} textSize="bodyBold"> | ||
{displayName} | ||
</TextButton> | ||
)} | ||
</li> | ||
); | ||
}; | ||
|
||
export default NavItem; |
14 changes: 14 additions & 0 deletions
14
client/src/components/Design/components/TopNav/NavItem.type.ts
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,14 @@ | ||
export type NavItemOptionProps = { | ||
displayName?: string; | ||
onHandleRouteInFunnel?: () => void; | ||
}; | ||
|
||
export type NavItemRequireProps = { | ||
routePath: string; | ||
}; | ||
|
||
export type NavItemStyleProps = { | ||
noEmphasis?: boolean; | ||
}; | ||
|
||
export type NavItemProps = NavItemRequireProps & NavItemOptionProps & NavItemStyleProps & React.PropsWithChildren; |
50 changes: 0 additions & 50 deletions
50
client/src/components/Design/components/TopNav/TopNav.stories.tsx
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
Oops, something went wrong.