Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ec69f0b

Browse files
committed
Move CLI login to connect interstitial
1 parent fadab74 commit ec69f0b

5 files changed

Lines changed: 409 additions & 57 deletions

File tree

apps/studio/components/layouts/InterstitialLayout.tsx

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { motion } from 'framer-motion'
2+
import { ArrowRightLeft } from 'lucide-react'
23
import type { PropsWithChildren, ReactNode } from 'react'
34
import { Card, CardContent, CardHeader, cn } from 'ui'
45

@@ -11,20 +12,24 @@ interface InterstitialLayoutProps {
1112
logo?: ReactNode
1213
title?: ReactNode
1314
description?: ReactNode
15+
subtitle?: ReactNode
1416
containerClassName?: string
1517
cardClassName?: string
1618
titleClassName?: string
1719
descriptionClassName?: string
20+
subtitleClassName?: string
1821
}
1922

2023
export const InterstitialLayout = ({
2124
logo,
2225
title,
2326
description,
27+
subtitle,
2428
containerClassName,
2529
cardClassName,
2630
titleClassName,
2731
descriptionClassName,
32+
subtitleClassName,
2833
children,
2934
}: PropsWithChildren<InterstitialLayoutProps>) => {
3035
const TitleElement = typeof title === 'string' ? 'h1' : 'div'
@@ -42,7 +47,7 @@ export const InterstitialLayout = ({
4247
transition={{ duration: 0.3, ease: [0.16, 1, 0.3, 1] }}
4348
className={cn('mx-auto w-full max-w-[400px] overflow-hidden', cardClassName)}
4449
>
45-
{(logo || title || description) && (
50+
{(logo || title || description || subtitle) && (
4651
<CardHeader className="items-center gap-0 space-y-0 border-0 px-6 py-6 text-center font-normal [--card-padding-x:1.5rem]">
4752
{logo && <div className="mb-4 flex justify-center">{logo}</div>}
4853
{(title || description) && (
@@ -69,6 +74,11 @@ export const InterstitialLayout = ({
6974
)}
7075
</div>
7176
)}
77+
{subtitle && (
78+
<div className={cn('mt-2.5 text-sm text-foreground-lighter', subtitleClassName)}>
79+
{subtitle}
80+
</div>
81+
)}
7282
</CardHeader>
7383
)}
7484
{children}
@@ -88,12 +98,26 @@ export const LogoBox = ({ children, className }: { children: ReactNode; classNam
8898
</div>
8999
)
90100

101+
export const LogoPair = ({ left, right }: { left: ReactNode; right: ReactNode }) => (
102+
<div className="flex items-center justify-center gap-2.5">
103+
{left}
104+
<ArrowRightLeft className="size-4 text-foreground-muted" />
105+
{right}
106+
</div>
107+
)
108+
91109
export const SupabaseLogo = () => (
92110
<LogoBox>
93111
<img alt="Supabase" src={`${BASE_PATH}/img/supabase-logo.svg`} className="size-7" />
94112
</LogoBox>
95113
)
96114

115+
export const InterstitialMetadataPill = ({ children }: PropsWithChildren) => (
116+
<span className="mx-auto mt-1.5 flex w-fit items-center gap-1 rounded-full border border-muted px-2 py-1 font-mono text-[11px] tracking-tight text-foreground-lighter">
117+
{children}
118+
</span>
119+
)
120+
97121
export const InterstitialAccountRow = ({
98122
avatarUrl,
99123
displayName,

apps/studio/components/ui/CopyButton.tsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ const CopyButton = forwardRef<HTMLButtonElement, CopyButtonProps>(
3131
onClick,
3232
copyLabel = 'Copy',
3333
copiedLabel = 'Copied',
34+
type = 'primary',
35+
icon,
36+
className,
3437
...props
3538
},
3639
ref
@@ -53,9 +56,17 @@ const CopyButton = forwardRef<HTMLButtonElement, CopyButtonProps>(
5356
onClick?.(e)
5457
}}
5558
{...props}
56-
className={cn({ 'px-1': iconOnly }, props.className)}
59+
type={type}
60+
className={cn({ 'px-1': iconOnly }, className)}
5761
icon={
58-
showCopied ? <Check strokeWidth={2} className="text-brand" /> : (props.icon ?? <Copy />)
62+
showCopied ? (
63+
<Check
64+
strokeWidth={2}
65+
className={cn(type === 'primary' ? 'text-inherit' : 'text-brand')}
66+
/>
67+
) : (
68+
(icon ?? <Copy />)
69+
)
5970
}
6071
>
6172
{!iconOnly && <>{children ?? (showCopied ? copiedLabel : copyLabel)}</>}

0 commit comments

Comments
 (0)