Skip to content

Commit 92328bc

Browse files
Updated colours (#862)
* * Specified Mantine "red" colours to be falconred from tailwind * Changed red and green colours to be Mantine "red" and "green" rather than directly accessing a tailwind colour. Hopefully I've got most things. * Removed "color={tailwindColors...." etc and replaced with mantine colours
1 parent 2acca2d commit 92328bc

18 files changed

Lines changed: 42 additions & 128 deletions

gcs/src/components/SingleRunWrapper.jsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,7 @@ export default function SingleRunWrapper({ children }) {
123123
fixes.
124124
</p>
125125
<div className="flex gap-x-2 mt-5">
126-
<Button
127-
component="a"
128-
onClick={closeForever}
129-
fullWidth
130-
color={tailwindColors.red[600]}
131-
>
126+
<Button component="a" onClick={closeForever} fullWidth color={"red"}>
132127
Skip update
133128
</Button>
134129
<Button

gcs/src/components/config/gripper.jsx

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ import {
1616
Tooltip,
1717
} from "@mantine/core"
1818

19-
// Styling Imports
20-
import resolveConfig from "tailwindcss/resolveConfig"
21-
import tailwindConfig from "../../../tailwind.config"
22-
const tailwindColors = resolveConfig(tailwindConfig).theme.colors
23-
2419
// Data
2520
import apmParamDefsCopter from "../../../data/gen_apm_params_def_copter.json"
2621
import apmParamDefsPlane from "../../../data/gen_apm_params_def_plane.json"
@@ -148,16 +143,10 @@ export default function Gripper() {
148143
overlayProps={{ blur: 2 }}
149144
/>
150145
<div className="flex flex-row gap-2">
151-
<Button
152-
onClick={() => setGripper("release")}
153-
color={tailwindColors.falconred[800]}
154-
>
146+
<Button onClick={() => setGripper("release")} color={"red"}>
155147
Release Gripper
156148
</Button>
157-
<Button
158-
onClick={() => setGripper("grab")}
159-
color={tailwindColors.falconred[800]}
160-
>
149+
<Button onClick={() => setGripper("grab")} color={"red"}>
161150
Grab Gripper
162151
</Button>
163152
</div>

gcs/src/components/config/motorTest.jsx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@ import { useEffect, useState } from "react"
99
// 3rd Party Imports
1010
import { Button, Modal, NumberInput } from "@mantine/core"
1111

12-
// Styling imports
13-
import resolveConfig from "tailwindcss/resolveConfig"
14-
import tailwindConfig from "../../../tailwind.config"
15-
const tailwindColors = resolveConfig(tailwindConfig).theme.colors
16-
1712
// Custom helper function
1813
import { MOTOR_LETTER_LABELS } from "../../helpers/mavlinkConstants"
1914

@@ -117,7 +112,7 @@ export default function MotorTestPanel() {
117112

118113
<div className="mx-auto">
119114
<Button
120-
color={tailwindColors.green[600]}
115+
color={"green"}
121116
onClick={() => dispatch(setShowMotorTestWarningModal(false))}
122117
>
123118
Continue
@@ -155,7 +150,6 @@ export default function MotorTestPanel() {
155150
onClick={() => {
156151
testOneMotor(index + 1)
157152
}}
158-
color={tailwindColors.blue[600]}
159153
>
160154
Test motor {motor}
161155
</Button>
@@ -164,7 +158,7 @@ export default function MotorTestPanel() {
164158
onClick={() => {
165159
testMotorSequence()
166160
}}
167-
color={tailwindColors.green[600]}
161+
color={"green"}
168162
label="x"
169163
>
170164
Test motor sequence
@@ -173,7 +167,7 @@ export default function MotorTestPanel() {
173167
onClick={() => {
174168
testAllMotors()
175169
}}
176-
color={tailwindColors.red[600]}
170+
color={"red"}
177171
>
178172
Test all motors
179173
</Button>

gcs/src/components/customMantineTheme.jsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,18 @@ export const CustomMantineTheme = createTheme({
2626
tailwindColors.falcongrey[900],
2727
tailwindColors.falcongrey[950],
2828
],
29+
red: [
30+
tailwindColors.falconred[100],
31+
tailwindColors.falconred[200],
32+
tailwindColors.falconred[300],
33+
tailwindColors.falconred[400],
34+
tailwindColors.falconred[500],
35+
tailwindColors.falconred[600],
36+
tailwindColors.falconred[700],
37+
tailwindColors.falconred[800],
38+
tailwindColors.falconred[900],
39+
tailwindColors.falconred[950],
40+
],
2941
},
3042
cursorType: "pointer",
3143
})

gcs/src/components/dashboard/preFlightChecklist/checkListArea.jsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ import EditCheckList from "./checkListEdit.jsx"
1313

1414
// Styling imports
1515
import { IconCheckbox, IconEdit, IconTrashX } from "@tabler/icons-react"
16-
import resolveConfig from "tailwindcss/resolveConfig"
17-
import tailwindConfig from "../../../../tailwind.config.js"
18-
const tailwindColors = resolveConfig(tailwindConfig).theme.colors
1916

2017
export default function CheckListArea({
2118
name,
@@ -182,14 +179,11 @@ export default function CheckListArea({
182179
withCloseButton={false}
183180
>
184181
<div className="flex w-full justify-between pt-4">
185-
<Button
186-
color={tailwindColors.red[600]}
187-
onClick={() => setDeleteModal(false)}
188-
>
182+
<Button color={"red"} onClick={() => setDeleteModal(false)}>
189183
No, cancel
190184
</Button>
191185
<Button
192-
color={tailwindColors.green[600]}
186+
color={"green"}
193187
onClick={() => deleteChecklist()}
194188
data-autofocus
195189
>

gcs/src/components/dashboard/preFlightChecklist/checkListEdit.jsx

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@ import ListItem from "@tiptap/extension-list-item"
1010
import { RichTextEditor } from "@mantine/tiptap"
1111
import { Node } from "@tiptap/core"
1212

13-
// Styling imports
14-
import resolveConfig from "tailwindcss/resolveConfig"
15-
import tailwindConfig from "../../../../tailwind.config.js"
16-
const tailwindColors = resolveConfig(tailwindConfig).theme.colors
17-
1813
export default function EditCheckList({
1914
opened,
2015
close,
@@ -97,7 +92,7 @@ export default function EditCheckList({
9792
editor={editor}
9893
classNames={{ content: "!list-disc" }}
9994
>
100-
{/*
95+
{/*
10196
Going to keep this for future use with code blocks, no need to delete.
10297
<RichTextEditor.Toolbar sticky stickyOffset={60}>
10398
<RichTextEditor.ControlsGroup>
@@ -117,15 +112,11 @@ export default function EditCheckList({
117112
generateCheckboxListString(true)
118113
}}
119114
variant="filled"
120-
color={tailwindColors.red[600]}
115+
color={"red"}
121116
>
122117
Cancel
123118
</Button>
124-
<Button
125-
type="submit"
126-
variant="filled"
127-
color={tailwindColors.green[600]}
128-
>
119+
<Button type="submit" variant="filled" color={"green"}>
129120
Save
130121
</Button>
131122
</div>

gcs/src/components/dashboard/tabsSectionTabs/actionTabsSection.jsx

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@ import { useEffect, useMemo, useState } from "react"
1010
import { Button, NumberInput, Popover, Select, Tabs } from "@mantine/core"
1111
import { useLocalStorage } from "@mantine/hooks"
1212

13-
// Styling imports
14-
import resolveConfig from "tailwindcss/resolveConfig"
15-
import tailwindConfig from "../../../../tailwind.config"
16-
const tailwindColors = resolveConfig(tailwindConfig).theme.colors
17-
1813
// Mavlink
1914
import { getFlightModeMap } from "../../../helpers/mavlinkConstants"
2015

@@ -174,11 +169,7 @@ const ArmTakeoffLandAction = () => {
174169
</Button>
175170

176171
{/** Reboot Button */}
177-
<Button
178-
onClick={rebootCallback}
179-
color={tailwindColors.red[600]}
180-
className="grow"
181-
>
172+
<Button onClick={rebootCallback} color={"red"} className="grow">
182173
Reboot FC
183174
</Button>
184175
</div>

gcs/src/components/dashboard/tabsSectionTabs/preFlightChecklistSection.jsx

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@ import CheckListArea from "../preFlightChecklist/checkListArea.jsx"
1717
import { AddCommand } from "../../spotlight/commandHandler.js"
1818

1919
// Styling imports
20-
import resolveConfig from "tailwindcss/resolveConfig"
21-
import tailwindConfig from "../../../../tailwind.config.js"
2220
import { showErrorNotification } from "../../../helpers/notification.js"
23-
const tailwindColors = resolveConfig(tailwindConfig).theme.colors
2421

2522
export default function PreFlightChecklistTab({ tabPadding }) {
2623
const [preFlightChecklistItems, setPreFlightChecklistItems] = useLocalStorage(
@@ -142,16 +139,10 @@ export default function PreFlightChecklistTab({ tabPadding }) {
142139
</div>
143140

144141
<div className="flex w-full justify-between pt-6">
145-
<Button
146-
color={tailwindColors.red[600]}
147-
onClick={() => setNewChecklistModal(false)}
148-
>
142+
<Button color={"red"} onClick={() => setNewChecklistModal(false)}>
149143
Cancel
150144
</Button>
151-
<Button
152-
color={tailwindColors.green[600]}
153-
onClick={() => createNewChecklist()}
154-
>
145+
<Button color={"green"} onClick={() => createNewChecklist()}>
155146
Create
156147
</Button>
157148
</div>

gcs/src/components/fla/chartDataCard.jsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,6 @@ import {
2020
setMessageFilters,
2121
} from "../../redux/slices/logAnalyserSlice.js"
2222

23-
// Styling imports
24-
import resolveConfig from "tailwindcss/resolveConfig"
25-
import tailwindConfig from "../../../tailwind.config.js"
26-
27-
const tailwindColors = resolveConfig(tailwindConfig).theme.colors
28-
2923
function ChartDataCard({ item, unit, messageMeans }) {
3024
const dispatch = useDispatch()
3125
const messageFilters = useSelector(selectMessageFilters)
@@ -86,7 +80,7 @@ function ChartDataCard({ item, unit, messageMeans }) {
8680
</p>
8781
<ActionIcon
8882
variant="subtle"
89-
color={tailwindColors.red[500]}
83+
color={"red"}
9084
onClick={() => removeDataset(item.label)}
9185
>
9286
<IconTrash size={18} />

gcs/src/components/fla/graph.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ export default function Graph({ data, openPresetModal }) {
444444
<MantineTooltip label="Clear Filters">
445445
<Button
446446
className="min-h-8 max-h-8"
447-
color={tailwindColors.red[500]}
447+
color={"red"}
448448
onClick={clearFilters}
449449
>
450450
Clear Filters
@@ -454,7 +454,7 @@ export default function Graph({ data, openPresetModal }) {
454454
<MantineTooltip label="Save Preset">
455455
<Button
456456
className="min-h-8 max-h-8"
457-
color={tailwindColors.green[600]}
457+
color={"green"}
458458
onClick={() => {
459459
openPresetModal()
460460
}}

0 commit comments

Comments
 (0)