Skip to content
Snippets Groups Projects
Commit 82b160bf authored by Max Frederiksen's avatar Max Frederiksen
Browse files

Merge branch 'CE-3691-lab-environment-appbar' into 'main'

CE-3691: Add lab environment color

See merge request !219
parents a2fe13d1 5f709af7
No related branches found
Tags 16.1.0
1 merge request!219CE-3691: Add lab environment color
Pipeline #218020 passed
{ {
"name": "@ess-ics/ce-ui-common", "name": "@ess-ics/ce-ui-common",
"version": "16.0.0", "version": "16.1.0",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@ess-ics/ce-ui-common", "name": "@ess-ics/ce-ui-common",
"version": "16.0.0", "version": "16.1.0",
"dependencies": { "dependencies": {
"@fontsource/titillium-web": "^5.0.22", "@fontsource/titillium-web": "^5.0.22",
"@mui/x-data-grid-pro": "^6.5.0", "@mui/x-data-grid-pro": "^6.5.0",
......
{ {
"name": "@ess-ics/ce-ui-common", "name": "@ess-ics/ce-ui-common",
"version": "16.0.0", "version": "16.1.0",
"private": true, "private": true,
"type": "module", "type": "module",
"main": "dist/index.js", "main": "dist/index.js",
......
...@@ -34,6 +34,18 @@ const defaultStyle = ({ theme }: StyleProps) => ({ ...@@ -34,6 +34,18 @@ const defaultStyle = ({ theme }: StyleProps) => ({
} }
}); });
const getEnvColor = (theme: Theme, environment: Environment) => {
if (environment === "PROD") {
return theme.palette.environment.production.main;
}
if (environment === "LAB") {
return theme.palette.environment.lab.main;
}
return theme.palette.environment.development.main;
};
export const ButtonAppBar = styled( export const ButtonAppBar = styled(
({ ({
title, title,
...@@ -53,8 +65,7 @@ export const ButtonAppBar = styled( ...@@ -53,8 +65,7 @@ export const ButtonAppBar = styled(
<Toolbar <Toolbar
className="CeuiButtonAppBar-Toolbar" className="CeuiButtonAppBar-Toolbar"
sx={{ sx={{
background: (theme) => background: (theme) => getEnvColor(theme, environment)
`${environment === "PROD" ? theme.palette.environment.production.main : theme.palette.environment.development.main}`
}} }}
> >
<div className="CeuiButtonAppBar-HomeBox">{defaultHomeButton}</div> <div className="CeuiButtonAppBar-HomeBox">{defaultHomeButton}</div>
......
...@@ -2,5 +2,6 @@ export enum Environment { ...@@ -2,5 +2,6 @@ export enum Environment {
LOCAL = "LOCAL", LOCAL = "LOCAL",
DEMO = "DEMO", DEMO = "DEMO",
TEST = "TEST", TEST = "TEST",
PROD = "PROD" PROD = "PROD",
LAB = "LAB"
} }
...@@ -11,7 +11,7 @@ export default { ...@@ -11,7 +11,7 @@ export default {
export const Default = (args) => <AlertBanner {...args} />; export const Default = (args) => <AlertBanner {...args} />;
Default.args = { Default.args = {
type: "warning", type: "WARNING",
message: "Your custom message here" message: "Your custom message here"
}; };
...@@ -32,15 +32,15 @@ ManyAlerts.argTypes = { ...@@ -32,15 +32,15 @@ ManyAlerts.argTypes = {
ManyAlerts.args = { ManyAlerts.args = {
alerts: [ alerts: [
{ {
type: "info", type: "INFO",
message: "Your info message here" message: "Your info message here"
}, },
{ {
type: "warning", type: "WARNING",
message: "Your warning message here" message: "Your warning message here"
}, },
{ {
type: "error", type: "ERROR",
message: "Your error message here", message: "Your error message here",
link: "#" link: "#"
} }
......
...@@ -18,7 +18,8 @@ export default { ...@@ -18,7 +18,8 @@ export default {
Environment.PROD, Environment.PROD,
Environment.TEST, Environment.TEST,
Environment.DEMO, Environment.DEMO,
Environment.LOCAL Environment.LOCAL,
Environment.LAB
], ],
control: { type: "radio" } control: { type: "radio" }
} }
......
...@@ -26,6 +26,7 @@ export default { ...@@ -26,6 +26,7 @@ export default {
environment: { environment: {
options: [ options: [
Environment.PROD, Environment.PROD,
Environment.LAB,
Environment.TEST, Environment.TEST,
Environment.DEMO, Environment.DEMO,
Environment.LOCAL Environment.LOCAL
......
...@@ -32,6 +32,7 @@ declare module "@mui/material/styles" { ...@@ -32,6 +32,7 @@ declare module "@mui/material/styles" {
essNavy: Palette["primary"]; essNavy: Palette["primary"];
environment: { environment: {
production: Palette["primary"]; production: Palette["primary"];
lab: Palette["primary"];
development: Palette["primary"]; development: Palette["primary"];
}; };
} }
...@@ -47,6 +48,7 @@ declare module "@mui/material/styles" { ...@@ -47,6 +48,7 @@ declare module "@mui/material/styles" {
essNavy: Palette["primary"]; essNavy: Palette["primary"];
environment: { environment: {
production: Palette["primary"]; production: Palette["primary"];
lab: Palette["primary"];
development: Palette["primary"]; development: Palette["primary"];
}; };
} }
...@@ -128,6 +130,12 @@ theme = createTheme(theme, { ...@@ -128,6 +130,12 @@ theme = createTheme(theme, {
}, },
name: "production" name: "production"
}), }),
lab: theme.palette.augmentColor({
color: {
main: theme.palette.essNavy.main
},
name: "lab"
}),
development: theme.palette.augmentColor({ development: theme.palette.augmentColor({
color: { color: {
main: theme.palette.essOrange.main main: theme.palette.essOrange.main
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment