mirror of
https://github.com/supabase/supabase.git
synced 2026-10-08 10:55:06 +03:00
remove arrow function from code sample
This commit is contained in:
1 parent
e34e0277c6
commit
32d42a6737
1 file changed
+25
-25
@@ -97,34 +97,34 @@ function AuthComponentExample() {
|
||||
import { Auth, Typography, Button } from '@supabase/ui'
|
||||
import { createClient } from '@supabase/supabase-js'
|
||||
|
||||
export default function app() {
|
||||
const supabase = createClient(
|
||||
'https://YOUR-PROJECT-ID.supabase.co',
|
||||
'YOUR-PUBLIC-ANON-KEY'
|
||||
)
|
||||
export default function app() {
|
||||
const supabase = createClient(
|
||||
"https://YOUR-PROJECT-ID.supabase.co",
|
||||
"YOUR-PUBLIC-ANON-KEY"
|
||||
);
|
||||
|
||||
const Container = (props: any) => {
|
||||
const { user } = Auth.useUser()
|
||||
if (user) {
|
||||
return (
|
||||
<div>
|
||||
<Typography.Text>Signed in: {user.email}</Typography.Text>
|
||||
<Button block onClick={() => props.supabaseClient.auth.signOut()}>
|
||||
Sign out
|
||||
</Button>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
return props.children
|
||||
function Container(props: any) {
|
||||
const { user } = Auth.useUser();
|
||||
if (user) {
|
||||
return (
|
||||
<div>
|
||||
<Typography.Text>Signed in: {user.email}</Typography.Text>
|
||||
<Button block onClick={() => props.supabaseClient.auth.signOut()}>
|
||||
Sign out
|
||||
</Button>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
return props.children;
|
||||
};
|
||||
|
||||
return (
|
||||
<Auth.UserContextProvider supabaseClient={supabase}>
|
||||
<Container supabaseClient={supabase}>
|
||||
<Auth supabaseClient={supabase} />
|
||||
</Container>
|
||||
</Auth.UserContextProvider>
|
||||
)
|
||||
return (
|
||||
<Auth.UserContextProvider supabaseClient={supabase}>
|
||||
<Container supabaseClient={supabase}>
|
||||
<Auth supabaseClient={supabase} />
|
||||
</Container>
|
||||
</Auth.UserContextProvider>
|
||||
);
|
||||
}
|
||||
`}
|
||||
lang="js"
|
||||
|
||||
Reference in new issue
Block a user