|
|
@ -2,14 +2,14 @@ import { useState } from 'preact/hooks'; |
|
|
|
|
|
|
|
|
|
|
|
import { useCopyText } from '../../hooks/use-copy-text'; |
|
|
|
import { useCopyText } from '../../hooks/use-copy-text'; |
|
|
|
import { useAuth } from '../../hooks/use-auth'; |
|
|
|
import { useAuth } from '../../hooks/use-auth'; |
|
|
|
import { LongBadgeTab } from './LongBadgeTab'; |
|
|
|
import { TallBadgeTab } from './TallBadgeTab'; |
|
|
|
import WideBadgeTab from './WideBadgeTab'; |
|
|
|
import WideBadgeTab from './WideBadgeTab'; |
|
|
|
import CopyIcon from '../../icons/copy.svg'; |
|
|
|
import CopyIcon from '../../icons/copy.svg'; |
|
|
|
|
|
|
|
|
|
|
|
export type GetBadgeLinkProps = { |
|
|
|
export type GetBadgeLinkProps = { |
|
|
|
user: ReturnType<typeof useAuth>; |
|
|
|
user: ReturnType<typeof useAuth>; |
|
|
|
variant: 'dark' | 'light'; |
|
|
|
variant: 'dark' | 'light'; |
|
|
|
badge: 'long' | 'wide'; |
|
|
|
badge: 'tall' | 'wide'; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
export function getBadgeLink({ user, variant, badge }: GetBadgeLinkProps) { |
|
|
|
export function getBadgeLink({ user, variant, badge }: GetBadgeLinkProps) { |
|
|
@ -45,7 +45,7 @@ export function Editor(props: EditorProps) { |
|
|
|
const { isCopied, copyText } = useCopyText(); |
|
|
|
const { isCopied, copyText } = useCopyText(); |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<div className="flex flex-grow flex-col overflow-hidden rounded border border-gray-300 bg-gray-50"> |
|
|
|
<div className="flex flex-grow flex-col overflow-hidden rounded border border-gray-300 bg-gray-50 w-full"> |
|
|
|
<div className="flex items-center justify-between gap-2 border-b border-gray-300 px-3 py-2"> |
|
|
|
<div className="flex items-center justify-between gap-2 border-b border-gray-300 px-3 py-2"> |
|
|
|
<span className="text-xs uppercase leading-none text-gray-400"> |
|
|
|
<span className="text-xs uppercase leading-none text-gray-400"> |
|
|
|
{title} |
|
|
|
{title} |
|
|
@ -75,7 +75,7 @@ export type BadgeProps = { |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
export function RoadCardPage() { |
|
|
|
export function RoadCardPage() { |
|
|
|
const [selectedBadge, setSelectedBadge] = useState<'long' | 'wide'>('long'); |
|
|
|
const [selectedBadge, setSelectedBadge] = useState<'tall' | 'wide'>('tall'); |
|
|
|
|
|
|
|
|
|
|
|
const user = useAuth(); |
|
|
|
const user = useAuth(); |
|
|
|
if (!user) { |
|
|
|
if (!user) { |
|
|
@ -96,15 +96,15 @@ export function RoadCardPage() { |
|
|
|
<div className="flex items-center"> |
|
|
|
<div className="flex items-center"> |
|
|
|
<button |
|
|
|
<button |
|
|
|
className={`relative top-px flex items-center justify-center px-3 pb-3 leading-none shadow-gray-600 ${ |
|
|
|
className={`relative top-px flex items-center justify-center px-3 pb-3 leading-none shadow-gray-600 ${ |
|
|
|
selectedBadge === 'long' |
|
|
|
selectedBadge === 'tall' |
|
|
|
? 'shadow-[inset_0_-1px_0_var(--tw-shadow-color)]' |
|
|
|
? 'shadow-[inset_0_-1px_0_var(--tw-shadow-color)]' |
|
|
|
: 'text-gray-600' |
|
|
|
: 'text-gray-600' |
|
|
|
}`}
|
|
|
|
}`}
|
|
|
|
onClick={() => { |
|
|
|
onClick={() => { |
|
|
|
setSelectedBadge('long'); |
|
|
|
setSelectedBadge('tall'); |
|
|
|
}} |
|
|
|
}} |
|
|
|
> |
|
|
|
> |
|
|
|
Long |
|
|
|
Tall |
|
|
|
</button> |
|
|
|
</button> |
|
|
|
|
|
|
|
|
|
|
|
<button |
|
|
|
<button |
|
|
@ -123,7 +123,7 @@ export function RoadCardPage() { |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
{selectedBadge === 'long' && <LongBadgeTab />} |
|
|
|
{selectedBadge === 'tall' && <TallBadgeTab />} |
|
|
|
{selectedBadge === 'wide' && <WideBadgeTab />} |
|
|
|
{selectedBadge === 'wide' && <WideBadgeTab />} |
|
|
|
</> |
|
|
|
</> |
|
|
|
); |
|
|
|
); |
|
|
|