-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔧 chore: default Header를 서버, 클라이언트 양쪽 사용을 위한 버튼 분리 #6
- Loading branch information
1 parent
693f555
commit 5d00b02
Showing
2 changed files
with
33 additions
and
8 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
src/layout/Mobile/MobileHeader/DefaultHeader/ClientBackButton.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,28 @@ | ||
import Link from "next/link"; | ||
import { FC } from "react"; | ||
import { UrlObject } from "url"; | ||
|
||
import { ArrowLeftSmallIcon } from "@/components/icons"; | ||
|
||
interface Props { | ||
href?: UrlObject | string; | ||
onClick?: () => void; | ||
} | ||
|
||
const ClientBackButton: FC<Props> = ({ href, onClick }) => { | ||
if (href) { | ||
return ( | ||
<Link href={href} onClick={onClick}> | ||
<ArrowLeftSmallIcon width={24} height={24} /> | ||
</Link> | ||
); | ||
} else { | ||
return ( | ||
<button onClick={onClick}> | ||
<ArrowLeftSmallIcon width={24} height={24} /> | ||
</button> | ||
); | ||
} | ||
}; | ||
|
||
export default ClientBackButton; |
13 changes: 5 additions & 8 deletions
13
src/layout/Mobile/MobileHeader/DefaultHeader/DefaultHeader.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