Skip to content

Commit

Permalink
Add missing styled component prop prefixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ivangabriele committed Sep 9, 2024
1 parent 882afd0 commit 720ef6f
Show file tree
Hide file tree
Showing 32 changed files with 187 additions and 189 deletions.
2 changes: 1 addition & 1 deletion frontend/src/domain/entities/estimatedPosition.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import Point from 'ol/geom/Point'
import { transform } from 'ol/proj'

import { LayerProperties } from './layers/constants'
import { MonitorFishLayer } from './layers/types'
import { OPENLAYERS_PROJECTION, WSG84_PROJECTION } from './map/constants'
import { Vessel } from './vessel/vessel'
import { COLORS } from '../../constants/constants'
import { theme } from '../../ui/theme'
import { MonitorFishLayer } from './layers/types'

class EstimatedPosition {
static colorProperty = 'color'
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/features/Account/components/Account.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function Account() {

return (
<Wrapper>
<MissionMenuBox data-cy="map-account-box" isOpen={rightMapBoxOpened === MapBox.ACCOUNT}>
<MissionMenuBox $isOpen={rightMapBoxOpened === MapBox.ACCOUNT} data-cy="map-account-box">
<StyledContainer>
<MapMenuDialog.Header>
<MapMenuDialog.Title>Déconnexion</MapMenuDialog.Title>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ type AdministrativeZoneType = {
export function AdministrativeZone({ isFirst, isGrouped, isShown, showOrHideZone, zone }: AdministrativeZoneType) {
return (
<Row
$isFirst={isFirst}
$isGrouped={isGrouped}
data-cy="administrative-layer-toggle"
isFirst={isFirst}
isGrouped={isGrouped}
onClick={() => showOrHideZone(isShown)}
>
<LayerName title={zone.name}>{zone.name}</LayerName>
Expand All @@ -41,12 +41,12 @@ const LayerName = styled.span`
`

const Row = styled.span<{
isFirst: boolean | undefined
isGrouped: boolean | undefined
$isFirst: boolean | undefined
$isGrouped: boolean | undefined
}>`
margin-top: ${p => (p.isFirst ? 5 : 0)}px;
margin-top: ${p => (p.$isFirst ? 5 : 0)}px;
padding: 4px 0 4px 20px;
padding-left: ${p => (p.isGrouped ? '38px' : '20px')};
padding-left: ${p => (p.$isGrouped ? '38px' : '20px')};
line-height: 20px;
display: block;
user-select: none;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ export function AdministrativeZonesGroup({ group, showOrHideZone, zones }: Admin

return (
<Row>
<Zone isOpen={isOpen}>
<Zone $isOpen={isOpen}>
<Text onClick={() => setIsOpen(!isOpen)} title={group.name}>
{group.name}
</Text>
<Chevron $isOpen={isOpen} onClick={() => setIsOpen(!isOpen)} />
</Zone>
<List isOpen={isOpen} length={zones.length} title={group.name.replace(/\s/g, '-')}>
<List $isOpen={isOpen} $length={zones.length} title={group.name.replace(/\s/g, '-')}>
{zones.map((zone, index) => (
<AdministrativeZone
key={zone.code}
Expand Down Expand Up @@ -68,7 +68,7 @@ const Text = styled.span`
`

const Zone = styled.span<{
isOpen: boolean
$isOpen: boolean
}>`
width: 100%;
width: -moz-available;
Expand All @@ -77,18 +77,18 @@ const Zone = styled.span<{
display: flex;
user-select: none;
padding-bottom: 2px;
${p => (!p.isOpen ? null : `border-bottom: 1px solid ${COLORS.lightGray};`)}
${p => (!p.$isOpen ? null : `border-bottom: 1px solid ${COLORS.lightGray};`)}
&:hover {
background: ${THEME.color.blueGray25};
}
`

const List = styled.div<{
isOpen: boolean
length: number
$isOpen: boolean
$length: number
}>`
height: ${p => (p.isOpen && p.length ? p.length * 37 + 10 : 0)}px;
height: ${p => (p.$isOpen && p.$length ? p.$length * 37 + 10 : 0)}px;
overflow: hidden;
transition: 0.2s all;
`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ export function AdministrativeZones({ hideLayersListWhenSearching = false, names

return (
<>
<SectionTitle data-cy="administrative-zones-open" isOpened={isOpened} onClick={onSectionTitleClicked}>
<SectionTitle $isOpened={isOpened} data-cy="administrative-zones-open" onClick={onSectionTitleClicked}>
Zones administratives <ChevronIcon $isOpen={isOpened} />
</SectionTitle>
<List isOpened={isOpened} zonesLength={zonesLength}>
<List $isOpened={isOpened} $zonesLength={zonesLength}>
{zones.zones.map(zone => (
<Row key={zone.code}>
<AdministrativeZone
Expand All @@ -124,7 +124,7 @@ export function AdministrativeZones({ hideLayersListWhenSearching = false, names
}

const SectionTitle = styled.div<{
isOpened: boolean
$isOpened: boolean
}>`
height: 30px;
padding-left: 20px;
Expand All @@ -138,8 +138,8 @@ const SectionTitle = styled.div<{
border-bottom: 1px solid rgba(255, 255, 255, 0.3);
border-top-left-radius: 2px;
border-top-right-radius: 2px;
border-bottom-left-radius: ${p => (p.isOpened ? '0' : '2px')};
border-bottom-right-radius: ${p => (p.isOpened ? '0' : '2px')};
border-bottom-left-radius: ${p => (p.$isOpened ? '0' : '2px')};
border-bottom-right-radius: ${p => (p.$isOpened ? '0' : '2px')};
.Element-IconBox {
float: right;
Expand All @@ -148,14 +148,14 @@ const SectionTitle = styled.div<{
`

const List = styled.ul<{
isOpened: boolean
zonesLength: number
$isOpened: boolean
$zonesLength: number
}>`
margin: 0;
padding: 0;
overflow-x: hidden;
max-height: 48vh;
height: ${p => (p.isOpened && p.zonesLength ? 36 * p.zonesLength : 0)}px;
height: ${p => (p.$isOpened && p.$zonesLength ? 36 * p.$zonesLength : 0)}px;
background: ${COLORS.white};
transition: 0.5s all;
border-bottom-left-radius: 2px;
Expand Down
16 changes: 8 additions & 8 deletions frontend/src/features/BaseMap/components/BaseMaps/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ export function BaseMaps({ namespace }) {

return (
<>
<Title isShowed={isBaseLayersShowed} onClick={openOrCloseBaseLayers}>
<Title $isShowed={isBaseLayersShowed} onClick={openOrCloseBaseLayers}>
Fonds de carte <ChevronIcon $isOpen={isBaseLayersShowed} />
</Title>
<RadioGroup onChange={showLayer} value={selectedBaseLayer}>
<List isShowed={isBaseLayersShowed} layersLength={baseLayers.length}>
<List $isShowed={isBaseLayersShowed} $layersLength={baseLayers.length}>
{baseLayers.map(layer => (
<BaseMap key={layer} layer={layer} onChange={showLayer} selectedBaseLayer={selectedBaseLayer} />
))}
Expand All @@ -67,7 +67,7 @@ export function BaseMaps({ namespace }) {
}

const Title = styled.div<{
isShowed: boolean
$isShowed: boolean
}>`
height: 30px;
border-bottom: 1px solid rgba(255, 255, 255, 0.3);
Expand All @@ -81,8 +81,8 @@ const Title = styled.div<{
user-select: none;
border-top-left-radius: 2px;
border-top-right-radius: 2px;
border-bottom-left-radius: ${p => (p.isShowed ? '0' : '2px')};
border-bottom-right-radius: ${p => (p.isShowed ? '0' : '2px')};
border-bottom-left-radius: ${p => (p.$isShowed ? '0' : '2px')};
border-bottom-right-radius: ${p => (p.$isShowed ? '0' : '2px')};
.Element-IconBox {
float: right;
Expand All @@ -91,13 +91,13 @@ const Title = styled.div<{
`

const List = styled.ul<{
isShowed: boolean
layersLength: number
$isShowed: boolean
$layersLength: number
}>`
margin: 0;
border-radius: 0;
padding: 0;
height: ${p => (p.isShowed && p.layersLength ? 37 * p.layersLength : 0)}px;
height: ${p => (p.$isShowed && p.$layersLength ? 37 * p.$layersLength : 0)}px;
overflow-y: hidden;
overflow-x: hidden;
background: ${p => p.theme.color.white};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ export function CustomZones({ hideLayersListWhenSearching = false, namespace }:

return (
<>
<Title data-cy="custom-zones-toggle" isOpened={isOpened} onClick={onSectionTitleClicked}>
<Title $isOpened={isOpened} data-cy="custom-zones-toggle" onClick={onSectionTitleClicked}>
Mes zones importées <ChevronIcon $isOpen={isOpened} />
</Title>
<List isOpened={isOpened} zonesLength={zonesLength}>
<List $isOpened={isOpened} $zonesLength={zonesLength}>
{zoneList.map(zone => (
<CustomZone
key={zone.uuid}
Expand Down Expand Up @@ -111,7 +111,7 @@ const HowTo = styled.li`
`

const Title = styled.div<{
isOpened: boolean
$isOpened: boolean
}>`
height: 30px;
padding-left: 20px;
Expand All @@ -125,8 +125,8 @@ const Title = styled.div<{
border-bottom: 1px solid rgba(255, 255, 255, 0.3);
border-top-left-radius: 2px;
border-top-right-radius: 2px;
border-bottom-left-radius: ${p => (p.isOpened ? '0' : '2px')};
border-bottom-right-radius: ${p => (p.isOpened ? '0' : '2px')};
border-bottom-left-radius: ${p => (p.$isOpened ? '0' : '2px')};
border-bottom-right-radius: ${p => (p.$isOpened ? '0' : '2px')};
.Element-IconBox {
float: right;
Expand All @@ -135,14 +135,14 @@ const Title = styled.div<{
`

const List = styled.ul<{
isOpened: boolean
zonesLength: number
$isOpened: boolean
$zonesLength: number
}>`
margin: 0;
padding: 0;
overflow-x: hidden;
max-height: 48vh;
height: ${p => (p.isOpened ? 36 * p.zonesLength + 110 : 0)}px;
height: ${p => (p.$isOpened ? 36 * p.$zonesLength + 110 : 0)}px;
background: ${COLORS.white};
transition: 0.5s all;
border-bottom-left-radius: 2px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export function HealthcheckHeadband() {
<>
{!!healthcheckTextWarning.length && !previewFilteredVesselsMode && (
<HealthcheckWarnings
hasMultipleWarnings={healthcheckTextWarning.length > 1}
$hasMultipleWarnings={healthcheckTextWarning.length > 1}
onClick={() => setAreAllWarningsOpened(!areAllWarningsOpened)}
>
<WarningIcon />
Expand All @@ -65,9 +65,9 @@ export function HealthcheckHeadband() {
<MultipleWarningsHeadband
// eslint-disable-next-line react/no-array-index-key
key={`${index}-${warning}`}
isLast={healthcheckTextWarning.length === index + 1}
isOpen={areAllWarningsOpened}
topOffset={index + 1}
$isLast={healthcheckTextWarning.length === index + 1}
$isOpen={areAllWarningsOpened}
$topOffset={index + 1}
>
{warning}
</MultipleWarningsHeadband>
Expand All @@ -91,7 +91,7 @@ const WarningIcon = styled(WarningSVG)`
`

const HealthcheckWarnings = styled.div<{
hasMultipleWarnings: boolean
$hasMultipleWarnings: boolean
}>`
font: normal normal bold 16px/22px Marianne;
background: ${p => p.theme.color.goldenPoppy} 0% 0% no-repeat padding-box;
Expand All @@ -101,26 +101,26 @@ const HealthcheckWarnings = styled.div<{
padding: 13px;
border-bottom: 2px solid #e3be05;
color: ${p => p.theme.color.gunMetal};
cursor: ${p => (p.hasMultipleWarnings ? 'pointer' : 'unset')};
cursor: ${p => (p.$hasMultipleWarnings ? 'pointer' : 'unset')};
`

const MultipleWarningsHeadband = styled.div<{
isLast: boolean
isOpen: boolean
topOffset: number
$isLast: boolean
$isOpen: boolean
$topOffset: number
}>`
position: absolute;
top: ${p => (p.isOpen ? p.topOffset * 50 : 0)}px;
top: ${p => (p.$isOpen ? p.$topOffset * 50 : 0)}px;
background: ${p => p.theme.color.goldenPoppy25} 0% 0% no-repeat padding-box;
width: 100vw;
height: ${p => (p.isOpen ? 22 : 0)}px;
height: ${p => (p.$isOpen ? 22 : 0)}px;
text-align: center;
padding: ${p => (p.isOpen ? '13px 0 13px 0' : '0 0 0 0')};
padding: ${p => (p.$isOpen ? '13px 0 13px 0' : '0 0 0 0')};
border-bottom: 2px solid #e3be05;
color: ${p => p.theme.color.gunMetal};
z-index: 9999;
font: normal normal bold 16px/22px Marianne;
transition: all 0.5s;
opacity: ${p => (p.isOpen ? 1 : 0)};
${p => p.isLast && `box-shadow: 0px 2px ${p.isOpen ? 4 : 0}px #707785bf;`}
opacity: ${p => (p.$isOpen ? 1 : 0)};
${p => p.$isLast && `box-shadow: 0px 2px ${p.$isOpen ? 4 : 0}px #707785bf;`}
`
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export function EditInterestPoint({ close, isOpen }: EditInterestPointProps) {
}

return (
<Wrapper data-cy="save-interest-point" isOpen={isOpen}>
<Wrapper $isOpen={isOpen} data-cy="save-interest-point">
<Header>Créer un point d&apos;intérêt</Header>
<Body>
<p>Coordonnées</p>
Expand Down
Loading

0 comments on commit 720ef6f

Please sign in to comment.