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
127 additions
and
64 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import React from 'react'; | ||
import type { FC } from 'react'; | ||
import type { LayoutProps } from './layout'; | ||
import type { LoginParamsType } from './type'; | ||
import Layout from './layout'; | ||
import Login from './login'; | ||
|
||
export interface UserLoginProps extends Omit<LayoutProps, 'type'> { | ||
/** | ||
* 获取校验码方法 | ||
*/ | ||
onClickCaptcha?: (mobile: string) => Promise<boolean>; | ||
/** | ||
* 登录方法 | ||
*/ | ||
onLoginSubmit?: (values: LoginParamsType) => Promise<void>; | ||
} | ||
|
||
const UserLogin: FC<UserLoginProps> = ({ | ||
onClickCaptcha, | ||
onLoginSubmit, | ||
logo, | ||
logoUrl, | ||
wechatLogin, | ||
showFooter, | ||
}) => { | ||
return ( | ||
<Layout | ||
logoUrl={logoUrl} | ||
logo={logo} | ||
showFooter={showFooter} | ||
wechatLogin={wechatLogin} | ||
type={'login'} | ||
> | ||
<Login onClickCaptcha={onClickCaptcha} handleSubmit={onLoginSubmit} /> | ||
</Layout> | ||
); | ||
}; | ||
|
||
export default UserLogin; |
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,7 @@ | ||
import UserLogin from './UserLogin'; | ||
|
||
const UserPanel = { | ||
Login: UserLogin, | ||
}; | ||
|
||
export default UserPanel; |
This file was deleted.
Oops, something went wrong.
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,49 @@ | ||
import React from 'react'; | ||
import type { FC } from 'react'; | ||
import { IntlWrapper, Header, Footer } from '../components'; | ||
import './style.less'; | ||
import type { PanelContentType } from '../type'; | ||
|
||
export interface LayoutProps { | ||
/** | ||
* 微信登录方法 | ||
*/ | ||
wechatLogin?: () => void; | ||
/** | ||
* logo 链接 | ||
*/ | ||
logo?: string; | ||
/** | ||
* 点击 logo 跳转的 URL | ||
*/ | ||
logoUrl?: string; | ||
/** | ||
* 显示底部 | ||
*/ | ||
showFooter?: boolean; | ||
/** | ||
* 内容类型 | ||
*/ | ||
type: PanelContentType; | ||
} | ||
|
||
const Layout: FC<LayoutProps> = ({ | ||
logo, | ||
logoUrl, | ||
wechatLogin, | ||
children, | ||
showFooter, | ||
type, | ||
}) => { | ||
return ( | ||
<IntlWrapper> | ||
<div className="avx-user-panel-container"> | ||
<Header type={type} logo={logo} url={logoUrl} /> | ||
{children} | ||
{showFooter ? <Footer type={type} wechatLogin={wechatLogin} /> : null} | ||
</div> | ||
</IntlWrapper> | ||
); | ||
}; | ||
|
||
export default Layout; |
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