From 42f5c0a7f7920cd2b57c03b1678617447143af74 Mon Sep 17 00:00:00 2001 From: Junseo Park Date: Thu, 25 Feb 2021 20:30:22 +0900 Subject: [PATCH] feat: added copy button for pending bot --- pages/pendingBots/[id]/[date].tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pages/pendingBots/[id]/[date].tsx b/pages/pendingBots/[id]/[date].tsx index f171634..6d705ab 100644 --- a/pages/pendingBots/[id]/[date].tsx +++ b/pages/pendingBots/[id]/[date].tsx @@ -7,11 +7,11 @@ import { git } from '@utils/Constants' import { SubmittedBot, User } from '@types' +import useCopyClipboard from 'react-use-clipboard' import { ParsedUrlQuery } from 'querystring' import NotFound from 'pages/404' import Day from '@utils/Day' - const Container = dynamic(() => import('@components/Container')) const SEO = dynamic(() => import('@components/SEO')) const Divider = dynamic(() => import('@components/Divider')) @@ -24,6 +24,9 @@ const Owner = dynamic(() => import('@components/Owner')) const Message = dynamic(() => import('@components/Message')) const PendingBot: NextPage = ({ data }) => { + const [ isCopied, setCopied ] = useCopyClipboard(data.desc, { + successDuration: 1000 + }) if(!data) return return @@ -61,6 +64,11 @@ const PendingBot: NextPage = ({ data }) => { 초대하기 + +

+ { isCopied ? <> 복사됨 : <> 설명 마크다운 복사하기} +

+