Skip to content

Commit 8cd9c51

Browse files
author
sw-yx
committed
fix example
1 parent da980f2 commit 8cd9c51

File tree

1 file changed

+38
-29
lines changed

1 file changed

+38
-29
lines changed

example/src/App.tsx

+38-29
Original file line numberDiff line numberDiff line change
@@ -12,35 +12,44 @@ function App() {
1212
return (
1313
<IdentityContextProvider value={identity}>
1414
<div className="App">
15-
{identity && identity.isLoggedIn ? (
16-
<header className="App-header">
17-
<h1> hello {name}!</h1>
18-
{avatar_url && <img src={avatar_url} style={{ height: 100, borderRadius: "50%" }} />}
19-
<button className="btn" style={{ maxWidth: 400, background: "orangered" }} onClick={() => setDialog(true)}>
20-
LOG OUT
21-
</button>
22-
23-
<IdentityModal showDialog={dialog} onCloseDialog={() => setDialog(false)} />
24-
</header>
25-
) : (
26-
<header className="App-header">
27-
<h1> hello! try logging in! </h1>
28-
<button className="btn" style={{ maxWidth: 400, background: "darkgreen" }} onClick={() => setDialog(true)}>
29-
LOG IN
30-
</button>
31-
<IdentityModal showDialog={dialog} onCloseDialog={() => setDialog(false)} />
32-
</header>
33-
)}
34-
<h3>
35-
Or{" "}
36-
<a
37-
href="https://github.com/sw-yx/react-netlify-identity-widget"
38-
target="_blank"
39-
style={{ color: "powderblue" }}
40-
>
41-
view the source
42-
</a>
43-
</h3>
15+
<header className="App-header">
16+
{identity && identity.isLoggedIn ? (
17+
<>
18+
<h1> hello {name}!</h1>
19+
{avatar_url && <img src={avatar_url} style={{ height: 100, borderRadius: "50%" }} />}
20+
<button
21+
className="btn"
22+
style={{ maxWidth: 400, background: "orangered" }}
23+
onClick={() => setDialog(true)}
24+
>
25+
LOG OUT
26+
</button>
27+
<IdentityModal showDialog={dialog} onCloseDialog={() => setDialog(false)} />
28+
</>
29+
) : (
30+
<>
31+
<h1> hello! try logging in! </h1>
32+
<button
33+
className="btn"
34+
style={{ maxWidth: 400, background: "darkgreen" }}
35+
onClick={() => setDialog(true)}
36+
>
37+
LOG IN
38+
</button>
39+
<IdentityModal showDialog={dialog} onCloseDialog={() => setDialog(false)} />
40+
</>
41+
)}
42+
<h3>
43+
Or{" "}
44+
<a
45+
href="https://github.com/sw-yx/react-netlify-identity-widget"
46+
target="_blank"
47+
style={{ color: "powderblue" }}
48+
>
49+
view the source
50+
</a>
51+
</h3>
52+
</header>
4453
</div>
4554
</IdentityContextProvider>
4655
)

0 commit comments

Comments
 (0)