Commit 140d3c54 authored by Viacheslav Pavlov's avatar Viacheslav Pavlov Committed by Matija Obreza
Browse files

some layout fixes

parent 21c81c36
import * as React from 'react'; import * as React from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { bindActionCreators } from 'redux'; import { bindActionCreators } from 'redux';
import withStyles from '@material-ui/core/styles/withStyles';
import { parse } from 'query-string'; import { parse } from 'query-string';
...@@ -25,10 +24,6 @@ import BrowsePageTemplate from 'ui/pages/_base/BrowsePage'; ...@@ -25,10 +24,6 @@ import BrowsePageTemplate from 'ui/pages/_base/BrowsePage';
import Page from 'model/Page'; import Page from 'model/Page';
import { translate } from 'react-i18next'; import { translate } from 'react-i18next';
const style = (theme) => ({
container: theme.container.spacingHorizontal,
});
class BrowsePage extends BrowsePageTemplate<Dataset> { class BrowsePage extends BrowsePageTemplate<Dataset> {
public static needs = [ public static needs = [
...@@ -41,7 +36,7 @@ class BrowsePage extends BrowsePageTemplate<Dataset> { ...@@ -41,7 +36,7 @@ class BrowsePage extends BrowsePageTemplate<Dataset> {
protected renderDataset = (d: Dataset) => <DatasetCard dataset={ d } key={ d.uuid }/>; protected renderDataset = (d: Dataset) => <DatasetCard dataset={ d } key={ d.uuid }/>;
public render() { public render() {
const { paged, t, loadMoreData, classes } = this.props; const { paged, t, loadMoreData } = this.props;
const stillLoading: boolean = (!paged || !paged.content); const stillLoading: boolean = (!paged || !paged.content);
...@@ -63,7 +58,7 @@ class BrowsePage extends BrowsePageTemplate<Dataset> { ...@@ -63,7 +58,7 @@ class BrowsePage extends BrowsePageTemplate<Dataset> {
filterObj={ paged && paged.filter || {} } filterObj={ paged && paged.filter || {} }
onSubmit={ this.myApplyFilters } onSubmit={ this.myApplyFilters }
/> />
<PageContents className={ classes.container }> <PageContents className="pt-1rem container-spacing-horizontal">
{ stillLoading ? <Loading/> : { stillLoading ? <Loading/> :
<PagedLoader <PagedLoader
paged={ paged } paged={ paged }
...@@ -91,4 +86,4 @@ const mapDispatchToProps = (dispatch) => bindActionCreators({ ...@@ -91,4 +86,4 @@ const mapDispatchToProps = (dispatch) => bindActionCreators({
updateRoute, updateRoute,
}, dispatch); }, dispatch);
export default withStyles(style)(translate()(connect(mapStateToProps, mapDispatchToProps)(BrowsePage))); export default translate()(connect(mapStateToProps, mapDispatchToProps)(BrowsePage));
...@@ -2,7 +2,6 @@ import * as React from 'react'; ...@@ -2,7 +2,6 @@ import * as React from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { bindActionCreators } from 'redux'; import { bindActionCreators } from 'redux';
import { translate } from 'react-i18next'; import { translate } from 'react-i18next';
import withStyles from '@material-ui/core/styles/withStyles';
import { parse } from 'query-string'; import { parse } from 'query-string';
...@@ -25,11 +24,6 @@ import ContentHeader from 'ui/common/heading/ContentHeader'; ...@@ -25,11 +24,6 @@ import ContentHeader from 'ui/common/heading/ContentHeader';
import BrowsePageTemplate from 'ui/pages/_base/BrowsePage'; import BrowsePageTemplate from 'ui/pages/_base/BrowsePage';
import Page from 'model/Page'; import Page from 'model/Page';
const style = (theme) => ({
container: theme.container.spacingHorizontal,
});
// Page to browse and filter descriptor lists // Page to browse and filter descriptor lists
class BrowsePage extends BrowsePageTemplate<DescriptorList> { class BrowsePage extends BrowsePageTemplate<DescriptorList> {
...@@ -45,7 +39,7 @@ class BrowsePage extends BrowsePageTemplate<DescriptorList> { ...@@ -45,7 +39,7 @@ class BrowsePage extends BrowsePageTemplate<DescriptorList> {
) )
public render() { public render() {
const { paged, t, loadMoreData, classes } = this.props; const { paged, t, loadMoreData } = this.props;
const stillLoading: boolean = (!paged || !paged.content); const stillLoading: boolean = (!paged || !paged.content);
...@@ -70,7 +64,7 @@ class BrowsePage extends BrowsePageTemplate<DescriptorList> { ...@@ -70,7 +64,7 @@ class BrowsePage extends BrowsePageTemplate<DescriptorList> {
filterObj={ paged && paged.filter || {} } filterObj={ paged && paged.filter || {} }
onSubmit={ this.myApplyFilters } onSubmit={ this.myApplyFilters }
/> />
<PageContents className={ classes.container }> <PageContents className="pt-1rem container-spacing-horizontal">
{ stillLoading ? <Loading/> : { stillLoading ? <Loading/> :
<PagedLoader <PagedLoader
paged={ paged } paged={ paged }
...@@ -98,4 +92,4 @@ const mapDispatchToProps = (dispatch) => bindActionCreators({ ...@@ -98,4 +92,4 @@ const mapDispatchToProps = (dispatch) => bindActionCreators({
updateRoute, updateRoute,
}, dispatch); }, dispatch);
export default withStyles(style)(translate()(connect(mapStateToProps, mapDispatchToProps)(BrowsePage))); export default translate()(connect(mapStateToProps, mapDispatchToProps)(BrowsePage));
import * as React from 'react'; import * as React from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { bindActionCreators } from 'redux'; import { bindActionCreators } from 'redux';
import { withStyles } from '@material-ui/core/styles';
import { translate } from 'react-i18next'; import { translate } from 'react-i18next';
import { parse } from 'query-string'; import { parse } from 'query-string';
...@@ -23,12 +22,6 @@ import ContentHeader from 'ui/common/heading/ContentHeader'; ...@@ -23,12 +22,6 @@ import ContentHeader from 'ui/common/heading/ContentHeader';
import BrowsePageTemplate from 'ui/pages/_base/BrowsePage'; import BrowsePageTemplate from 'ui/pages/_base/BrowsePage';
import Page from 'model/Page'; import Page from 'model/Page';
const styles = (theme) => ({
leftPanel: theme.leftPanel.root,
container: theme.container.spacingHorizontal,
});
class BrowsePage extends BrowsePageTemplate<Descriptor> { class BrowsePage extends BrowsePageTemplate<Descriptor> {
public static needs = [ public static needs = [
...@@ -39,7 +32,7 @@ class BrowsePage extends BrowsePageTemplate<Descriptor> { ...@@ -39,7 +32,7 @@ class BrowsePage extends BrowsePageTemplate<Descriptor> {
]; ];
public render() { public render() {
const { paged, t, loadMoreData, classes } = this.props; const { paged, t, loadMoreData } = this.props;
const stillLoading: boolean = (!paged || !paged.content); const stillLoading: boolean = (!paged || !paged.content);
...@@ -67,7 +60,7 @@ class BrowsePage extends BrowsePageTemplate<Descriptor> { ...@@ -67,7 +60,7 @@ class BrowsePage extends BrowsePageTemplate<Descriptor> {
filterObj={ paged && paged.filter || {} } filterObj={ paged && paged.filter || {} }
onSubmit={ this.myApplyFilters } onSubmit={ this.myApplyFilters }
/> />
<PageContents className={ classes.container }> <PageContents className="pt-1rem container-spacing-horizontal">
{ stillLoading ? <Loading/> : { stillLoading ? <Loading/> :
<PagedLoader <PagedLoader
paged={ paged } paged={ paged }
...@@ -98,4 +91,4 @@ const mapDispatchToProps = (dispatch) => bindActionCreators({ ...@@ -98,4 +91,4 @@ const mapDispatchToProps = (dispatch) => bindActionCreators({
export default translate()(connect( export default translate()(connect(
mapStateToProps, mapStateToProps,
mapDispatchToProps, mapDispatchToProps,
)((withStyles as any)(styles)(BrowsePage))); )(BrowsePage));
...@@ -81,7 +81,7 @@ class CountryDisplayPage extends React.Component<ICountryDisplayPageProps> { ...@@ -81,7 +81,7 @@ class CountryDisplayPage extends React.Component<ICountryDisplayPageProps> {
<ContentHeader title={ `${t('geo.public.p.countryList.countryProfile', { code: isoCode }) }` }/> <ContentHeader title={ `${t('geo.public.p.countryList.countryProfile', { code: isoCode }) }` }/>
<div> <div>
{ stillLoading ? <Loading /> : { stillLoading ? <Loading /> :
<PageContents className="pt1rem"> <PageContents className="pt-1rem">
<MainSection title={ `${details.name}` }> <MainSection title={ `${details.name}` }>
<Properties> <Properties>
<PropertiesItem title={ t('geo.public.p.countryList.moreInformation') }> <PropertiesItem title={ t('geo.public.p.countryList.moreInformation') }>
......
...@@ -21,11 +21,6 @@ import { ScrollToTopOnMount } from 'ui/common/page/scrollers'; ...@@ -21,11 +21,6 @@ import { ScrollToTopOnMount } from 'ui/common/page/scrollers';
import ContentHeader from 'ui/common/heading/ContentHeader'; import ContentHeader from 'ui/common/heading/ContentHeader';
import BrowsePageTemplate from 'ui/pages/_base/BrowsePage'; import BrowsePageTemplate from 'ui/pages/_base/BrowsePage';
import Page from 'model/Page'; import Page from 'model/Page';
import withStyles from '@material-ui/core/styles/withStyles';
const style = (theme) => ({
container: theme.container.spacingHorizontal,
});
class PartnerListPage extends BrowsePageTemplate<Partner> { class PartnerListPage extends BrowsePageTemplate<Partner> {
...@@ -42,7 +37,7 @@ class PartnerListPage extends BrowsePageTemplate<Partner> { ...@@ -42,7 +37,7 @@ class PartnerListPage extends BrowsePageTemplate<Partner> {
public render() { public render() {
const { paged, t, loadMoreData, classes } = this.props; const { paged, t, loadMoreData } = this.props;
const stillLoading: boolean = (!paged || !paged.content); const stillLoading: boolean = (!paged || !paged.content);
return ( return (
...@@ -63,7 +58,7 @@ class PartnerListPage extends BrowsePageTemplate<Partner> { ...@@ -63,7 +58,7 @@ class PartnerListPage extends BrowsePageTemplate<Partner> {
filterObj={ paged && paged.filter || {} } filterObj={ paged && paged.filter || {} }
onSubmit={ this.myApplyFilters } onSubmit={ this.myApplyFilters }
/> />
<PageContents className={ classes.container }> <PageContents className="pt-1rem container-spacing-horizontal">
{ stillLoading ? <Loading/> : { stillLoading ? <Loading/> :
<PagedLoader <PagedLoader
paged={ paged } paged={ paged }
...@@ -90,4 +85,4 @@ const mapDispatchToProps = (dispatch) => bindActionCreators({ ...@@ -90,4 +85,4 @@ const mapDispatchToProps = (dispatch) => bindActionCreators({
updateRoute, updateRoute,
}, dispatch); }, dispatch);
export default translate()(withStyles(style)((connect(mapStateToProps, mapDispatchToProps)(PartnerListPage)))); export default translate()((connect(mapStateToProps, mapDispatchToProps)(PartnerListPage)));
...@@ -31,7 +31,7 @@ const renderMembers = ({ fields, itemLabel, itemEditor, addItem, removeItem, t } ...@@ -31,7 +31,7 @@ const renderMembers = ({ fields, itemLabel, itemEditor, addItem, removeItem, t }
<div> <div>
{ fields && fields.map((member, index, fields) => ( { fields && fields.map((member, index, fields) => (
<div key={ index } className="items-editor-item"> <div key={ index } className="items-editor-item">
<Grid container justify="space-between" alignItems="baseline"> <Grid container justify="space-between" alignItems="center">
<Grid item xs={ 10 } md={ 11 }> <Grid item xs={ 10 } md={ 11 }>
{ itemEditor(member, index, fields, itemLabel) } { itemEditor(member, index, fields, itemLabel) }
</Grid> </Grid>
......
...@@ -15,7 +15,6 @@ import PaginationComponent from 'ui/common/pagination'; ...@@ -15,7 +15,6 @@ import PaginationComponent from 'ui/common/pagination';
import ContentHeaderWithButton from 'ui/common/heading/ContentHeaderWithButton'; import ContentHeaderWithButton from 'ui/common/heading/ContentHeaderWithButton';
import VocabularyCard from './c/VocabularyCard'; import VocabularyCard from './c/VocabularyCard';
import Grid from '@material-ui/core/Grid';
import Button from '@material-ui/core/Button'; import Button from '@material-ui/core/Button';
import Vocabulary from 'model/vocabulary/Vocabulary'; import Vocabulary from 'model/vocabulary/Vocabulary';
import VocabularyFilter from 'model/vocabulary/VocabularyFilter'; import VocabularyFilter from 'model/vocabulary/VocabularyFilter';
...@@ -27,7 +26,6 @@ const styles = (theme) => ({ ...@@ -27,7 +26,6 @@ const styles = (theme) => ({
root: { root: {
backgroundColor: '#E8E5E0', backgroundColor: '#E8E5E0',
}, },
cardContainer: theme.container.spacingHorizontal,
updateButton: { updateButton: {
marginRight: '1rem', marginRight: '1rem',
}, },
...@@ -51,15 +49,11 @@ class BrowsePage extends BrowsePageTemplate<Vocabulary> { ...@@ -51,15 +49,11 @@ class BrowsePage extends BrowsePageTemplate<Vocabulary> {
public render() { public render() {
const { classes, paged, createVocabulary, listVocabularies, t } = this.props; const { classes, paged, createVocabulary, loadMoreData, t } = this.props;
const stillLoading: boolean = (!(paged && paged.content)); const stillLoading: boolean = (!(paged && paged.content));
const renderVocabulary = (vocabulary: Vocabulary) => ( const renderVocabulary = (vocabulary: Vocabulary) => (<VocabularyCard key={ vocabulary.uuid } vocabulary={ vocabulary } textRows={ 3 }/>);
<Grid key={ vocabulary.uuid } item xs={ 12 }>
<VocabularyCard vocabulary={ vocabulary } textRows={ 3 }/>
</Grid>
);
return ( return (
<div> <div>
...@@ -86,11 +80,11 @@ class BrowsePage extends BrowsePageTemplate<Vocabulary> { ...@@ -86,11 +80,11 @@ class BrowsePage extends BrowsePageTemplate<Vocabulary> {
infinite infinite
sortOptions={ Vocabulary.SORT_OPTIONS } sortOptions={ Vocabulary.SORT_OPTIONS }
/> />
<PageContents className={ classes.cardContainer }> <PageContents className="pt-1rem container-spacing-horizontal">
{ stillLoading ? <Loading/> : { stillLoading ? <Loading/> :
<TableInfiniteLoader <TableInfiniteLoader
paged={ paged } paged={ paged }
loadMore={ listVocabularies } loadMore={ loadMoreData }
colSpan={ 3 } colSpan={ 3 }
itemRenderer={ renderVocabulary } itemRenderer={ renderVocabulary }
/> />
......
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