-
Notifications
You must be signed in to change notification settings - Fork 868
feat(web,renderer-app,flat-component): add agora sso #1341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
BlackHole1
merged 11 commits into
netless-io:main
from
Matrixbirds:feat_support_agora_sso_login
Jan 28, 2022
Merged
Changes from 8 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
abf9134
refactor(web,electron,component): login-panel
Matrixbirds 8500f28
Merge remote-tracking branch 'origin/main' into feat_support_agora_ss…
Matrixbirds 21cf170
chore(scripts): remove force refresh cache
Matrixbirds 1606484
fix(renderer-app,web): code format and add button stories & refactor …
Matrixbirds 456a998
Update packages/flat-components/src/components/LoginPage/LoginPanel.s…
Matrixbirds 2325cb2
Update packages/flat-components/src/components/LoginPage/LoginContent…
Matrixbirds 3803f01
Update packages/flat-components/src/components/LoginPage/LoginContent…
Matrixbirds 4864d50
refactor(web): doLogin
Matrixbirds c215bf6
fix(web): add dom iterable for tsconfig
Matrixbirds 7a09ad8
fix(component): add newline
Matrixbirds 6942ec6
feat(web): add comment to customize hook
Matrixbirds File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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
27 changes: 27 additions & 0 deletions
27
packages/flat-components/src/components/LoginPage/LoginButton/LoginButton.stories.tsx
This file contains hidden or 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,27 @@ | ||
| import { Meta, Story } from "@storybook/react"; | ||
| import React from "react"; | ||
| import { useTranslation } from "react-i18next"; | ||
| import { LoginButton, LoginButtonProviderType, LoginButtonProps } from ".."; | ||
| import { message } from "antd"; | ||
|
|
||
| const storyMeta: Meta = { | ||
| title: "LoginPage/LoginButton", | ||
| component: LoginButton, | ||
| }; | ||
|
|
||
| export default storyMeta; | ||
|
|
||
| export const Overview: Story<LoginButtonProps> = () => { | ||
| const { i18n } = useTranslation(); | ||
|
|
||
| const handleLogin = (type: LoginButtonProviderType): void => { | ||
| void message.info(type); | ||
| }; | ||
|
|
||
| return ( | ||
| <> | ||
| <LoginButton provider="wechat" text={i18n.t("login-wechat")} onLogin={handleLogin} /> | ||
| <LoginButton provider="github" text={i18n.t("login-github")} onLogin={handleLogin} /> | ||
| </> | ||
| ); | ||
| }; |
1 change: 1 addition & 0 deletions
1
packages/flat-components/src/components/LoginPage/LoginButton/icons/agora.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
This file contains hidden or 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
32 changes: 32 additions & 0 deletions
32
packages/flat-components/src/components/LoginPage/LoginButton/index.tsx
This file contains hidden or 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,32 @@ | ||
| import { Button } from "antd"; | ||
| import React from "react"; | ||
| import wechatSVG from "./icons/wechat.svg"; | ||
| import agoraSVG from "./icons/agora.svg"; | ||
| import githubSVG from "./icons/github.svg"; | ||
| import "./index.less"; | ||
|
|
||
| export type LoginButtonProviderType = "wechat" | "github" | "agora"; | ||
|
|
||
| export type LoginButtonProps = { | ||
| provider: LoginButtonProviderType; | ||
| onLogin: (type: LoginButtonProviderType) => void; | ||
| text: string; | ||
| }; | ||
|
|
||
| const svgDict: Record<LoginButtonProviderType, string> = { | ||
| wechat: wechatSVG, | ||
| agora: agoraSVG, | ||
| github: githubSVG, | ||
| }; | ||
|
|
||
| export const LoginButton: React.FC<LoginButtonProps> = ({ provider, onLogin, text }) => { | ||
| return ( | ||
| <Button | ||
| className={`login-channel-lg login-channel-${provider}`} | ||
| onClick={() => onLogin(provider)} | ||
| > | ||
| <img src={svgDict[provider]} /> | ||
| {text} | ||
| </Button> | ||
| ); | ||
| }; |
17 changes: 0 additions & 17 deletions
17
packages/flat-components/src/components/LoginPage/LoginChannel/LoginChannel.stories.tsx
This file was deleted.
Oops, something went wrong.
29 changes: 0 additions & 29 deletions
29
packages/flat-components/src/components/LoginPage/LoginChannel/index.tsx
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
File renamed without changes
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.