Skip to content

Commit 38b904d

Browse files
committed
changed color of Select Context drop down text from white to 383838, gave unique keys to tab components to resolve unique key warning, changed currentContext, contextInput in CreateContainer to '' default
1 parent c877150 commit 38b904d

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

app/src/components/ContextAPIManager/ContextManager.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const ContextManager = (props): JSX.Element => {
4242
<TabContext value={value}>
4343
<Box sx={{ borderBottom: 1, borderColor: 'divider' }}>
4444
<TabList onChange={handleChange} centered={true} sx={{color:color}}>
45-
<Tab style={{ color: color }}label="Create/Edit" value="1" />
45+
<Tab style={{ color: color }} label="Create/Edit" value="1" />
4646
<Tab style={{ color: color }} label="Assign" value="2" />
4747
<Tab style={{ color: color }} label="Display" value="3" />
4848
</TabList>

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ import { RootState } from '../../../redux/store';
1515

1616
const CreateContainer = () => {
1717
const state = useSelector((store: RootState) => store.contextSlice);
18-
const [contextInput, setContextInput] = React.useState(null);
19-
const [currentContext, setCurrentContext] = React.useState(null);
18+
const [contextInput, setContextInput] = React.useState('');
19+
const [currentContext, setCurrentContext] = React.useState('');
2020
const [errorMsg, setErrorMsg] = React.useState('');
2121
const [errorStatus, setErrorStatus] = React.useState(false);
2222
const currentKeyValues = state.allContext.find(
@@ -79,7 +79,7 @@ const CreateContainer = () => {
7979
const handleDeleteContextClick = () => {
8080
dispatch(deleteContext({ name: currentContext }));
8181
setContextInput('');
82-
setCurrentContext(null);
82+
setCurrentContext('');
8383
};
8484

8585
console.log('state.allContext', state.allContext);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const AddContextForm = ({
6868
const contexts = allContext.length ? (
6969
allContext.map((context) => {
7070
return (
71-
<MenuItem style={{ color: color }} value={context.name}>
71+
<MenuItem style={{ color: '#383838'}} value={context.name}>
7272
{context.name}
7373
</MenuItem>
7474
);
@@ -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/DataTable.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,11 @@ export default function DataTable({ target, currentContext }) {
5151
style={{ color: 'black' }}
5252
component="th"
5353
scope="row"
54+
key={`${index}-key-${data.key}`}
5455
>
5556
{data.key}
5657
</StyledTableCell>
57-
<StyledTableCell style={{ color: 'black' }} align="right">
58+
<StyledTableCell style={{ color: 'black' }} align="right" key={`${index}-value-${data.value}`}>
5859
{data.value}
5960
</StyledTableCell>
6061
</StyledTableRow>

0 commit comments

Comments
 (0)