Skip to content

Commit bbfe728

Browse files
committed
chore: Add line sign in button to examples
1 parent d203cd8 commit bbfe728

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed

examples/react/src/screens/oauth-screen.tsx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
*/
1616

1717
import { useState } from "react";
18+
import { OAuthProvider } from "firebase/auth";
1819
import {
20+
OAuthButton,
1921
FacebookSignInButton,
2022
AppleSignInButton,
2123
GitHubSignInButton,
@@ -37,6 +39,7 @@ export default function OAuthScreenPage() {
3739
<GitHubSignInButton themed={themed} />
3840
<MicrosoftSignInButton themed={themed} />
3941
<TwitterSignInButton themed={themed} />
42+
<LineSignInButton themed={themed} />
4043
</OAuthScreen>
4144
<div className="flex items-center gap-2 max-w-sm mx-auto mt-12">
4245
<input type="checkbox" checked={themed} onChange={() => setThemed(!themed)} />
@@ -45,3 +48,23 @@ export default function OAuthScreenPage() {
4548
</>
4649
);
4750
}
51+
52+
function LineSignInButton({ themed }: { themed?: boolean | string }) {
53+
const provider = new OAuthProvider("oidc.line");
54+
55+
return (
56+
<OAuthButton provider={provider} themed={themed}>
57+
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 48 48">
58+
<path
59+
fill="#00c300"
60+
d="M12.5 42h23a6.5 6.5 0 0 0 6.5-6.5v-23A6.5 6.5 0 0 0 35.5 6h-23A6.5 6.5 0 0 0 6 12.5v23a6.5 6.5 0 0 0 6.5 6.5"
61+
/>
62+
<path
63+
fill="#fff"
64+
d="M37.113 22.417c0-5.865-5.88-10.637-13.107-10.637s-13.108 4.772-13.108 10.637c0 5.258 4.663 9.662 10.962 10.495.427.092 1.008.282 1.155.646.132.331.086.85.042 1.185 0 0-.153.925-.187 1.122-.057.331-.263 1.296 1.135.707s7.548-4.445 10.298-7.611h-.001c1.901-2.082 2.811-4.197 2.811-6.544m-18.238 3.49h-2.604a.69.69 0 0 1-.687-.688V20.01a.688.688 0 0 1 1.374 0v4.521h1.917a.688.688 0 0 1 0 1.376m2.693-.688a.688.688 0 1 1-1.374 0V20.01a.688.688 0 0 1 1.374 0zm6.27 0a.684.684 0 0 1-.688.688.69.69 0 0 1-.549-.275l-2.669-3.635v3.222a.689.689 0 0 1-1.376 0V20.01a.687.687 0 0 1 1.237-.412l2.67 3.635V20.01a.688.688 0 0 1 1.375 0zm4.214-3.292a.689.689 0 0 1 0 1.375h-1.917v1.23h1.917a.688.688 0 0 1 0 1.375h-2.604a.69.69 0 0 1-.687-.688v-5.208c0-.379.308-.687.687-.687h2.604a.688.688 0 1 1 0 1.374h-1.917v1.23h1.917z"
65+
/>
66+
</svg>
67+
<span>Sign in with Line</span>
68+
</OAuthButton>
69+
);
70+
}

examples/shadcn/src/index.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,12 @@
155155
--primary: var(--twitter-primary);
156156
--primary-foreground: var(--color-white);
157157
}
158+
button[data-provider="oidc.line"][data-themed="true"] {
159+
--line-primary: #07B53B;
160+
--primary: var(--line-primary);
161+
--primary-foreground: var(--color-white);
162+
}
163+
158164
}
159165

160166
@variant dark {

examples/shadcn/src/screens/oauth-screen.tsx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
"use client";
1717

1818
import { useState } from "react";
19+
import { OAuthProvider } from "firebase/auth";
20+
import { OAuthButton } from "@/components/oauth-button";
1921
import { GoogleSignInButton } from "@/components/google-sign-in-button";
2022
import { FacebookSignInButton } from "@/components/facebook-sign-in-button";
2123
import { AppleSignInButton } from "@/components/apple-sign-in-button";
@@ -36,6 +38,7 @@ export default function OAuthScreenPage() {
3638
<GitHubSignInButton themed={themed} />
3739
<MicrosoftSignInButton themed={themed} />
3840
<TwitterSignInButton themed={themed} />
41+
<LineSignInButton themed={themed} />
3942
</OAuthScreen>
4043
<div className="flex items-center gap-2 max-w-sm mx-auto mt-12">
4144
<input type="checkbox" checked={themed} onChange={() => setThemed(!themed)} />
@@ -44,3 +47,19 @@ export default function OAuthScreenPage() {
4447
</>
4548
);
4649
}
50+
51+
function LineSignInButton({ themed }: { themed?: boolean }) {
52+
const provider = new OAuthProvider("oidc.line");
53+
54+
return (
55+
<OAuthButton provider={provider} themed={themed}>
56+
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 48 48">
57+
<path
58+
fill="#00c300"
59+
d="M12.5 42h23a6.5 6.5 0 0 0 6.5-6.5v-23A6.5 6.5 0 0 0 35.5 6h-23A6.5 6.5 0 0 0 6 12.5v23a6.5 6.5 0 0 0 6.5 6.5"
60+
/>
61+
</svg>
62+
<span>Sign in with Line</span>
63+
</OAuthButton>
64+
);
65+
}

0 commit comments

Comments
 (0)