diff --git a/src/components/Editor.tsx b/src/components/Editor.tsx new file mode 100644 index 000000000..adda42323 --- /dev/null +++ b/src/components/Editor.tsx @@ -0,0 +1,37 @@ +import { useCopyText } from '../hooks/use-copy-text'; +import CopyIcon from '../icons/copy.svg'; + +type EditorProps = { + title: string; + text: string; +}; + +export function Editor(props: EditorProps) { + const { text, title } = props; + const { isCopied, copyText } = useCopyText(); + + return ( +
+
+ + {title} + + +
+ +
+ ); +} diff --git a/src/components/RoadCard/RoadCardPage.tsx b/src/components/RoadCard/RoadCardPage.tsx index 3937e1b56..85f180c0e 100644 --- a/src/components/RoadCard/RoadCardPage.tsx +++ b/src/components/RoadCard/RoadCardPage.tsx @@ -4,44 +4,8 @@ import { TOKEN_COOKIE_NAME, decodeToken } from '../../lib/jwt'; import { WideBadge } from './WideBadge'; import { LongBadge } from './LongBadge'; -import CopyIcon from '../../icons/copy.svg'; import { useCopyText } from '../../hooks/use-copy-text'; - -type EditorProps = { - title: string; - text: string; -}; - -function Editor(props: EditorProps) { - const { text, title } = props; - - const { isCopied, copyText } = useCopyText(); - - return ( -
-
- - {title} - - -
- -
- ); -} +import {Editor} from "../Editor"; export type BadgeProps = { badgeUrl: string; @@ -164,7 +128,7 @@ export function RoadCardPage() { -

+

Add this badge to your{' '} - GitHub profile readme. + GitHub profile.