Skip to content
Snippets Groups Projects
Commit 157e02a3 authored by Taniaf26's avatar Taniaf26
Browse files

perf: replace withVerion to get only the last fragment of a collection

hin-1020
parent e8f887be
No related branches found
No related tags found
2 merge requests!110Sprint 21 Features,!66Hin 1020
......@@ -5,17 +5,17 @@ import { connect } from 'react-redux'
import styled from 'styled-components'
import { th } from '@pubsweet/ui-toolkit'
import { withRouter } from 'react-router-dom'
import { compose, setDisplayName, withHandlers } from 'recompose'
import { compose, setDisplayName, withHandlers, withProps } from 'recompose'
import { ManuscriptCard, Row } from 'pubsweet-component-faraday-ui'
import { canViewReports } from 'pubsweet-component-faraday-selectors'
import withVersion from './withVersion'
const DashboardItem = compose(
withVersion,
connect((state, { collection }) => ({
canViewReports: canViewReports(state, get(collection, 'id', '')),
})),
withProps(({ collection }) => ({
fragment: get(collection, 'currentVersion', {}),
})),
)(ManuscriptCard)
const DashboardItems = ({ list, onClick, deleteProject, canViewReports }) => (
......
import { compose } from 'recompose'
import { connect } from 'react-redux'
import { actions } from 'pubsweet-client'
import { ConnectPage } from 'xpub-connect'
import { selectCurrentVersion } from 'xpub-selectors'
export default Component =>
compose(
ConnectPage(({ collection }) => [
actions.getFragments({ id: collection.id }),
]),
connect((state, { collection }) => ({
fragment: selectCurrentVersion(state, collection) || {},
})),
)(Component)
......@@ -2,7 +2,6 @@ import { Decision } from './MakeDecision'
import * as Components from './UIComponents'
export { FormItems } from './UIComponents'
export { default as withVersion } from './Dashboard/withVersion.js'
export { default as UserProfilePage } from './UserProfile/UserProfilePage'
export { default as ChangePasswordPage } from './UserProfile/ChangePasswordPage'
......
......@@ -36,7 +36,7 @@ export default {
? th('accordion.headerBackgroundColor')
: 'transparent'};
border-radius: ${props => (props.expanded ? 0 : th('borderRadius'))};
borde-border-top-left-radius: ${th('borderRadius')};
border-top-left-radius: ${th('borderRadius')};
border-top-right-radius: ${th('borderRadius')};
border-bottom: ${props =>
props.expanded && !props.transparent ? th('accordion.border') : 'none'};
......
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