Skip to content

Commit

Permalink
Upgrade styled components to v6 and add proper typing to styled compo…
Browse files Browse the repository at this point in the history
…nents properties
  • Loading branch information
jtmiclat committed Dec 6, 2023
1 parent 2aa736f commit daef924
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion demo/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"react-dom": "18.2.0",
"react-map-gl": "^7.1.6",
"react-scroll-parallax": "3.4.3",
"styled-components": "5.3.11"
"styled-components": "6.1.1"
},
"devDependencies": {
"@types/node": "^20.9.0",
Expand Down
3 changes: 1 addition & 2 deletions demo/frontend/src/Components/Map/Filters/AvgTime.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import styled from 'styled-components';

export default styled.div`
export default styled.div<{ isEnabled: boolean }>`
padding: 5px;
border-radius: 5px;
font-size: 16px;
font-weight: bold;
color: ${({ isEnabled }) => (isEnabled ? '#DADFEE' : '#6C7495')};
cursor: pointer;
&:hover {
Expand Down
3 changes: 1 addition & 2 deletions demo/frontend/src/Components/Map/Filters/Layers/Layer.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import styled from 'styled-components';

export default styled.div`
export default styled.div<{ isLayerVisible: boolean }>`
padding: 5px;
border-radius: 5px;
margin-bottom: 15px;
color: ${({ isLayerVisible }) => (isLayerVisible ? '#DADFEE' : '#6C7495')};
cursor: pointer;
&:hover {
Expand Down
2 changes: 1 addition & 1 deletion demo/frontend/src/Components/Map/Filters/Layers/Legend.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import styled from 'styled-components';

export default styled.div`
export default styled.div<{ fromColor: string; toColor: string }>`
height: 4px;
border-radius: 5px;
margin-top: 6px;
Expand Down

0 comments on commit daef924

Please sign in to comment.