forked from kriasoft/react-starter-kit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAuthIcon.tsx
101 lines (93 loc) · 3.33 KB
/
AuthIcon.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
/* SPDX-FileCopyrightText: 2014-present Kriasoft */
/* SPDX-License-Identifier: MIT */
import { SvgIcon, SvgIconProps } from "@mui/material";
import { type SignInMethod } from "../core/auth.js";
export function AuthIcon(props: AuthIconProps): JSX.Element {
const { variant, ...other } = props;
if (variant === "apple.com") {
return (
<SvgIcon role="img" viewBox="0 0 24 24" {...other}>
<title>Apple</title>
<path
fill="#000"
d="M14.94,5.19A4.38,4.38,0,0,0,16,2,4.44,4.44,0,0,0,13,3.52,4.17,4.17,0,0,0,12,6.61,3.69,3.69,0,0,0,14.94,5.19Zm2.52,7.44a4.51,4.51,0,0,1,2.16-3.81,4.66,4.66,0,0,0-3.66-2c-1.56-.16-3,.91-3.83.91s-2-.89-3.3-.87A4.92,4.92,0,0,0,4.69,9.39C2.93,12.45,4.24,17,6,19.47,6.8,20.68,7.8,22.05,9.12,22s1.75-.82,3.28-.82,2,.82,3.3.79,2.22-1.24,3.06-2.45a11,11,0,0,0,1.38-2.85A4.41,4.41,0,0,1,17.46,12.63Z"
/>
</SvgIcon>
);
}
if (variant === "google.com") {
return (
<SvgIcon role="img" viewBox="0 0 48 48" {...other}>
<title>Google</title>
<g>
<path
fill="#EA4335"
d="M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z"
/>
<path
fill="#4285F4"
d="M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z"
/>
<path
fill="#FBBC05"
d="M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z"
/>
<path
fill="#34A853"
d="M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z"
/>
<path fill="none" d="M0 0h48v48H0z" />
</g>
</SvgIcon>
);
}
if (variant === "facebook.com") {
return (
<SvgIcon role="img" viewBox="0 0 24 24" {...other}>
<title>Facebook</title>
<path d="M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z" />
</SvgIcon>
);
}
return (
<SvgIcon role="img" viewBox="0 0 32 32" {...other}>
<title>Anonymous</title>
<circle
fill="none"
stroke="#999"
cx="16"
cy="16"
r="14"
strokeWidth={2}
strokeLinecap="round"
strokeLinejoin="round"
strokeMiterlimit={10}
/>
<circle
fill="none"
stroke="#999"
cx="16"
cy="13"
r="5"
strokeWidth={2}
strokeLinecap="round"
strokeLinejoin="round"
strokeMiterlimit={10}
/>
<path
fill="none"
stroke="#999"
d="M5.4 25.1c1.8-4.1 5.8-7 10.6-7s8.9 2.9 10.6 7"
strokeWidth={2}
strokeLinecap="round"
strokeLinejoin="round"
strokeMiterlimit={10}
/>
</SvgIcon>
);
throw new TypeError(`variant: ${variant}`);
}
export type AuthIconProps = Omit<
SvgIconProps<"svg", { variant: SignInMethod }>,
"children" | "viewBox"
>;