11import React from "react" ;
2- import Login from "./Login" ;
2+ import Login , { LoginProps } from "./Login" ;
33
44export type CustomProvider = {
55 id : string ;
@@ -18,12 +18,9 @@ export type LoginProviderProps = {
1818 label ?: ( name : string ) => string ;
1919} ;
2020
21- type LoginProps = {
22- postLoginRedirect ?: string ;
23- label ?: ( name : string ) => string ;
24- } ;
21+ type LoginWrapperProps = Pick < LoginProps , "postLoginRedirect" | "label" > ;
2522
26- const AzureADLogin = ( { postLoginRedirect, label } : LoginProps ) => (
23+ const AzureADLogin = ( { postLoginRedirect, label } : LoginWrapperProps ) => (
2724 < Login
2825 name = "Azure AD"
2926 id = "aad"
@@ -32,7 +29,7 @@ const AzureADLogin = ({ postLoginRedirect, label }: LoginProps) => (
3229 key = "aad"
3330 />
3431) ;
35- const FacebookLogin = ( { postLoginRedirect, label } : LoginProps ) => (
32+ const FacebookLogin = ( { postLoginRedirect, label } : LoginWrapperProps ) => (
3633 < Login
3734 name = "Facebook"
3835 id = "facebook"
@@ -41,7 +38,7 @@ const FacebookLogin = ({ postLoginRedirect, label }: LoginProps) => (
4138 key = "facebook"
4239 />
4340) ;
44- const TwitterLogin = ( { postLoginRedirect, label } : LoginProps ) => (
41+ const TwitterLogin = ( { postLoginRedirect, label } : LoginWrapperProps ) => (
4542 < Login
4643 name = "Twitter"
4744 id = "twitter"
@@ -50,7 +47,7 @@ const TwitterLogin = ({ postLoginRedirect, label }: LoginProps) => (
5047 key = "twitter"
5148 />
5249) ;
53- const GitHubLogin = ( { postLoginRedirect, label } : LoginProps ) => (
50+ const GitHubLogin = ( { postLoginRedirect, label } : LoginWrapperProps ) => (
5451 < Login
5552 name = "GitHub"
5653 id = "github"
@@ -59,7 +56,7 @@ const GitHubLogin = ({ postLoginRedirect, label }: LoginProps) => (
5956 key = "github"
6057 />
6158) ;
62- const GoogleLogin = ( { postLoginRedirect, label } : LoginProps ) => (
59+ const GoogleLogin = ( { postLoginRedirect, label } : LoginWrapperProps ) => (
6360 < Login
6461 name = "Google"
6562 id = "google"
@@ -68,7 +65,7 @@ const GoogleLogin = ({ postLoginRedirect, label }: LoginProps) => (
6865 key = "google"
6966 />
7067) ;
71- const AppleLogin = ( { postLoginRedirect, label } : LoginProps ) => (
68+ const AppleLogin = ( { postLoginRedirect, label } : LoginWrapperProps ) => (
7269 < Login
7370 name = "Apple"
7471 id = "apple"
@@ -83,7 +80,7 @@ const CustomProviderLogin = ({
8380 id,
8481 name,
8582 label,
86- } : LoginProps & CustomProvider ) => (
83+ } : LoginWrapperProps & CustomProvider ) => (
8784 < Login
8885 name = { name || id }
8986 id = { id }
0 commit comments