Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ const FilterSortHeader = ({
}

return (
<HeadingCell $centered={columnInfo.centered} onClick={changeSort}>
<HeadingCell
$centered={columnInfo.centered}
$flex={columnInfo.flex}
onClick={changeSort}
>
{
'\u200B' /* zero-width space so the layout engine understands where the baseline is */
}
Expand Down Expand Up @@ -129,7 +133,7 @@ const FilterSortHeader = ({
].concat(columnInfo.filterOptions)

return (
<Cell $centered={columnInfo.centered}>
<Cell $centered={columnInfo.centered} $flex={columnInfo.flex}>
<Select
aria-label={columnInfo.title}
customStyles={{
Expand Down Expand Up @@ -187,15 +191,23 @@ const FilterSortHeader = ({
}

return (
<Cell $centered={columnInfo.centered} onClick={changeSort}>
<Cell
$centered={columnInfo.centered}
$flex={columnInfo.flex}
onClick={changeSort}
>
{columnInfo.title}
{columnInfo.sortDirection === 'ASC' && <SortDown />}
{columnInfo.sortDirection === 'DESC' && <SortUp />}
</Cell>
)
}

return <Cell $centered={columnInfo.centered}>{columnInfo.title}</Cell>
return (
<Cell $centered={columnInfo.centered} $flex={columnInfo.flex}>
{columnInfo.title}
</Cell>
)
}

export default FilterSortHeader
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const ManuscriptRow = ({
return (
<Cell
$centered={column.centered}
$flex={column.flex}
data-testid={column.name}
key={column.name}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ const ReviewerStatusBadge = ({ manuscript, currentUser }) => {

return (
<ConfigurableStatus
$lightText={statusConfig.lightText}
color={statusConfig.color}
lightText={statusConfig.lightText}
>
{statusConfig.label}
</ConfigurableStatus>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export const ManuscriptsHeaderRow = styled(ManuscriptsRow)`

export const Cell = styled.div`
display: flex;
flex: ${({ flex }) => flex ?? '0 1 12em'};
flex: ${({ $flex }) => $flex ?? '0 1 12em'};
flex-direction: row;
${props =>
props.onClick &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@ const Kanban = styled.div.attrs({
min-height: 300px;
`

const Column = styled.div(({ columns }) => ({
const Column = styled.div(({ $columns }) => ({
alignItems: 'flex-start',
display: 'flex',
flexDirection: 'column',
flexGrow: 1,
marginInline: '7.5px',
/* stylelint-disable-next-line scss/operator-no-unspaced */
width: `calc(${100 / columns ?? 4}% - 15px)`,
width: `calc(${100 / $columns ?? 4}% - 15px)`,
}))

const StatusLabel = styled.div`
background-color: ${props => props.statusColor || '#ffffff'};
background-color: ${props => props.$statusColor || '#ffffff'};
border-radius: 12px;
color: ${props => (props.lightText ? '#ffffff' : '#000000')};
color: ${props => (props.$lightText ? '#ffffff' : '#000000')};
display: inline-block;
font-weight: bold;
margin-block: 4px;
Expand Down Expand Up @@ -253,10 +253,10 @@ const KanbanBoard = ({
{LocalizedStatusOptions.filter(
status => !filterOptions.includes(status.value.toLowerCase()),
).map(status => (
<Column columns={isAuthorBoard ? 2 : 4} key={status.value}>
<Column $columns={isAuthorBoard ? 2 : 4} key={status.value}>
<StatusLabel
lightText={status.lightText}
statusColor={status.color}
$lightText={status.lightText}
$statusColor={status.color}
>
{statusLabel(status)}
</StatusLabel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,7 @@ const Review = ({
)

const renderAnonymousReviewer = () => (
<div>
<Heading>
<Title>{t('reviewPage.Anonymous Reviewer')}</Title>
</Heading>
</div>
<Title>{t('reviewPage.Anonymous Reviewer')}</Title>
)

if (isOldUnsubmitted)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,7 @@ const KanbanCard = ({
</DateDisplay>
{showEmailInvitation && (
<EmailDisplay>
<MailIcon
invitationStatus={reviewer.status} // TODO why are we setting an arbitrary 'invitationStatus' attribute on this svg element?
/>{' '}
{t('common.kanban.Invited via email')}
<MailIcon /> {t('common.kanban.Invited via email')}
</EmailDisplay>
)}
</InfoGrid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import styled from 'styled-components'
import { useTranslation } from 'react-i18next'

import { required } from '../../../../xpub-validators/src'
import { Button, Checkbox, TextField } from '../../../../pubsweet'
import { Checkbox, TextField } from '../../../../pubsweet'
import { ActionButton, Select } from '../../../../shared'
import { EmailErrorMessageWrapper } from '../emailNotifications'

Expand Down Expand Up @@ -70,6 +70,7 @@ const ReviewerForm = ({
setExternalEmail,
}) => {
const { t } = useTranslation()

return (
<form onSubmit={handleSubmit}>
<RowGridStyled>
Expand Down Expand Up @@ -124,14 +125,14 @@ const ReviewerForm = ({
reviewerUsers={reviewerUsers}
validate={required}
/>
<Button
$primary
<ActionButton
data-testid="invite-reviewer"
disabled={!isValid}
primary
type="submit"
>
{t('decisionPage.Invite reviewer')}
</Button>
</ActionButton>
</>
)}
</RowGridStyled>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ export const Section = styled.section`
? $cssOverrides['flex-direction']
: 'column'};
/* stylelint-disable-next-line declaration-block-no-redundant-longhand-properties */
flex-wrap: ${({ $cssOverrides }) =>
$cssOverrides && $cssOverrides.wrap ? $cssOverrides.wrap : 'nowrap'};
flex-wrap: ${({ $cssOverrides }) => $cssOverrides?.wrap ?? 'nowrap'};
justify-content: space-between;
margin: ${grid(3)} 0;
`
Expand Down
8 changes: 4 additions & 4 deletions packages/client/app/components/shared/ActionButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ const Spinner = styled.div`

&::after {
animation: ${rotate360} 1s linear infinite;
border: 2.5px solid ${props => props.fgColor};
border-color: ${props => props.fgColor} transparent
${props => props.fgColor} transparent;
border: 2.5px solid ${props => props.$fgColor};
border-color: ${props => props.$fgColor} transparent
${props => props.$fgColor} transparent;
border-radius: 50%;
box-sizing: border-box;
/* stylelint-disable-next-line string-quotes */
Expand Down Expand Up @@ -125,7 +125,7 @@ const ActionButton = ({
const fgColor = isLight ? color.text : color.textReverse

let statusIndicator = null
if (status === 'pending') statusIndicator = <Spinner fgColor={fgColor} />
if (status === 'pending') statusIndicator = <Spinner $fgColor={fgColor} />

if (status === 'success')
statusIndicator = (
Expand Down
2 changes: 1 addition & 1 deletion packages/client/app/components/shared/Badge.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const Status = styled.span`

export const ConfigurableStatus = styled(Status)`
background-color: ${p => p.color};
color: ${p => (p.lightText ? color.textReverse : color.text)};
color: ${p => (p.$lightText ? color.textReverse : color.text)};
`

export const safeLabel = status => {
Expand Down
6 changes: 3 additions & 3 deletions packages/client/app/components/shared/RadioGroup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { Radio } from './Radio'

const Flexbox = styled.div`
display: flex;
flex-direction: ${props => (props.column ? 'column' : 'row')};
justify-content: ${props => (props.center ? 'center' : 'left')};
flex-direction: ${props => (props.$column ? 'column' : 'row')};
justify-content: ${props => (props.$center ? 'center' : 'left')};
`

export const RadioGroup = ({
Expand All @@ -25,7 +25,7 @@ export const RadioGroup = ({
}

return (
<Flexbox column={!inline} data-testid={dataTestid}>
<Flexbox $column={!inline} data-testid={dataTestid}>
{options.map(option => (
<Radio
checked={option.value === radioValue}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const AuthorProofingWaxEditorLayout = readOnly => props => {

return (
<div style={fullScreenStyles}>
<Grid production readonly={readOnly}>
<Grid $production $readonly={readOnly}>
{readOnly ? (
<ProductionEditorDiv>
<SideMenu />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ export const Grid = styled.div`
/* stylelint-disable selector-class-pattern */
display: grid;
grid-template:
'menu' ${props => (props.readonly ? '0' : 'minmax(40px, auto)')}
'menu' ${props => (props.$readonly ? '0' : 'minmax(40px, auto)')}
'editor' 1fr
/ 100%;
${props => props.production && 'min-height: calc(100vh - 142px);'}
${props => props.$production && 'min-height: calc(100vh - 142px);'}
position: relative;
/* :focus-within {
z-index: 10000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const FullWaxEditorCommentsLayout = (readOnly, authorComments) => props => {
id="wax-container"
>
{readOnly ? (
<Grid readonly>
<Grid $readonly>
<FullWaxEditorGrid noScroll useComments>
<ReadOnlyEditorWithCommentsEditor className="panelWrapper">
<WaxView {...props} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const FullWaxEditorLayout = (readOnly, getActiveViewDom) => props => {

return (
<div id="wax-container" style={fullScreenStyles}>
<Grid readonly={readOnly} readOnlyComments>
<Grid $readonly={readOnly}>
{readOnly ? (
<FullWaxEditorGrid useComments={false}>
<ReadOnlyEditorDiv className="wax-surface-scroll panelWrapper">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ const ProductionWaxEditorLayout =
return useMemo(
() => (
<div id="main-wax-editor" style={fullScreenStyles}>
<Grid production readonly={readOnly}>
<Grid $production $readonly={readOnly}>
<>
<Menu className="waxmenu">
<TopBar />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const ProductionWaxEditorNoCommentsLayout = readOnly => props => {

return (
<div style={fullScreenStyles}>
<Grid production readonly={readOnly}>
<Grid $production $readonly={readOnly}>
{readOnly ? (
<ReadOnlyEditorDiv className="wax-surface-scroll">
<WaxView {...props} />
Expand Down