| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent c92e603 commit 83debda
70 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,10 +3,10 @@ import { FunctionComponent, HTMLProps, ReactNode } from 'react'; | |||
| 3 | 3 | export interface FormHelperTextProps extends HTMLProps<HTMLDivElement> { | |
| 4 | 4 | children?: ReactNode; | |
| 5 | 5 | isError?: boolean; | |
| 6 | - isActive?: boolean; | ||
| 6 | + isHidden?: boolean; | ||
| 7 | 7 | className?: string; | |
| 8 | 8 | } | |
| 9 | 9 | ||
| 10 | 10 | declare const FormHelperText: FunctionComponent<FormHelperTextProps>; | |
| 11 | 11 | ||
| 12 | - export default FormHelperText; | ||
| 12 | + export default FormHelperText; | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,4 @@ | |||
| 1 | - import React from 'react'; | ||
| 1 | + import * as React from 'react'; | ||
| 2 | 2 | import { shallow } from 'enzyme'; | |
| 3 | 3 | import Login from './Login'; | |
| 4 | 4 | import LoginFooter from './LoginFooter'; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,29 +1,25 @@ | |||
| 1 | - import React from 'react'; | ||
| 1 | + import * as React from 'react'; | ||
| 2 | 2 | import styles from '@patternfly/patternfly/components/Login/login.css'; | |
| 3 | 3 | import { css } from '@patternfly/react-styles'; | |
| 4 | - import PropTypes from 'prop-types'; | ||
| 5 | 4 | ||
| 6 | - const propTypes = { | ||
| 5 | + export interface LoginProps extends React.HTMLProps<HTMLDivElement> { | ||
| 7 | 6 | /** Content rendered inside the main section of the login layout */ | |
| 8 | - children: PropTypes.node, | ||
| 7 | + children?: React.ReactNode; | ||
| 9 | 8 | /** Additional classes added to the login layout */ | |
| 10 | - className: PropTypes.string, | ||
| 9 | + className?: string; | ||
| 11 | 10 | /** Footer component (e.g. <LoginFooter />) */ | |
| 12 | - footer: PropTypes.node, | ||
| 11 | + footer?: React.ReactNode; | ||
| 13 | 12 | /** Header component (e.g. <LoginHeader />) */ | |
| 14 | - header: PropTypes.node, | ||
| 15 | - /** Additional props are spread to the container <div> */ | ||
| 16 | - '': PropTypes.any | ||
| 17 | - }; | ||
| 13 | + header?: React.ReactNode; | ||
| 14 | + } | ||
| 18 | 15 | ||
| 19 | - const defaultProps = { | ||
| 20 | - children: null, | ||
| 21 | - className: '', | ||
| 22 | - footer: null, | ||
| 23 | - header: null | ||
| 24 | - }; | ||
| 25 | - | ||
| 26 | - const Login = ({ className, children, footer, header, ...props }) => ( | ||
| 16 | + export const Login: React.FunctionComponent<LoginProps> = ({ | ||
| 17 | + className = '', | ||
| 18 | + children = null, | ||
| 19 | + footer = null, | ||
| 20 | + header = null, | ||
| 21 | + ...props | ||
| 22 | + }) => ( | ||
| 27 | 23 | <div {...props} className={css(styles.login, className)}> | |
| 28 | 24 | <div className={css(styles.loginContainer)}> | |
| 29 | 25 | {header} | |
@@ -33,7 +29,4 @@ const Login = ({ className, children, footer, header, ...props }) => ( | |||
| 33 | 29 | </div> | |
| 34 | 30 | ); | |
| 35 | 31 | ||
| 36 | - Login.propTypes = propTypes; | ||
| 37 | - Login.defaultProps = defaultProps; | ||
| 38 | - | ||
| 39 | 32 | export default Login; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,22 @@ | |||
| 1 | + import * as React from 'react'; | ||
| 2 | + import styles from '@patternfly/patternfly/components/Login/login.css'; | ||
| 3 | + import { css } from '@patternfly/react-styles'; | ||
| 4 | + | ||
| 5 | + export interface LoginFooterProps extends React.HTMLProps<HTMLElement> { | ||
| 6 | + /** Content rendered inside the footer of the login layout */ | ||
| 7 | + children?: React.ReactNode; | ||
| 8 | + /** Additional props are spread to the container <footer> */ | ||
| 9 | + className?: string; | ||
| 10 | + } | ||
| 11 | + | ||
| 12 | + export const LoginFooter: React.FunctionComponent<LoginFooterProps> = ({ | ||
| 13 | + className = '', | ||
| 14 | + children = null, | ||
| 15 | + ...props | ||
| 16 | + }) => ( | ||
| 17 | + <footer className={css(styles.loginFooter, className)} {...props}> | ||
| 18 | + {children} | ||
| 19 | + </footer> | ||
| 20 | + ); | ||
| 21 | + | ||
| 22 | + export default LoginFooter; | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,4 @@ | |||
| 1 | - import React from 'react'; | ||
| 1 | + import * as React from 'react'; | ||
| 2 | 2 | import LoginFooterItem from './LoginFooterItem'; | |
| 3 | 3 | import { shallow } from 'enzyme'; | |
| 4 | 4 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments