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