From 5267edccb8baa7fc6a92b2cafc73fac2dba159e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9B=90=EB=8D=94?= Date: Sun, 10 Jan 2021 12:39:46 +0900 Subject: [PATCH] fix: https://github.com/koreanbots/v2-testing/issues/6 --- components/LongButton.tsx | 21 +++++++++++++++------ components/Tag.tsx | 24 +++++++++++++++++++++++- pages/bots/[id].tsx | 1 + pages/users/[id].tsx | 1 + 4 files changed, 40 insertions(+), 7 deletions(-) diff --git a/components/LongButton.tsx b/components/LongButton.tsx index 67029bb..4b54043 100644 --- a/components/LongButton.tsx +++ b/components/LongButton.tsx @@ -1,12 +1,20 @@ /* eslint-disable jsx-a11y/no-static-element-interactions */ import Link from 'next/link' -const LongButton = ({ children, href, onClick, center=false }:LongButtonProps):JSX.Element => { - if(href) return -
- {children} -
- +const LongButton = ({ children, newTab=false, href, onClick, center=false }:LongButtonProps):JSX.Element => { + if(href) { + if(newTab) return +
+ {children} +
+
+ else return +
+ {children} +
+ + } if(onClick) return
{children}
@@ -22,6 +30,7 @@ const LongButton = ({ children, href, onClick, center=false }:LongButtonProps):J export default LongButton interface LongButtonProps { + newTab?: boolean onClick?: (event: React.KeyboardEvent|React.MouseEvent) => void children: JSX.Element | JSX.Element[] href?: string diff --git a/components/Tag.tsx b/components/Tag.tsx index ae722e6..c921627 100644 --- a/components/Tag.tsx +++ b/components/Tag.tsx @@ -9,8 +9,29 @@ const Tag = ({ circular = false, dark = false, marginBottom = 2, + newTab = false }: LabelProps): JSX.Element => { - return href ? ( + return href ? newTab ? ( + + {text} + + + ) : ( = ({ data, date }) => {
= ({ data }) => {
{data.github && ( {data.github}