Skip to content

Commit 8fd35ec

Browse files
committed
Switch syntax for error triggering
1 parent 30e92c4 commit 8fd35ec

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

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

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,19 @@ const CreateContainer = () => {
5454

5555
const triggerError = (type: String) => {
5656
setErrorStatus(true);
57-
if (type === 'empty') {
58-
setErrorMsg('Context name cannot be blank.');
59-
} else if (type === 'dupe') {
60-
setErrorMsg('Context name already exists.');
61-
} else if (type === 'letters') {
62-
setErrorMsg('Context name must start with a letter.');
63-
} else if (type === 'symbolsDetected') {
64-
setErrorMsg('Context name must not contain symbols.');
57+
switch (type) {
58+
case 'empty':
59+
setErrorMsg('Context name cannot be blank.');
60+
break;
61+
case 'dupe':
62+
setErrorMsg('Context name already exists.');
63+
break;
64+
case 'letters':
65+
setErrorMsg('Context name must start with a letter.');
66+
break;
67+
case 'symbolsDetected':
68+
setErrorMsg('Context name must not contain symbols.');
69+
break;
6570
}
6671
};
6772

app/src/components/bottom/BottomTabs.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -198,12 +198,12 @@ const useStyles = makeStyles((theme) => ({
198198
}
199199
},
200200
tabSelected: {},
201-
// typography: {
202-
// padding: theme.spacing(3)
203-
// // },
204-
// padding: {
205-
// padding: `0 ${theme.spacing(2)}`
206-
// },
201+
typography: {
202+
padding: '24px'
203+
},
204+
padding: {
205+
padding: `0 16px`
206+
},
207207
switch: {
208208
marginRight: '10px',
209209
marginTop: '2px'

0 commit comments

Comments
 (0)