Skip to content

Commit 889cebc

Browse files
authored
fix(*): Update playground to support changes in #2328 for retheme (#2357)
1 parent e3087b7 commit 889cebc

File tree

2 files changed

+2
-59
lines changed

2 files changed

+2
-59
lines changed

playground/nextjs/pages/session-examples/index.tsx

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useSession, withSession, WithSession, WithSessionProp } from '@clerk/nextjs';
1+
import { useSession } from '@clerk/nextjs';
22
import { PublicUserData } from '@clerk/types';
33
import type { NextPage } from 'next';
44
import React from 'react';
@@ -20,36 +20,12 @@ function PublicMetadataWithHook() {
2020
return <Template publicUserData={session?.publicUserData} />;
2121
}
2222

23-
class PublicMetadataClass extends React.Component<WithSessionProp> {
24-
render() {
25-
return <Template publicUserData={this.props.session.publicUserData} />;
26-
}
27-
}
28-
29-
export const PublicMetadataClassHOC = withSession(PublicMetadataClass);
30-
31-
const PublicMetadataFn = (props: WithSessionProp) => {
32-
const { session } = props;
33-
return <Template publicUserData={session?.publicUserData} />;
34-
};
35-
36-
export const PublicMetadataFnHOC = withSession(PublicMetadataFn);
37-
38-
class PublicMetadataFaaC extends React.Component {
39-
render() {
40-
return <WithSession>{session => <Template publicUserData={session?.publicUserData} />}</WithSession>;
41-
}
42-
}
43-
4423
const SessionExamplesPage: NextPage = () => {
4524
return (
4625
<div
4726
style={{ display: 'flex', flexDirection: 'column', gap: '2rem', justifyContent: 'center', alignItems: 'center' }}
4827
>
4928
<PublicMetadataWithHook />
50-
<PublicMetadataClassHOC />
51-
<PublicMetadataFnHOC />
52-
{/*<PublicMetadataFaaC />*/}
5329
</div>
5430
);
5531
};

playground/nextjs/pages/user-examples/index.tsx

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { NextPage } from 'next';
22
import React from 'react';
3-
import { useUser, withUser, WithUser, WithUserProp } from '@clerk/nextjs';
3+
import { useUser } from '@clerk/nextjs';
44

55
function GreetingWithHook() {
66
// Use the useUser hook to get the Clerk.user object
@@ -15,45 +15,12 @@ function GreetingWithHook() {
1515
return <div>Hello, {user.firstName}!</div>;
1616
}
1717

18-
class GreetingClass extends React.Component<WithUserProp> {
19-
render() {
20-
return <div>{this.props.user.firstName ? `Hello ${this.props.user.firstName}!` : 'Hello there!'}</div>;
21-
}
22-
}
23-
24-
export const GreetingClassHOC = withUser(GreetingClass);
25-
26-
type GreetingProps = {
27-
greeting: string;
28-
};
29-
30-
const GreetingFn = (props: WithUserProp<GreetingProps>) => {
31-
const { user, greeting } = props;
32-
return (
33-
<>
34-
<h1>{greeting}</h1>
35-
<div>{user.firstName ? `Hello, ${user.firstName}!` : 'Hello there!'}</div>
36-
</>
37-
);
38-
};
39-
40-
export const GreetingFnHOC = withUser(GreetingFn);
41-
42-
class GreetingFaaC extends React.Component {
43-
render() {
44-
return <WithUser>{user => <div>{user.firstName ? `Hello, ${user.firstName}!` : 'Hello there!'}</div>}</WithUser>;
45-
}
46-
}
47-
4818
const UserExamplesPage: NextPage = () => {
4919
return (
5020
<div
5121
style={{ display: 'flex', flexDirection: 'column', gap: '2rem', justifyContent: 'center', alignItems: 'center' }}
5222
>
5323
<GreetingWithHook />
54-
<GreetingClassHOC />
55-
<GreetingFnHOC greeting={'Ciao'} />
56-
{/*<GreetingFaaC />*/}
5724
</div>
5825
);
5926
};

0 commit comments

Comments
 (0)