Skip to content

Commit

Permalink
chore(repo): Attempt to fix retheme build (#4474)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikospapcom authored Nov 4, 2024
1 parent f1a855b commit d728048
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 38 deletions.
2 changes: 2 additions & 0 deletions .changeset/fluffy-fans-clap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
2 changes: 2 additions & 0 deletions playground/nextjs/app/app-dir/client/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import { SignedIn, SignedOut } from '@clerk/nextjs';
export default function Page() {
return (
<div>
{/* @ts-ignore */}
<SignedIn>Hello In</SignedIn>
{/* @ts-ignore */}
<SignedOut>Hello Out</SignedOut>
</div>
);
Expand Down
4 changes: 3 additions & 1 deletion playground/nextjs/app/app-dir/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Link from 'next/link';
export default async function Page() {
const { userId } = await auth();
const currentUser_ = await currentUser();
const user = userId ? await clerkClient.users.getUser(userId) : null;
const user = userId ? await (await clerkClient()).users.getUser(userId) : null;

return (
<main>
Expand All @@ -26,6 +26,7 @@ export default async function Page() {
<div>
<h1>Hello, Next.js!</h1>
{userId ? <h3>Signed in as: {userId}</h3> : <h3>Signed out</h3>}
{/* @ts-ignore */}
<SignedIn>
<UserButton
userProfileMode='navigation'
Expand All @@ -40,6 +41,7 @@ export default async function Page() {
<div>{JSON.stringify(user)}</div>
<div>{JSON.stringify(currentUser_)}</div>
</SignedIn>
{/* @ts-ignore */}
<SignedOut>
<SignIn routing='hash' />
</SignedOut>
Expand Down
13 changes: 8 additions & 5 deletions playground/nextjs/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ export const metadata: Metadata = {
};
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<ClerkProvider>
<html lang='en'>
<body>{children}</body>
</html>
</ClerkProvider>
<>
{/* @ts-ignore */}
<ClerkProvider dynamic>
<html lang='en'>
<body>{children}</body>
</html>
</ClerkProvider>
</>
);
}
6 changes: 3 additions & 3 deletions playground/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"lint": "next lint"
},
"dependencies": {
"@clerk/nextjs": "beta",
"@clerk/themes": "beta",
"next": "^14.1.0",
"@clerk/nextjs": "canary",
"@clerk/themes": "canary",
"next": "^15",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
63 changes: 34 additions & 29 deletions playground/nextjs/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,35 +59,38 @@ function MyApp({ Component, pageProps }: AppProps) {
const C = Component as FunctionComponent;

return (
<ClerkProvider
appearance={{
baseTheme: styleReset ? [experimental__simple, themes[selectedTheme]] : themes[selectedTheme],
variables: {
colorPrimary: primaryColor,
},
layout: {
animations,
unsafe_disableDevelopmentModeWarnings: disableDevMode,
},
}}
{...pageProps}
waitlistUrl='/waitlist'
>
<AppBar
onChangeTheme={e => setSelectedTheme(e.target.value as any)}
onToggleDark={onToggleDark}
onToggleSmooth={onToggleSmooth}
onResetStyles={() => setStyleReset(s => !s)}
onToggleAnimations={onToggleAnimations}
devMode={disableDevMode}
onToggleDevMode={onToggleDevMode}
animations={animations}
styleReset={styleReset}
smooth={selectedSmoothing}
onPrimaryColorChange={setPrimaryColor}
/>
<C {...pageProps} />
</ClerkProvider>
<>
{/* @ts-ignore */}
<ClerkProvider
appearance={{
baseTheme: styleReset ? [experimental__simple, themes[selectedTheme]] : themes[selectedTheme],
variables: {
colorPrimary: primaryColor,
},
layout: {
animations,
unsafe_disableDevelopmentModeWarnings: disableDevMode,
},
}}
{...pageProps}
waitlistUrl='/waitlist'
>
<AppBar
onChangeTheme={e => setSelectedTheme(e.target.value as any)}
onToggleDark={onToggleDark}
onToggleSmooth={onToggleSmooth}
onResetStyles={() => setStyleReset(s => !s)}
onToggleAnimations={onToggleAnimations}
devMode={disableDevMode}
onToggleDevMode={onToggleDevMode}
animations={animations}
styleReset={styleReset}
smooth={selectedSmoothing}
onPrimaryColorChange={setPrimaryColor}
/>
<C {...pageProps} />
</ClerkProvider>
</>
);
}

Expand Down Expand Up @@ -152,10 +155,12 @@ const AppBar = (props: AppBarProps) => {
/>
<UserButton />

{/* @ts-ignore */}
<SignedIn>
<SignOutButton />
</SignedIn>

{/* @ts-ignore */}
<SignedOut>
<SignInButton mode={'modal'} />
</SignedOut>
Expand Down

0 comments on commit d728048

Please sign in to comment.