From 02dfc30a7bad43bae41f3dfd647c201db99ee2bc Mon Sep 17 00:00:00 2001 From: xeronimus Date: Sat, 1 Jul 2023 16:37:22 +0200 Subject: [PATCH] #58 use transient attributes in styled-components --- client/app/components/ActionLog/ActionLog.js | 4 +-- client/app/components/ActionLog/_styled.js | 6 ++-- client/app/components/Backlog/Backlog.js | 2 +- .../Backlog/BacklogFileDropWrapper.js | 6 ++-- .../app/components/Backlog/BacklogToolbar.js | 2 +- client/app/components/Backlog/Story.js | 6 ++-- .../app/components/Backlog/StoryEditForm.js | 2 +- client/app/components/Backlog/_styled.js | 34 +++++++++---------- client/app/components/EstimationArea/Card.js | 4 +-- .../EstimationArea/ConfidenceButtons.js | 2 +- .../EstimationArea/EstimationArea.js | 6 ++-- .../EstimationArea/EstimationSummaryCard.js | 4 +-- .../app/components/EstimationArea/_styled.js | 18 +++++----- .../EstimationMatrixColumn.js | 4 +-- .../components/EstimationMatrix/_styled.js | 10 +++--- client/app/components/Help/Help.js | 2 +- client/app/components/Help/_styled.js | 2 +- client/app/components/Landing/Landing.js | 2 +- client/app/components/Landing/_styled.js | 2 +- client/app/components/Room/Board.js | 2 +- client/app/components/Room/MatrixToggle.js | 4 +-- client/app/components/Room/_styled.js | 2 +- .../Settings/CardConfigEditorItem.js | 2 +- client/app/components/Settings/Settings.js | 2 +- .../app/components/Settings/UserSettings.js | 2 +- client/app/components/Settings/_styled.js | 6 ++-- client/app/components/TopBar/TopBar.js | 2 +- client/app/components/TopBar/_styled.js | 2 +- client/app/components/Users/User.js | 4 +-- .../components/Users/UserEstimationCard.js | 6 ++-- client/app/components/Users/_styled.js | 12 +++---- client/app/components/common/Avatar.js | 4 +-- .../app/components/common/StoryDescription.js | 4 +-- client/app/components/common/ValueBadge.js | 5 ++- client/app/components/common/_styled.js | 22 ++++++------ 35 files changed, 101 insertions(+), 98 deletions(-) diff --git a/client/app/components/ActionLog/ActionLog.js b/client/app/components/ActionLog/ActionLog.js index 2e0dd230..2a22dc66 100644 --- a/client/app/components/ActionLog/ActionLog.js +++ b/client/app/components/ActionLog/ActionLog.js @@ -20,13 +20,13 @@ import { const ActionLog = ({actionLog, shown}) => { const {t} = useContext(L10nContext); return ( - +

{t('log')}

