generated from arvinxx/monorepo-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
150 additions
and
67 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/** | ||
* compact: true | ||
*/ | ||
import React, { useEffect, useState } from 'react'; | ||
|
||
import { Flexbox } from '@arvinxu/layout-kit'; | ||
import UserPanel from '@arvinxu/user-panel'; | ||
import { Switch } from 'antd'; | ||
import { getI18n } from 'react-i18next'; | ||
|
||
const LoginWithLogo = () => { | ||
const [locale, setLocale] = useState('zh-CN'); | ||
|
||
useEffect(() => { | ||
getI18n().changeLanguage(locale); | ||
}, [locale]); | ||
|
||
return ( | ||
<div | ||
style={{ | ||
background: '#e8e8e8', | ||
display: 'flex', | ||
justifyContent: 'center', | ||
padding: 24, | ||
}} | ||
> | ||
<Flexbox gap={8} align={'center'}> | ||
<Flexbox horizontal> | ||
<Switch | ||
checked={locale === 'en-US'} | ||
unCheckedChildren={'中文'} | ||
checkedChildren={'英文'} | ||
onChange={(checked) => { | ||
setLocale(checked ? 'en-US' : 'zh-CN'); | ||
}} | ||
/> | ||
</Flexbox> | ||
<UserPanel.Login | ||
logo={'https://gw.alipayobjects.com/zos/antfincdn/LFmaI3%26OJh/logo.svg'} | ||
showFooter | ||
onWechatLoginClick={() => {}} | ||
onCaptchaClick={async () => { | ||
return true; | ||
}} | ||
/> | ||
</Flexbox> | ||
</div> | ||
); | ||
}; | ||
|
||
export default LoginWithLogo; |
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
title: UserPanel.Login 登录面板 | ||
group: | ||
path: / | ||
nav: | ||
path: /biz-components | ||
--- | ||
|
||
# UserPanel.Login 登录面板 | ||
|
||
[![NPM version][version-image]][version-url] [![NPM downloads][download-image]][download-url] | ||
|
||
用户登录面板 | ||
|
||
[version-image]: http://img.shields.io/npm/v/@arvinxu/user-panel.svg?color=deepgreen&label=latest | ||
[version-url]: http://npmjs.org/package/@arvinxu/user-panel | ||
[download-image]: https://img.shields.io/npm/dm/@arvinxu/user-panel.svg | ||
[download-url]: https://github.com/arvinxx/components/tree/master/packages/user-panel | ||
|
||
## 登录面板 | ||
|
||
<code src='../demos/Login.tsx' /> | ||
|
||
### 带 Logo | ||
|
||
<code src='../demos/LoginWithLogo.tsx' /> | ||
|
||
### 显示忘记密码 | ||
|
||
填入 忘记密码所在 url 或者实现方法 | ||
|
||
<code src='../demos/LoginWithForgotUrl.tsx' /> | ||
|
||
### 显示底部 | ||
|
||
如果需要显示微信登录按钮, 需要实现 `onWechatLoginClick` 方法. 否则默认不显示 | ||
|
||
### 国际化 | ||
|
||
支持通过 `react-i18next` 模块实现国际化文案 | ||
|
||
<code src='../demos/LoginI18n.tsx' /> | ||
|
||
<API src='./UserLogin.tsx'></API> |
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,22 @@ | ||
--- | ||
title: UserPanel.Register 注册面板 | ||
group: | ||
path: / | ||
nav: | ||
path: /biz-components | ||
--- | ||
|
||
# UserPanel.Register 注册 | ||
|
||
[![NPM version][version-image]][version-url] [![NPM downloads][download-image]][download-url] | ||
|
||
用户登录注册集成面板 | ||
|
||
[version-image]: http://img.shields.io/npm/v/@arvinxu/user-panel.svg?color=deepgreen&label=latest | ||
[version-url]: http://npmjs.org/package/@arvinxu/user-panel | ||
[download-image]: https://img.shields.io/npm/dm/@arvinxu/user-panel.svg | ||
[download-url]: https://github.com/arvinxx/components/tree/master/packages/user-panel | ||
|
||
## 注册面板 | ||
|
||
TODO |
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