Skip to content

Commit 4b16ba3

Browse files
committed
Merge branch 'dev' of https://github.com/oslabs-beta/ReacType into dev
2 parents d9395b8 + 89fc1e3 commit 4b16ba3

40 files changed

+4350
-4787
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,7 @@ server/RootCA.srl
498498

499499

500500
# End of https://www.gitignore.io/api/node,linux,macos,windows,visualstudio,yarn
501+
501502
/test-results/
502503
/playwright-report/
503504
/playwright/.cache/

.travis.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

__tests__/playwright/example.spec.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
import { test, expect } from '@playwright/test';
1+
// import { test, expect } from '@playwright/test';
22

3-
test('has title', async ({ page }) => {
4-
await page.goto('https://app.reactype.dev/#/');
3+
// test('has title', async ({ page }) => {
4+
// await page.goto('https://app.reactype.dev/#/');
55

6-
// Expect a title "to contain" a substring.
7-
await expect(page).toHaveTitle('ReacType');
8-
});
6+
// // Expect a title "to contain" a substring.
7+
// await expect(page).toHaveTitle('ReacType');
8+
// });
99

10-
test('get started link', async ({ page }) => {
11-
await page.goto('https://playwright.dev/');
10+
// test('get started link', async ({ page }) => {
11+
// await page.goto('https://playwright.dev/');
1212

13-
// Click the get started link.
14-
await page.getByRole('link', { name: 'Get started' }).click();
13+
// // Click the get started link.
14+
// await page.getByRole('link', { name: 'Get started' }).click();
1515

16-
// Expects the URL to contain intro.
17-
await expect(page).toHaveURL(/.*intro/);
18-
});
16+
// // Expects the URL to contain intro.
17+
// await expect(page).toHaveURL(/.*intro/);
18+
// });

