Refactor color selection to use context and extract assignation function
This commit is contained in:
@@ -36,4 +36,26 @@ export const SessionContext = createContext<{
|
||||
planMode: false,
|
||||
togglePlanMode: () => {},
|
||||
piPrices: undefined,
|
||||
})
|
||||
export type ColorContextType = {
|
||||
defaultColor: string;
|
||||
expiredColor: string;
|
||||
twoHoursColor: string;
|
||||
fourHoursColor: string;
|
||||
eightHoursColor: string;
|
||||
twelveHoursColor: string;
|
||||
dayColor: string;
|
||||
twoDaysColor: string;
|
||||
|
||||
}
|
||||
export const ColorContext = createContext<ColorContextType>({
|
||||
defaultColor: '#006596',
|
||||
expiredColor: '#AB324A',
|
||||
twoHoursColor: '#9C4438',
|
||||
fourHoursColor: '#765B21',
|
||||
eightHoursColor: '#63620D',
|
||||
twelveHoursColor: '#2C6C2F',
|
||||
dayColor: '#2F695A',
|
||||
twoDaysColor: '#2F695A',
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user