-
-
Notifications
You must be signed in to change notification settings - Fork 654
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hide sign in buttons when it's not enabled
- Loading branch information
Showing
10 changed files
with
79 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import * as React from "react"; | ||
import { get } from "../storage"; | ||
import { SocialSignInButton } from "./SocialSignInButton"; | ||
|
||
interface AuthSettings { | ||
endpoint: string; | ||
providers: { | ||
google: boolean, | ||
facebook: boolean | ||
}; | ||
} | ||
|
||
interface SocialSignInListProps { | ||
size: "small" | "normal"; | ||
orientation: "horizontal" | "vertical"; | ||
} | ||
|
||
export const SocialSignInList = (props: SocialSignInListProps) => { | ||
const settings = get<AuthSettings>("auth"); | ||
const cssClasses = props.orientation === "horizontal" ? "horizontal divided" : ""; | ||
|
||
const google = settings.providers.google && | ||
<div className="item"> | ||
<SocialSignInButton provider="google" size={props.size} /> | ||
</div>; | ||
const facebook = settings.providers.facebook && | ||
<div className="item"> | ||
<SocialSignInButton provider="facebook" size={props.size} /> | ||
</div>; | ||
|
||
const noAuth = !facebook && !google && | ||
<div className="item"> | ||
<div className="ui tertiary inverted red segment"> | ||
There are no authentication methods enabled. | ||
</div> | ||
</div>; | ||
|
||
return <div className={`ui list ${cssClasses}`}> | ||
{ facebook } | ||
{ google } | ||
{ noAuth } | ||
</div>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,10 +14,6 @@ | |
margin-top: 50px; | ||
} | ||
|
||
.right { | ||
text-align: right; | ||
} | ||
|
||
.idea-header { | ||
margin-left: 20px; | ||
} | ||
|