Skip to content
Snippets Groups Projects
Commit ca2ce94f authored by Bogdan Cochior's avatar Bogdan Cochior
Browse files

feat(dashboard): fix filters and scroll cards

parent 2feb067d
No related branches found
No related tags found
1 merge request!43Sprint #19
...@@ -16,7 +16,7 @@ const Dashboard = ({ ...@@ -16,7 +16,7 @@ const Dashboard = ({
}) => ( }) => (
<Fragment> <Fragment>
<Row alignItems="center" justify="space-between"> <Row alignItems="center" justify="space-between">
<H1>Dashboard</H1> <H1 mb={1}>Dashboard</H1>
<Button <Button
data-test="new-manuscript" data-test="new-manuscript"
disabled={!canCreateDraft} disabled={!canCreateDraft}
...@@ -40,12 +40,3 @@ export default compose( ...@@ -40,12 +40,3 @@ export default compose(
dashboardItems: filterItems(dashboard.all), dashboardItems: filterItems(dashboard.all),
})), })),
)(Dashboard) )(Dashboard)
// #region styles
// const Root = styled.div`
// display: flex;
// flex-direction: column;
// overflow: auto;
// padding: 0 calc(${th('gridUnit')} * 17);
// `
// #endregion
...@@ -8,7 +8,7 @@ const DashboardFilters = ({ ...@@ -8,7 +8,7 @@ const DashboardFilters = ({
changeFilterValue, changeFilterValue,
getDefaultFilterValue, getDefaultFilterValue,
}) => ( }) => (
<Row alignItems="flex-end" justify="flex-start"> <Row alignItems="flex-end" justify="flex-start" mb={1}>
<Text mr={1} pb={1} secondary> <Text mr={1} pb={1} secondary>
Filters Filters
</Text> </Text>
......
import React, { Fragment } from 'react' import React from 'react'
import { H3 } from '@pubsweet/ui' import { H3 } from '@pubsweet/ui'
import { get, has } from 'lodash' import { get, has } from 'lodash'
import styled from 'styled-components'
import { withRouter } from 'react-router-dom' import { withRouter } from 'react-router-dom'
import { ManuscriptCard, Row } from 'pubsweet-component-faraday-ui' import { ManuscriptCard, Row } from 'pubsweet-component-faraday-ui'
import { compose, setDisplayName, withHandlers, withProps } from 'recompose' import { compose, setDisplayName, withHandlers, withProps } from 'recompose'
...@@ -10,7 +11,7 @@ import withVersion from './withVersion' ...@@ -10,7 +11,7 @@ import withVersion from './withVersion'
const DashboardItem = withVersion(ManuscriptCard) const DashboardItem = withVersion(ManuscriptCard)
const DashboardItems = ({ onClick, list, deleteProject, listView = true }) => ( const DashboardItems = ({ onClick, list, deleteProject, listView = true }) => (
<Fragment> <Root>
{!list.length ? ( {!list.length ? (
<Row justify="center" mt={4}> <Row justify="center" mt={4}>
<H3>Nothing to do at the moment. Please upload a manuscript.</H3> <H3>Nothing to do at the moment. Please upload a manuscript.</H3>
...@@ -24,7 +25,7 @@ const DashboardItems = ({ onClick, list, deleteProject, listView = true }) => ( ...@@ -24,7 +25,7 @@ const DashboardItems = ({ onClick, list, deleteProject, listView = true }) => (
/> />
)) ))
)} )}
</Fragment> </Root>
) )
export default compose( export default compose(
...@@ -53,3 +54,13 @@ export default compose( ...@@ -53,3 +54,13 @@ export default compose(
}), }),
setDisplayName('DashboardItems'), setDisplayName('DashboardItems'),
)(DashboardItems) )(DashboardItems)
// #region styles
const Root = styled.div`
height: calc(100vh - 200px);
overflow-y: auto;
div[open] {
width: auto;
}
`
// #endregion
...@@ -46,7 +46,7 @@ export default compose( ...@@ -46,7 +46,7 @@ export default compose(
// #region styles // #region styles
const Root = styled.div` const Root = styled.div`
height: 100%; height: 100%;
overflow-y: scroll; overflow-y: auto;
div[open] { div[open] {
width: auto; width: auto;
} }
...@@ -55,8 +55,8 @@ const Root = styled.div` ...@@ -55,8 +55,8 @@ const Root = styled.div`
const MainContainer = styled.div` const MainContainer = styled.div`
display: flex; display: flex;
flex-direction: column; flex-direction: column;
overflow-y: scroll; overflow-y: auto;
padding: 0 calc(${th('gridUnit')} * 17); padding: 0 calc(${th('gridUnit')} * 17);
padding-top: ${th('appBar.height')}; padding-top: calc(${th('appBar.height')} + ${th('gridUnit')} * 3 )};
` `
// #endregion // #endregion
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