{actionLog.map((entry) => ( - + {entry.tstamp} {entry.message} diff --git a/client/app/components/ActionLog/_styled.js b/client/app/components/ActionLog/_styled.js index 02861410..daf3a837 100644 --- a/client/app/components/ActionLog/_styled.js +++ b/client/app/components/ActionLog/_styled.js @@ -9,7 +9,7 @@ import { } from '../colors'; export const StyledActionLog = styled.div` - display: ${({shown}) => (shown ? 'block' : 'none')}; + display: ${({$shown}) => ($shown ? 'block' : 'none')}; -webkit-overflow-scrolling: touch; box-sizing: border-box; padding: 0 8px; @@ -40,8 +40,8 @@ export const StyledActionLogListItem = styled.li` margin-bottom: 8px; box-sizing: border-box; border: 1px solid ${COLOR_LIGHTER_GREY}; - border-left: ${({isError}) => - isError ? '2px solid ' + COLOR_WARNING : '1px solid ' + COLOR_LIGHTER_GREY}; + border-left: ${({$isError}) => + $isError ? '2px solid ' + COLOR_WARNING : '1px solid ' + COLOR_LIGHTER_GREY}; > span { display: block; diff --git a/client/app/components/Backlog/Backlog.js b/client/app/components/Backlog/Backlog.js index ec597c56..3ba8714f 100644 --- a/client/app/components/Backlog/Backlog.js +++ b/client/app/components/Backlog/Backlog.js @@ -52,7 +52,7 @@ const Backlog = ({ }, []); return ( - +
diff --git a/client/app/components/Backlog/BacklogFileDropWrapper.js b/client/app/components/Backlog/BacklogFileDropWrapper.js index 2ebe7e3a..79ca8fb5 100644 --- a/client/app/components/Backlog/BacklogFileDropWrapper.js +++ b/client/app/components/Backlog/BacklogFileDropWrapper.js @@ -39,9 +39,9 @@ const BacklogFileDropWrapper = ({importCsvFile, children}) => { return (
{children}
diff --git a/client/app/components/Backlog/BacklogToolbar.js b/client/app/components/Backlog/BacklogToolbar.js index dddf5897..261133fb 100644 --- a/client/app/components/Backlog/BacklogToolbar.js +++ b/client/app/components/Backlog/BacklogToolbar.js @@ -43,7 +43,7 @@ const BacklogToolbar = ({filterQuery, onQueryChanged, sorting, onSortingChanged, {sortings.map((sortingItem) => ( onSortingOptionClicked(sortingItem)} diff --git a/client/app/components/Backlog/Story.js b/client/app/components/Backlog/Story.js index 27398816..c24f022f 100644 --- a/client/app/components/Backlog/Story.js +++ b/client/app/components/Backlog/Story.js @@ -76,10 +76,10 @@ const Story = ({ id={'story.' + story.id} data-testid={isSelected ? 'storySelected' : 'story'} onClick={onStoryClicked} - selected={isSelected} - highlighted={isHighlighted} + $selected={isSelected} + $highlighted={isHighlighted} className={isWaiting ? 'waiting-spinner' : ''} - isDragging={isDragging} + $isDragging={isDragging} > diff --git a/client/app/components/Backlog/_styled.js b/client/app/components/Backlog/_styled.js index 2580ef97..a9c722e5 100644 --- a/client/app/components/Backlog/_styled.js +++ b/client/app/components/Backlog/_styled.js @@ -12,7 +12,7 @@ import {device, TOPBAR_HEIGHT} from '../dimensions'; export const StyledBacklog = styled.div.attrs((props) => ({ style: { - width: props.shown ? '100%' : props.width + 'px' + width: props.$shown ? '100%' : props.$width + 'px' } }))` position: relative; @@ -22,7 +22,7 @@ export const StyledBacklog = styled.div.attrs((props) => ({ flex-shrink: 0; flex-grow: 0; - display: ${({shown}) => (shown ? 'flex' : 'none')}; + display: ${({$shown}) => ($shown ? 'flex' : 'none')}; flex-direction: column; justify-content: flex-start; align-items: stretch; @@ -160,7 +160,7 @@ const dzOverlayRejectBorder = '4px dashed rgba(255, 130, 10, 0.3)'; const dzOverlayRejectBg = 'rgba(255, 130, 10, 0.06)'; export const StyledFileImportDropZoneOverlay = styled.div` - display: ${({active}) => (active ? 'block' : 'none')}; + display: ${({$active}) => ($active ? 'block' : 'none')}; position: absolute; left: 0; right: 0; @@ -169,18 +169,18 @@ export const StyledFileImportDropZoneOverlay = styled.div` margin: 4px; font-size: 62px; color: rgba(0, 153, 204, 0.25); - z-index: ${({active}) => (active ? 1000 : 0)}; + z-index: ${({$active}) => ($active ? 1000 : 0)}; - border: ${({active, isAccept, isReject}) => - active && isAccept + border: ${({$active, $isAccept, $isReject}) => + $active && $isAccept ? dzOverlayAcceptBorder - : active && isReject + : $active && $isReject ? dzOverlayRejectBorder : 'none'}; - background: ${({active, isAccept, isReject}) => - active && isAccept + background: ${({$active, $isAccept, $isReject}) => + $active && $isAccept ? dzOverlayAcceptBg - : active && isReject + : $active && $isReject ? dzOverlayRejectBg : 'transparent'}; `; @@ -193,17 +193,17 @@ export const StyledStory = styled.div` box-sizing: border-box; border: 1px solid ${COLOR_LIGHTER_GREY}; cursor: pointer; - opacity: ${(props) => (props.isDragging ? 0 : 1)}; - border-left: ${({selected, highlighted}) => - selected + opacity: ${(props) => (props.$isDragging ? 0 : 1)}; + border-left: ${({$selected, $highlighted}) => + $selected ? '2px solid ' + COLOR_ORANGE - : highlighted + : $highlighted ? '1px solid ' + COLOR_BLUE : '1px solid ' + COLOR_LIGHTER_GREY}; &:hover { - box-shadow: ${({noShadow}) => - noShadow ? 'none' : 'inset 0 82px 50px -60px rgba(194, 194, 194, 0.45)'}; + box-shadow: ${({$noShadow}) => + $noShadow ? 'none' : 'inset 0 82px 50px -60px rgba(194, 194, 194, 0.45)'}; } `; @@ -295,7 +295,7 @@ export const StyledBacklogToolbar = styled.form` `; export const StyledSortDropdownItem = styled.div` - color: ${({selected}) => (selected ? COLOR_LIGHTER_GREY : 'inherit')}; + color: ${({$selected}) => ($selected ? COLOR_LIGHTER_GREY : 'inherit')}; > i { margin-right: 4px; diff --git a/client/app/components/EstimationArea/Card.js b/client/app/components/EstimationArea/Card.js index 00579dad..5143f74d 100644 --- a/client/app/components/EstimationArea/Card.js +++ b/client/app/components/EstimationArea/Card.js @@ -14,8 +14,8 @@ const Card = ({isWaiting, isSelected, cardCfg, onClick}) => { {cardCfg.label} diff --git a/client/app/components/EstimationArea/ConfidenceButtons.js b/client/app/components/EstimationArea/ConfidenceButtons.js index 8c7d1b8d..537b7174 100644 --- a/client/app/components/EstimationArea/ConfidenceButtons.js +++ b/client/app/components/EstimationArea/ConfidenceButtons.js @@ -44,7 +44,7 @@ const ConfButton = ({label, title, onClick, active}) => ( className="pure-button" type="button" onClick={onClick} - active={active} + $active={active} title={title} > {label} diff --git a/client/app/components/EstimationArea/EstimationArea.js b/client/app/components/EstimationArea/EstimationArea.js index e4960c48..4781ed3f 100644 --- a/client/app/components/EstimationArea/EstimationArea.js +++ b/client/app/components/EstimationArea/EstimationArea.js @@ -64,14 +64,14 @@ const EstimationArea = ({ textExpandThreshold={500} /> - {hasConsensus && applause && } + {hasConsensus && applause && } {hasConsensus && activeEasterEgg && applause && ( )} {!revealed && ( - +