From 38902f92fe6d2e5abe48854016438efa367da8de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9B=90=EB=8D=94?= Date: Fri, 8 Jan 2021 12:14:17 +0900 Subject: [PATCH] feat: Long Button --- components/LongButton.tsx | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 components/LongButton.tsx diff --git a/components/LongButton.tsx b/components/LongButton.tsx new file mode 100644 index 0000000..216f0af --- /dev/null +++ b/components/LongButton.tsx @@ -0,0 +1,28 @@ +/* eslint-disable jsx-a11y/no-static-element-interactions */ +import Link from 'next/link' + +const LongButton = ({ children, href, onClick }:LongButtonProps):JSX.Element => { + if(href) return +
+ {children} +
+ + if(onClick) return
+ {children} +
+ + return
+ {children} +
+ + + +} + +export default LongButton + +interface LongButtonProps { + onClick?: (event: React.KeyboardEvent|React.MouseEvent) => void + children: JSX.Element | JSX.Element[] + href?: string +} \ No newline at end of file