Skip to content

Commit ca9e541

Browse files
committed
fix: fixed all recommendations by @ptbrowne
1 parent 83ae149 commit ca9e541

File tree

7 files changed

+41
-18
lines changed

7 files changed

+41
-18
lines changed

Diff for: src/components/charts-generic/histogram/histogram-state.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ const useHistogramState = ({
7373

7474
const colors = scaleLinear<string>()
7575
.domain(colorDomain)
76-
.range(chartPalette.diverging.GO)
76+
.range(chartPalette.diverging.GreenOrange)
7777
.interpolate(interpolateHsl);
7878
// y
7979
const bins = bin<GenericObservation, number>()

Diff for: src/components/charts-generic/rangeplot/rangeplot-state.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ const useRangePlotState = ({
9999

100100
const colors = scaleLinear<string, string>()
101101
.domain(colorDomain)
102-
.range(chartPalette.diverging.GO)
102+
.range(chartPalette.diverging.GreenOrange)
103103
.interpolate(interpolateLab);
104104
const left = estimateTextWidth(
105105
yScale.domain().length > 1

Diff for: src/components/price-color-legend.tsx

+5-3
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ const ColorsLine = () => {
225225
borderTop: `${COLOR_HEIGHT / 2}px solid transparent`,
226226
borderBottom: `${COLOR_HEIGHT / 2}px solid transparent`,
227227
borderRight: `${COLOR_HEIGHT / 2}px solid ${
228-
chartPalette.diverging.GO[0]
228+
chartPalette.diverging.GreenOrange[0]
229229
}`,
230230
}}
231231
/>
@@ -238,7 +238,7 @@ const ColorsLine = () => {
238238
width: "100%",
239239
}}
240240
>
241-
{chartPalette.diverging.GO.map((bg, i) => (
241+
{chartPalette.diverging.GreenOrange.map((bg, i) => (
242242
<Box
243243
key={bg}
244244
sx={{
@@ -279,7 +279,9 @@ const ColorsLine = () => {
279279
borderTop: `${COLOR_HEIGHT / 2}px solid transparent`,
280280
borderBottom: `${COLOR_HEIGHT / 2}px solid transparent`,
281281
borderLeft: `${COLOR_HEIGHT / 2}px solid ${
282-
chartPalette.diverging.GO[chartPalette.diverging.GO.length - 1]
282+
chartPalette.diverging.GreenOrange[
283+
chartPalette.diverging.GreenOrange.length - 1
284+
]
283285
}`,
284286
}}
285287
/>

Diff for: src/domain/data.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export const useColorScale = ({
5757
const domain = [m * 0.85, m * 0.95, m * 1.05, m * 1.15];
5858
const scale = scaleThreshold<number, string>()
5959
.domain(domain)
60-
.range(chartPalette.diverging.GO);
60+
.range(chartPalette.diverging.GreenOrange);
6161

6262
return scale;
6363
}, [medianValue]);

Diff for: src/themes/index.d.ts

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import {
22
FederalBreakpointOverrides,
3-
FederalColor,
43
FederalTypographyPropsVariantOverrides,
54
FederalTypographyVariants,
65
FederalTypographyVariantsOptions,
@@ -52,7 +51,6 @@ declare module "@mui/material/styles" {
5251
interface BreakpointOverrides extends FederalBreakpointOverrides {}
5352

5453
interface Palette {
55-
cobalt: FederalColor & { main: string };
5654
tertiary: { main: string };
5755
}
5856

Diff for: src/themes/palette.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ import { type ThemeOptions } from "@mui/material";
44
export const palette = {
55
...colors,
66
text: {
7-
primary: colors.monochrome[800],
87
...colors.monochrome,
8+
primary: colors.monochrome[800],
99
},
1010
primary: {
11+
...colors.red,
1112
main: "#D8232A",
1213
contrastText: "#FFFFFF",
13-
...colors.red,
1414
},
1515
secondary: {
16-
main: colors.cobalt[700],
1716
...colors.cobalt,
17+
main: colors.cobalt[700],
1818
},
1919
tertiary: {
2020
main: colors.monochrome[800],
@@ -42,7 +42,7 @@ export const chartPalette = {
4242
pink: ["#FBCFE8", "#F9A8D4", "#F472B6", "#EC4899", "#DB2777", "#BE185D"],
4343
},
4444
diverging: {
45-
GO: ["#059669", "#34D399", "#E4D78C", "#FB923C", "#EA580C"],
46-
BP: ["#2563EB", "#60A5FA", "#CEC3DE", "#F472B6", "#DB2777"],
45+
GreenOrange: ["#059669", "#34D399", "#E4D78C", "#FB923C", "#EA580C"],
46+
BluePink: ["#2563EB", "#60A5FA", "#CEC3DE", "#F472B6", "#DB2777"],
4747
},
4848
};

Diff for: src/themes/shadows.ts

+28-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,30 @@
1-
import { e } from "@interactivethings/swiss-federal-ci";
1+
import { e as swissFederalCiShadows } from "@interactivethings/swiss-federal-ci";
22
import { Shadows } from "@mui/material/styles/shadows";
33

4-
export const shadows = Array.from({ length: 25 }, (_, i) => {
5-
const index = Math.floor(i / 4);
6-
return e[Math.min(index, e.length - 1)];
7-
}) as Shadows;
4+
export const shadows = [
5+
swissFederalCiShadows[1],
6+
swissFederalCiShadows[1],
7+
swissFederalCiShadows[1],
8+
swissFederalCiShadows[1],
9+
swissFederalCiShadows[1],
10+
swissFederalCiShadows[1],
11+
swissFederalCiShadows[1],
12+
swissFederalCiShadows[1],
13+
swissFederalCiShadows[1],
14+
swissFederalCiShadows[2],
15+
swissFederalCiShadows[2],
16+
swissFederalCiShadows[2],
17+
swissFederalCiShadows[2],
18+
swissFederalCiShadows[3],
19+
swissFederalCiShadows[3],
20+
swissFederalCiShadows[3],
21+
swissFederalCiShadows[3],
22+
swissFederalCiShadows[4],
23+
swissFederalCiShadows[4],
24+
swissFederalCiShadows[4],
25+
swissFederalCiShadows[4],
26+
swissFederalCiShadows[5],
27+
swissFederalCiShadows[5],
28+
swissFederalCiShadows[5],
29+
swissFederalCiShadows[5],
30+
] as Shadows;

0 commit comments

Comments
 (0)