Skip to content

Commit b476ae5

Browse files
committed
second level UI updates
1 parent 4c3cf60 commit b476ae5

5 files changed

Lines changed: 36 additions & 13 deletions

File tree

app/components/Occupied/Occupied.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import ServicesModal from '../../modals/ServicesModal/ServicesModal';
2222

2323
// STYLESHEETS
2424
import './styles.scss';
25-
25+
import lightAndDark from '../Styling';
2626
// // CONTEXT
2727
import { DashboardContext } from '../../context/DashboardContext';
2828
import { ApplicationContext } from '../../context/ApplicationContext';
@@ -38,7 +38,7 @@ import { useStylesLight, useStylesDark } from './helpers/muiHelper'
3838
//v10: Memoized function, without any props. Should theoretically be called only once.
3939
const Occupied = React.memo(() => {
4040
const { setServicesData, app, example } = useContext(ApplicationContext);
41-
const { user, applications, getApplications, mode } = useContext(DashboardContext);
41+
const { user, applications, getApplications, mode, } = useContext(DashboardContext);
4242
const [ modal,setModal ] = useState({isOpen:false,type:''})
4343
const { appIndex } = useContext(ApplicationContext);
4444
const [searchTerm, setSearchTerm] = useState<string>('');
@@ -51,6 +51,7 @@ const Occupied = React.memo(() => {
5151
}, [user]);
5252

5353
const classes = mode === 'light' ? useStylesLight({}) : useStylesDark({});
54+
const currentStyle = mode === 'light' ? lightAndDark.lightModal : lightAndDark.darkModal;
5455

5556
return (
5657
<div
@@ -75,10 +76,13 @@ const Occupied = React.memo(() => {
7576
>
7677
{!example &&
7778
<div
79+
7880
className="card"
7981
id="card-add"
82+
8083
>
8184
<Button
85+
style={currentStyle}
8286
className={classes.paper}
8387
onClick={() => setModal({isOpen:true,type:'envModal'})}
8488
>

app/components/Occupied/helpers/muiHelper.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ export const useStylesDark = makeStyles(theme => ({
1616
height: 280,
1717
width: 280,
1818
textAlign: 'center',
19-
color: '#888888',
19+
color: '#fafdf9',
2020
whiteSpace: 'nowrap',
21-
backgroundColor: 'lightgray',
21+
backgroundColor: '#262837',
2222
borderRadius: 3,
2323
border: '0',
2424
boxShadow: '0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19)',
2525
'&:hover, &.Mui-focusVisible': {
2626
backgroundColor: 'rgba(255, 255, 255, 0.2)',
27-
color: '#ffffff',
27+
color: '#fafdf9',
2828
fontWeight: 600,
2929
},
3030
},
@@ -54,7 +54,7 @@ export const useStylesDark = makeStyles(theme => ({
5454
fontSize: '18px',
5555
fontFamily: 'Roboto',
5656
fontWeight: 300,
57-
color: '#444d56',
57+
color: '#fafdf9',
5858
},
5959
}));
6060

@@ -70,9 +70,9 @@ export const useStylesLight = makeStyles(theme => ({
7070
height: 280,
7171
width: 280,
7272
textAlign: 'center',
73-
color: '#888888',
73+
color: '#E3E3F0',
7474
whiteSpace: 'nowrap',
75-
backgroundColor: 'white',
75+
backgroundColor: '#F7F8F8',
7676
borderRadius: 3,
7777
border: '0',
7878
boxShadow:

app/components/Styling.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,16 @@ const lightAndDark = {
3232
borderColor: 'transparent',
3333
},
3434
lightModeData: {
35-
backgroundColor: '#E7E7F2',
35+
backgroundColor: '#F7F8F8',
36+
color: '#24272A',
37+
},
38+
darkModal: {
39+
backgroundColor: '#262837',
40+
color: '#fafdf9',
41+
borderColor: 'transparent',
42+
},
43+
lightModal: {
44+
backgroundColor: '#F7F8F8',
3645
color: '#24272A',
3746
},
3847
};

app/modals/EnvModal/EnvModal.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,19 @@ import { Button, Typography } from '@mui/material';
33
import './EnvModal.scss';
44
import { CloudQueue, Computer } from '@mui/icons-material';
55
import { TModalSetter } from '../../components/Occupied/types/Occupied';
6+
import lightAndDark from '../../components/Styling';
7+
import { useContext } from 'react';
8+
import { DashboardContext } from '../../context/DashboardContext';
69

710
const EnvModal: React.FC<TModalSetter> = React.memo(
811
({ setModal}) => {
9-
12+
const { mode } = useContext(DashboardContext);
13+
const currentStyle = mode === 'light' ? lightAndDark.lightModeData : lightAndDark.darkModeData;
14+
1015
return (
11-
<div className="add-container">
16+
<div className="add-container" style={currentStyle}>
1217

13-
<div className="card" id="card-env">
18+
<div className="card" id="card-env" >
1419
<Button
1520
className="env-button"
1621
onClick={() => setModal({isOpen:true,type:'awsModal'})}

app/modals/ServicesModal/ServicesModal.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import React, { useContext, useEffect, useState } from 'react';
77
import { DashboardContext } from '../../context/DashboardContext'
88
import { ApplicationContext } from '../../context/ApplicationContext';
99
import './ServicesModal.scss';
10+
import lightAndDark from '../../components/Styling';
11+
1012

1113
import ServicesLink from './ServicesLink';
1214

@@ -20,6 +22,8 @@ interface ServicesModalProps {
2022
// v10: Seems to never have been updated for cloud-based info...
2123
// servicesModal is re-rendered depending on i and application passed in...
2224
const ServicesModal: React.FC<ServicesModalProps> = React.memo(({ i, app }) => {
25+
const { mode } = useContext(DashboardContext);
26+
const currentStyle = mode === 'light' ? lightAndDark.lightModeData : lightAndDark.darkModeData;
2327
//console.log('Hi, inside ServicesModal. Memoize function invoked in ServicesModal.');
2428
//console.log('ServicesModal current props (index, app): ', i, ' ', app);
2529

@@ -44,7 +48,7 @@ const ServicesModal: React.FC<ServicesModalProps> = React.memo(({ i, app }) => {
4448

4549

4650
return (
47-
<div className="servicesContainer">
51+
<div className="servicesContainer" style={currentStyle}>
4852
{!servicesData.length ? (
4953
<div className="loadingMessageModal">
5054
<h2 id="loadingMessage">Loading...</h2>
@@ -56,6 +60,7 @@ const ServicesModal: React.FC<ServicesModalProps> = React.memo(({ i, app }) => {
5660
<p>Select a server to monitor</p>
5761
</div>
5862
<ServicesLink
63+
5964
app={app}
6065
servicesData={servicesData}
6166
services={services}

0 commit comments

Comments
 (0)