mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-22 14:47:56 +01:00
Fix jslint
This commit is contained in:
parent
8c7b2c810b
commit
2692f58aad
@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { StyledCanvas } from './styled';
|
import { StyledCanvas } from './styled';
|
||||||
|
|
||||||
const Canvas = () => (
|
const Canvas = (): React.ReactElement => (
|
||||||
<StyledCanvas>canvas</StyledCanvas>
|
<StyledCanvas>canvas</StyledCanvas>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { StyledFooter } from './styled';
|
import { StyledFooter } from './styled';
|
||||||
|
|
||||||
const Footer = () => (
|
const Footer = (): React.ReactElement => (
|
||||||
<StyledFooter>footer</StyledFooter>
|
<StyledFooter>footer</StyledFooter>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ import TopBar from '../top-bar';
|
|||||||
import Canvas from '../canvas';
|
import Canvas from '../canvas';
|
||||||
import { StyledFrame } from './styled';
|
import { StyledFrame } from './styled';
|
||||||
|
|
||||||
const Frame = () => (
|
const Frame = (): React.ReactElement => (
|
||||||
<StyledFrame>
|
<StyledFrame>
|
||||||
<TopBar />
|
<TopBar />
|
||||||
<Canvas />
|
<Canvas />
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { StyledTopBar } from './styled'
|
import { StyledTopBar } from './styled'
|
||||||
|
|
||||||
const TopBar = () => (
|
const TopBar = ():React.ReactElement => (
|
||||||
<StyledTopBar>top bar</StyledTopBar>
|
<StyledTopBar>top bar</StyledTopBar>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
const unit = 4; // pixels
|
const unit = 4; // pixels
|
||||||
|
|
||||||
export const XS = '4px';
|
export const XS = '4px';
|
||||||
@ -6,4 +7,4 @@ export const M = '16px';
|
|||||||
export const L = '24px';
|
export const L = '24px';
|
||||||
export const XL = '24px';
|
export const XL = '24px';
|
||||||
|
|
||||||
export const times = (n: number) => `${unit * n}px`;
|
export const times = (n: number):string => `${unit * n}px`;
|
||||||
|
@ -11,24 +11,18 @@ interface HeaderProps {
|
|||||||
type: 'only-signup' | 'only-signin' | 'none';
|
type: 'only-signup' | 'only-signin' | 'none';
|
||||||
}
|
}
|
||||||
|
|
||||||
class Header extends React.Component<HeaderProps, HeaderProps> {
|
export const Header = ({ type }: HeaderProps): React.ReactElement => {
|
||||||
constructor(props: HeaderProps) {
|
|
||||||
super(props);
|
|
||||||
this.state = { type: props.type };
|
|
||||||
}
|
|
||||||
render(): React.ReactElement {
|
|
||||||
let signUpButton;
|
|
||||||
let signInButton;
|
|
||||||
let text;
|
|
||||||
|
|
||||||
const pageType = this.state.type;
|
let signUpButton;
|
||||||
if (pageType === 'only-signup') {
|
let text;
|
||||||
|
let signInButton;
|
||||||
|
if (type === 'only-signup') {
|
||||||
text = <span className="header-area-content-span"><span><FormattedMessage id="header.donthaveaccount" defaultMessage="Don't have an account ?" /></span></span>;
|
text = <span className="header-area-content-span"><span><FormattedMessage id="header.donthaveaccount" defaultMessage="Don't have an account ?" /></span></span>;
|
||||||
signUpButton = <SignUpButton className="header-area-right2" />;
|
signUpButton = <SignUpButton className="header-area-right2" />;
|
||||||
} else if (pageType === 'only-signin') {
|
} else if (type === 'only-signin') {
|
||||||
text = <span className="header-area-content-span"><span><FormattedMessage id="header.haveaccount" defaultMessage="Already have an account?" /></span></span>;
|
text = <span className="header-area-content-span"><span><FormattedMessage id="header.haveaccount" defaultMessage="Already have an account?" /></span></span>;
|
||||||
signUpButton = <SignInButton className="header-area-right2" />;
|
signUpButton = <SignInButton className="header-area-right2" />;
|
||||||
} else if (pageType === 'none') {
|
} else if (type === 'none') {
|
||||||
text = '';
|
text = '';
|
||||||
signUpButton = '';
|
signUpButton = '';
|
||||||
} else {
|
} else {
|
||||||
@ -46,14 +40,14 @@ class Header extends React.Component<HeaderProps, HeaderProps> {
|
|||||||
</StyledDiv>
|
</StyledDiv>
|
||||||
</StyledNav>
|
</StyledNav>
|
||||||
)
|
)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
interface ButtonProps {
|
interface ButtonProps {
|
||||||
className?: string;
|
className?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const SignInButton = (props: ButtonProps): React.ReactElement => {
|
export const SignInButton = (props: ButtonProps): React.ReactElement => {
|
||||||
return (
|
return (
|
||||||
<span className={`${props.className}`}>
|
<span className={`${props.className}`}>
|
||||||
<Button color="primary" size="medium" variant="outlined" component={Link} to="/c/login"><FormattedMessage id="login.signin" defaultMessage="Sign In" /></Button>
|
<Button color="primary" size="medium" variant="outlined" component={Link} to="/c/login"><FormattedMessage id="login.signin" defaultMessage="Sign In" /></Button>
|
||||||
@ -67,5 +61,4 @@ const SignUpButton = (props: ButtonProps): React.ReactElement => {
|
|||||||
</span>);
|
</span>);
|
||||||
}
|
}
|
||||||
|
|
||||||
export { SignInButton, SignUpButton };
|
|
||||||
export default Header;
|
export default Header;
|
||||||
|
Loading…
Reference in New Issue
Block a user