app/src/components/ContextAPIManager/AssignTab/components/ComponentDropDrown.tsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,10 @@ const ComponentDropDown = ({
1212
componentInput,
1313
setComponentInput
1414
}) => {
15-
const { state, isDarkMode } = useSelector((store: RootState) => ({
16-
state: store.appState,
17-
isDarkMode: store.darkMode.isDarkMode
15+
const { state } = useSelector((store: RootState) => ({
16+
state: store.appState
1817
}));
19-
const color = isDarkMode ? 'white' : 'black';
18+
2019
const onChange = (event, newValue) => {
2120
if (typeof newValue === 'string') {
2221
setComponentInput({
@@ -36,7 +35,6 @@ const ComponentDropDown = ({
3635
};
3736

3837
const filterOptions = (options, params) => {
39-
// setBtnDisabled(true);
4038
const filtered = filter(options, params);
4139
const { inputValue } = params;
4240
// Suggest the creation of a new contextInput
@@ -46,8 +44,6 @@ const ComponentDropDown = ({
4644
inputValue,
4745
name: `Add "${inputValue}"`
4846
});
49-
50-
// setBtnDisabled(false);
5147
}
5248

5349
return filtered;
@@ -67,7 +63,7 @@ const ComponentDropDown = ({
6763
};
6864

6965
const renderOption = (props, option) => (
70-
<li style={{ color: 'black', backgroundColor: 'none'}} {...props}>
66+
<li style={{ color: 'black', backgroundColor: 'none' }} {...props}>
7167
{option.name}
7268
</li>
7369
);

app/src/components/ContextAPIManager/AssignTab/components/ContextDropDown.tsx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ const ContextDropDown = ({
1515
}) => {
1616
const { allContext } = contextStore;
1717

18-
const isDarkMode = useSelector(
19-
(store: RootState) => store.darkMode.isDarkMode
20-
);
21-
const color = isDarkMode ? 'white' : 'black';
2218
const onChange = (event, newValue) => {
2319
if (typeof newValue === 'string') {
2420
setContextInput({
@@ -38,7 +34,6 @@ const ContextDropDown = ({
3834
};
3935

4036
const filterOptions = (options, params) => {
41-
// setBtnDisabled(true);
4237
const filtered = filter(options, params);
4338
const { inputValue } = params;
4439
// Suggest the creation of a new contextInput
@@ -48,8 +43,6 @@ const ContextDropDown = ({
4843
inputValue,
4944
name: `Add "${inputValue}"`
5045
});
51-
52-
// setBtnDisabled(false);
5346
}
5447

5548
return filtered;

app/src/components/ContextAPIManager/AssignTab/components/ContextTable.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ const rows = [
4545
createData('Cupcake', 305, 3.7, 67, 4.3),
4646
createData('Gingerbread', 356, 16.0, 49, 3.9)
4747
];
48-
{
49-
/* <Table style={{ width: 400, margin: 'auto' }}></Table> */
50-
}
48+
5149
export default function ContextTable() {
5250
return (
5351
<TableContainer component={Paper}>

app/src/components/ContextAPIManager/ContextManager.tsx

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useContext } from 'react';
1+
import React, { useContext } from 'react';
22
import { makeStyles } from '@mui/styles';
33
import Box from '@mui/material/Box';
44
import Tab from '@mui/material/Tab';
@@ -9,39 +9,40 @@ import TabPanel from '@mui/lab/TabPanel';
99
import CreateContainer from './CreateTab/CreateContainer';
1010
import AssignContainer from './AssignTab/AssignContainer';
1111
import DisplayContainer from './DisplayTab/DisplayContainer';
12-
import { useSelector } from 'react-redux'
12+
import { useSelector } from 'react-redux';
1313
import { RootState } from '../../redux/store';
1414

15-
1615
const useStyles = makeStyles({
1716
contextContainer: {
1817
backgroundColor: '#191919',
19-
height: 'fit-content',
18+
height: 'fit-content'
2019
}
2120
});
2221

2322
const ContextManager = (props): JSX.Element => {
24-
const { isDarkMode, style } = useSelector((store:RootState) => ({
25-
isDarkMode: store.darkMode.isDarkMode,
23+
const { style } = useSelector((store: RootState) => ({
2624
style: store.styleSlice
2725
}));
2826
const classes = useStyles();
2927
const [value, setValue] = React.useState<string>('1');
30-
28+
3129
const handleChange = (event: React.SyntheticEvent, newValue: string) => {
3230
setValue(newValue);
3331
};
3432

35-
const background_Color = isDarkMode ? '#21262b' : 'white'
36-
const color = isDarkMode ? 'white' : 'white'
33+
const color = 'white';
3734

3835
return (
3936
<React.Fragment>
4037
<div className={classes.contextContainer} style={style.style}>
4138
<Box sx={{ width: '100%', typography: 'body1' }}>
4239
<TabContext value={value}>
4340
<Box sx={{ borderBottom: 1, borderColor: 'divider' }}>
44-
<TabList onChange={handleChange} centered={true} sx={{color:color}}>
41+
<TabList
42+
onChange={handleChange}
43+
centered={true}
44+
sx={{ color: color }}
45+
>
4546
<Tab style={{ color: color }} label="Create/Edit" value="1" />
4647
<Tab style={{ color: color }} label="Assign" value="2" />
4748
<Tab style={{ color: color }} label="Display" value="3" />
@@ -63,4 +64,4 @@ const ContextManager = (props): JSX.Element => {
6364
);
6465
};
6566

66-
export default ContextManager;
67+
export default ContextManager;

app/src/components/ContextAPIManager/CreateTab/components/AddContextForm.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ const AddContextForm = ({
2525
const { allContext } = contextStore;
2626
const [btnDisabled, setBtnDisabled] = useState(false);
2727
const [open, setOpen] = useState(false);
28-
const { state, isDarkMode } = useSelector((store: RootState) => ({
29-
isDarkMode: store.darkMode.isDarkMode,
28+
const { state } = useSelector((store: RootState) => ({
3029
state: store.appState
3130
}));
32-
const color = isDarkMode ? 'black' : 'white';
31+
32+
const color = 'white';
3333

3434
//handler for submitting new context for creation
3535
const handleSubmit = () => {
@@ -67,7 +67,7 @@ const AddContextForm = ({
6767
const contexts = allContext.length ? (
6868
allContext.map((context, index) => {
6969
return (
70-
<MenuItem style={{ color: '#383838'}} value={context.name} key={index}>
70+
<MenuItem style={{ color: '#383838' }} value={context.name} key={index}>
7171
{context.name}
7272
</MenuItem>
7373
);
@@ -99,7 +99,7 @@ const AddContextForm = ({
9999
/>
100100
<Snackbar
101101
open={open && !errorStatus}
102-
anchorOrigin={{ vertical: 'top', horizontal: 'center' }}
102+
anchorOrigin={{ vertical: 'top', horizontal: 'center' }}
103103
autoHideDuration={3000}
104104
onClose={handleClose}
105105
>
@@ -129,7 +129,7 @@ const AddContextForm = ({
129129
<Select
130130
required
131131
sx={{ width: 425 }}
132-
style={{ border: '1px solid #0099e6', color: color}}
132+
style={{ border: '1px solid #0099e6', color: color }}
133133
value={currentContext}
134134
label="Select Context"
135135
MenuProps={{ disablePortal: true }}

app/src/components/ContextAPIManager/CreateTab/components/AddDataForm.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const AddDataForm = ({ handleClickInputData, currentContext }) => {
1010
//const [contextInput, setContextInput] = React.useState(null);
1111
const defaultInputData = { inputKey: '', inputValue: '' };
1212
const [dataContext, setDataContext] = React.useState(defaultInputData);
13-
const { isDarkMode } = useSelector((store: RootState) => store.darkMode);
13+
1414
const saveData = () => {
1515
setDataContext(defaultInputData);
1616
if (dataContext.inputKey === '' || dataContext.inputValue === '') {
@@ -19,7 +19,7 @@ const AddDataForm = ({ handleClickInputData, currentContext }) => {
1919
}
2020
handleClickInputData(currentContext, dataContext);
2121
};
22-
const color = isDarkMode ? 'black' : 'white';
22+
const color = 'white';
2323

2424
const handleChange = (e) => {
2525
setDataContext((prevDataContext) => {

0 commit comments

Comments
 (0)