1
1
import React from "react" ;
2
- import Login from "./Login" ;
2
+ import Login , { LoginProps } from "./Login" ;
3
3
4
4
export type CustomProvider = {
5
5
id : string ;
@@ -18,12 +18,9 @@ export type LoginProviderProps = {
18
18
label ?: ( name : string ) => string ;
19
19
} ;
20
20
21
- type LoginProps = {
22
- postLoginRedirect ?: string ;
23
- label ?: ( name : string ) => string ;
24
- } ;
21
+ type LoginWrapperProps = Pick < LoginProps , "postLoginRedirect" | "label" > ;
25
22
26
- const AzureADLogin = ( { postLoginRedirect, label } : LoginProps ) => (
23
+ const AzureADLogin = ( { postLoginRedirect, label } : LoginWrapperProps ) => (
27
24
< Login
28
25
name = "Azure AD"
29
26
id = "aad"
@@ -32,7 +29,7 @@ const AzureADLogin = ({ postLoginRedirect, label }: LoginProps) => (
32
29
key = "aad"
33
30
/>
34
31
) ;
35
- const FacebookLogin = ( { postLoginRedirect, label } : LoginProps ) => (
32
+ const FacebookLogin = ( { postLoginRedirect, label } : LoginWrapperProps ) => (
36
33
< Login
37
34
name = "Facebook"
38
35
id = "facebook"
@@ -41,7 +38,7 @@ const FacebookLogin = ({ postLoginRedirect, label }: LoginProps) => (
41
38
key = "facebook"
42
39
/>
43
40
) ;
44
- const TwitterLogin = ( { postLoginRedirect, label } : LoginProps ) => (
41
+ const TwitterLogin = ( { postLoginRedirect, label } : LoginWrapperProps ) => (
45
42
< Login
46
43
name = "Twitter"
47
44
id = "twitter"
@@ -50,7 +47,7 @@ const TwitterLogin = ({ postLoginRedirect, label }: LoginProps) => (
50
47
key = "twitter"
51
48
/>
52
49
) ;
53
- const GitHubLogin = ( { postLoginRedirect, label } : LoginProps ) => (
50
+ const GitHubLogin = ( { postLoginRedirect, label } : LoginWrapperProps ) => (
54
51
< Login
55
52
name = "GitHub"
56
53
id = "github"
@@ -59,7 +56,7 @@ const GitHubLogin = ({ postLoginRedirect, label }: LoginProps) => (
59
56
key = "github"
60
57
/>
61
58
) ;
62
- const GoogleLogin = ( { postLoginRedirect, label } : LoginProps ) => (
59
+ const GoogleLogin = ( { postLoginRedirect, label } : LoginWrapperProps ) => (
63
60
< Login
64
61
name = "Google"
65
62
id = "google"
@@ -68,7 +65,7 @@ const GoogleLogin = ({ postLoginRedirect, label }: LoginProps) => (
68
65
key = "google"
69
66
/>
70
67
) ;
71
- const AppleLogin = ( { postLoginRedirect, label } : LoginProps ) => (
68
+ const AppleLogin = ( { postLoginRedirect, label } : LoginWrapperProps ) => (
72
69
< Login
73
70
name = "Apple"
74
71
id = "apple"
@@ -83,7 +80,7 @@ const CustomProviderLogin = ({
83
80
id,
84
81
name,
85
82
label,
86
- } : LoginProps & CustomProvider ) => (
83
+ } : LoginWrapperProps & CustomProvider ) => (
87
84
< Login
88
85
name = { name || id }
89
86
id = { id }
0 commit comments