Skip to content

Commit

Permalink
refactor(ui): Add clerk components to landing page (#3721)
Browse files Browse the repository at this point in the history
Co-authored-by: Nikos Douvlis <[email protected]>
Co-authored-by: Joe Bell <[email protected]>
  • Loading branch information
3 people authored Jul 16, 2024
1 parent 0ef6dda commit 3d3d5ae
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 13 deletions.
2 changes: 2 additions & 0 deletions .changeset/shiny-crabs-cover.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
1 change: 1 addition & 0 deletions packages/ui/src/components/sign-in/sign-in.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ export function SignInComponentLoaded() {
<LinkButton
size='sm'
disabled={isGlobalLoading}
type='button'
>
{t('formFieldAction__forgotPassword')}
</LinkButton>
Expand Down
30 changes: 29 additions & 1 deletion packages/ui/theme-builder/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
import { SignedIn, SignedOut, SignInButton, SignOutButton, SignUpButton } from '@clerk/nextjs';

function Button({ children }: { children: React.ReactNode }) {
return (
<button className='relative isolate rounded border bg-white bg-gradient-to-b from-white to-neutral-50 px-2.5 py-1 text-sm font-medium'>
{children}
</button>
);
}

export default function Home() {
return null;
return (
<div className='relative'>
<SignedIn>
<SignOutButton>
<Button>Sign out</Button>
</SignOutButton>
</SignedIn>
<SignedOut>
<div className='flex flex-col gap-4'>
<SignInButton>
<Button>Sign in</Button>
</SignInButton>
<SignUpButton>
<Button>Sign up</Button>
</SignUpButton>
</div>
</SignedOut>
</div>
);
}
2 changes: 1 addition & 1 deletion packages/ui/theme-builder/app/theme-builder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export function ThemeBuilder({ children }: { children: React.ReactNode }) {
<select
name='component'
id='component'
defaultValue={pathname}
value={pathname}
onChange={e => router.push(e.target.value)}
className='relative appearance-none rounded border bg-neutral-100 py-1 pl-1.5 pr-5 text-xs after:absolute after:right-1.5 after:top-1 after:size-2 after:bg-red-200'
>
Expand Down
12 changes: 1 addition & 11 deletions packages/ui/theme-builder/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
async redirects() {
return [
{
source: '/',
destination: '/sign-in',
permanent: false,
},
];
},
};
const nextConfig = {};

export default nextConfig;

0 comments on commit 3d3d5ae

Please sign in to comment.