Commit fb55871c authored by Viacheslav Pavlov's avatar Viacheslav Pavlov
Browse files

Merge branch '82-footer-with-links' into 'master'

Resolve "Footer with links"

Closes #82

See merge request genesys-pgr/genesys-ui!85
parents 1e5fc01b 77c897f5
...@@ -93,7 +93,7 @@ class BrowsePage extends React.Component<IBrowsePageProps, any> { ...@@ -93,7 +93,7 @@ class BrowsePage extends React.Component<IBrowsePageProps, any> {
const hasLatLon = accession && accession.geo && accession.geo.latitude !== null && accession.geo.longitude !== null; const hasLatLon = accession && accession.geo && accession.geo.latitude !== null && accession.geo.longitude !== null;
return ( return (
<PageLayout> <PageLayout withFooter>
<ScrollToTopOnMount /> <ScrollToTopOnMount />
<ContentHeader title="Accession details" subtitle="Passport data and everything else" /> <ContentHeader title="Accession details" subtitle="Passport data and everything else" />
......
...@@ -80,7 +80,7 @@ class BrowsePage extends React.Component<IMapPageProps, any> { ...@@ -80,7 +80,7 @@ class BrowsePage extends React.Component<IMapPageProps, any> {
const layerUrl = `{s}/acn/tile/{z}/{x}/{y}?f=${filterCode ? filterCode : ''}`; // `&color=${color}`; const layerUrl = `{s}/acn/tile/{z}/{x}/{y}?f=${filterCode ? filterCode : ''}`; // `&color=${color}`;
return ( return (
<PageLayout> <PageLayout withFooter>
<ContentHeader title="Accession map" subTitle="Explore accession localities"/> <ContentHeader title="Accession map" subTitle="Explore accession localities"/>
<Tabs <Tabs
tab={ currentTab } tab={ currentTab }
......
...@@ -127,6 +127,7 @@ class BrowsePage extends React.Component<IOverviewPageProps, any> { ...@@ -127,6 +127,7 @@ class BrowsePage extends React.Component<IOverviewPageProps, any> {
sidebar={ sidebar={
<AccessionFilters initialValues={ overviewWrapper && overviewWrapper.filter || {} } onSubmit={ applyOverviewFilters }/> <AccessionFilters initialValues={ overviewWrapper && overviewWrapper.filter || {} } onSubmit={ applyOverviewFilters }/>
} }
withFooter
> >
<ContentHeader title="Accession browser" subTitle="Explore curated sets of accessions" /> <ContentHeader title="Accession browser" subTitle="Explore curated sets of accessions" />
<Tabs <Tabs
......
...@@ -31,7 +31,7 @@ class ContentPage extends React.Component<IContentPageProps> { ...@@ -31,7 +31,7 @@ class ContentPage extends React.Component<IContentPageProps> {
const { menuItem, slug, i18n } = this.props; const { menuItem, slug, i18n } = this.props;
CmsService.getMenu(menuItem).then((menu) => this.setState({menu})); CmsService.getMenu(menuItem).then((menu) => this.setState({menu}));
CmsService.getArticleBySlugAndLang(slug, i18n.language).then((article) => this.setState({article})); CmsService.getArticleBySlugAndLang(i18n.language, slug).then((article) => this.setState({article}));
} }
public componentWillReceiveProps(nextProps) { public componentWillReceiveProps(nextProps) {
const {menuItem: oldMenu} = this.props; const {menuItem: oldMenu} = this.props;
...@@ -41,7 +41,7 @@ class ContentPage extends React.Component<IContentPageProps> { ...@@ -41,7 +41,7 @@ class ContentPage extends React.Component<IContentPageProps> {
CmsService.getMenu(menuItem).then((menu) => this.setState({menu})); CmsService.getMenu(menuItem).then((menu) => this.setState({menu}));
} }
CmsService.getArticleBySlugAndLang(slug, i18n.language).then((article) => this.setState({article})); CmsService.getArticleBySlugAndLang(i18n.language, slug).then((article) => this.setState({article}));
} }
...@@ -49,7 +49,7 @@ class ContentPage extends React.Component<IContentPageProps> { ...@@ -49,7 +49,7 @@ class ContentPage extends React.Component<IContentPageProps> {
const { t } = this.props; const { t } = this.props;
const {article, menu} = this.state; const {article, menu} = this.state;
return ( return (
<PageLayout> <PageLayout withFooter>
{ article && { article &&
<Grid container> <Grid container>
<ContentHeader title={ article.title } /> <ContentHeader title={ article.title } />
......
...@@ -41,7 +41,7 @@ class DisplayPage extends React.Component<IDisplayPageProps, any> { ...@@ -41,7 +41,7 @@ class DisplayPage extends React.Component<IDisplayPageProps, any> {
const { crop } = this.state; const { crop } = this.state;
return !crop ? null : ( return !crop ? null : (
<PageLayout> <PageLayout withFooter>
<ContentHeader title="Crop details"/> <ContentHeader title="Crop details"/>
<PageContents> <PageContents>
<CropCard crop={ crop }/> <CropCard crop={ crop }/>
......
...@@ -96,7 +96,7 @@ class DisplayPage extends React.Component<IDisplayPageProps, any> { ...@@ -96,7 +96,7 @@ class DisplayPage extends React.Component<IDisplayPageProps, any> {
} }
return ( return (
<PageLayout> <PageLayout withFooter>
<ScrollToTopOnMount /> <ScrollToTopOnMount />
<ContentHeader title="Institute details" subtitle="smt" /> <ContentHeader title="Institute details" subtitle="smt" />
......
...@@ -26,7 +26,7 @@ const styles = (theme) => ({ ...@@ -26,7 +26,7 @@ const styles = (theme) => ({
display: 'flex' as 'flex', display: 'flex' as 'flex',
minHeight: 'calc(100vh - 72px)', minHeight: 'calc(100vh - 72px)',
flexDirection: 'column' as 'column', flexDirection: 'column' as 'column',
// flexBasis: '70%', maxWidth: '100%',
}, },
children: { children: {
flexGrow: 1, flexGrow: 1,
...@@ -60,9 +60,10 @@ interface ILayoutProps extends React.Props<any> { ...@@ -60,9 +60,10 @@ interface ILayoutProps extends React.Props<any> {
classes?: any; classes?: any;
children?: any; children?: any;
sidebar?: any; sidebar?: any;
withFooter?: any;
} }
const Layout = ({classes, children = null, sidebar = null}: ILayoutProps) => ( const Layout = ({classes, children = null, sidebar = null, withFooter = false}: ILayoutProps) => (
<div> <div>
<Header /> <Header />
<div className={ classes.root }> <div className={ classes.root }>
...@@ -73,7 +74,7 @@ const Layout = ({classes, children = null, sidebar = null}: ILayoutProps) => ( ...@@ -73,7 +74,7 @@ const Layout = ({classes, children = null, sidebar = null}: ILayoutProps) => (
{ children } { children }
</div> </div>
<div className={ classes.footer }> <div className={ classes.footer }>
<Footer /> { withFooter && <Footer /> }
</div> </div>
</div> </div>
) } ) }
......
...@@ -272,7 +272,7 @@ class WelcomePage extends React.Component<any, any> { ...@@ -272,7 +272,7 @@ class WelcomePage extends React.Component<any, any> {
}; };
return ( return (
<PageLayout classes={ {root: classes.root } }> <PageLayout classes={ {root: classes.root } } withFooter>
<ContentHeader title={ t('Genesys PGR') } /> <ContentHeader title={ t('Genesys PGR') } />
<Grid container spacing={ 0 } className={ classes.background }> <Grid container spacing={ 0 } className={ classes.background }>
<div className={ classes.backgroundImageWrapper }> <div className={ classes.backgroundImageWrapper }>
......
...@@ -68,7 +68,7 @@ class LoginContainer extends React.Component<ILoginContainerProps, void> { ...@@ -68,7 +68,7 @@ class LoginContainer extends React.Component<ILoginContainerProps, void> {
public render() { public render() {
return ( return (
<PageLayout> <PageLayout withFooter>
<ContentHeader title="Welcome to Genesys" subTitle="Log in to manage datasets" /> <ContentHeader title="Welcome to Genesys" subTitle="Log in to manage datasets" />
<Grid container spacing={ 0 } justify="center" className="back-gray p-20"> <Grid container spacing={ 0 } justify="center" className="back-gray p-20">
<Grid item xs={ 12 } md={ 5 } lg={ 4 } xl={ 3 }> <Grid item xs={ 12 } md={ 5 } lg={ 4 } xl={ 3 }>
......
...@@ -45,7 +45,7 @@ class LoginContainer extends React.Component<ILoginContainerProps> { ...@@ -45,7 +45,7 @@ class LoginContainer extends React.Component<ILoginContainerProps> {
const { errorMsg } = this.state; const { errorMsg } = this.state;
const { captchaClientKey } = this.props; const { captchaClientKey } = this.props;
return ( return (
<PageLayout> <PageLayout withFooter>
<ContentHeader title="Create your account"/> <ContentHeader title="Create your account"/>
<Grid container spacing={ 0 } justify="center" className="back-gray p-20"> <Grid container spacing={ 0 } justify="center" className="back-gray p-20">
<Grid item xs={ 12 } md={ 5 } lg={ 4 } xl={ 3 }> <Grid item xs={ 12 } md={ 5 } lg={ 4 } xl={ 3 }>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment