-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
790 allow plans with no concentration #803
base: main
Are you sure you want to change the base?
Changes from all commits
932274f
f7abdce
ca8f727
f8508b0
9b02be2
08092ed
e9f3394
febd2cd
740892d
8cd6018
388de8e
8ac9630
499a68d
f6e43d3
99012a6
e2fe2e3
d8f0363
f56972f
4eae90f
365cee7
5b7febb
25176b9
00df6a3
381cc90
7c51eb0
aa76a95
60ba70b
8c59fc0
ac10bcc
8afd28e
4152b28
f335de4
d318858
e195a16
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -541,6 +541,7 @@ | |
], | ||
"concentrations": { | ||
"minOptions": 1, | ||
|
||
"concentrationOptions": [ | ||
{ | ||
"type": "SECTION", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -319,7 +319,8 @@ export const AddPlanModal: React.FC<AddPlanModalProps> = ({ | |
name="concentration" | ||
placeholder="Select a Concentration" | ||
options={convertToOptionObjects( | ||
majorConcentrations.concentrations | ||
majorConcentrations.concentrations, | ||
true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you ever pass in false? Both times when you use convertToOptionObjects its true There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are other places in the codebase where it's used without a second param so it just defaults to false elsewhere. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
options={convertToOptionObjects(
extractSupportedMajorYears(supportedMajorsData)
)} should default to false |
||
)} | ||
control={control} | ||
rules={{ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import { ChevronDownIcon, ChevronUpIcon, WarningIcon } from "@chakra-ui/icons"; | ||
import { Box, Flex, Text, Collapse } from "@chakra-ui/react"; | ||
import { useState } from "react"; | ||
|
||
interface ErrorModalErrorProps { | ||
title: string; | ||
message: string; | ||
} | ||
|
||
export const ErrorModalError: React.FC<ErrorModalErrorProps> = ({ | ||
title, | ||
message, | ||
}) => { | ||
const [opened, setOpened] = useState(false); | ||
|
||
return ( | ||
<Box | ||
border="1px solid" | ||
borderColor="primary.red.main" | ||
borderRadius="lg" | ||
backgroundColor="#FAE8E7" | ||
transition="background-color 0.25s ease" | ||
_hover={{ backgroundColor: "#F9DAD8" }} | ||
> | ||
<Flex | ||
onClick={() => setOpened(!opened)} | ||
direction="row" | ||
justifyContent="space-between" | ||
alignItems="flex-start" | ||
height="45px" | ||
color="black" | ||
fontWeight="bold" | ||
p="sm" | ||
position="sticky" | ||
top="0px" | ||
zIndex={1} | ||
> | ||
<Flex direction="row" height="100%" columnGap="sm"> | ||
<Flex direction="row" height="100%" alignItems="center" gap="1"> | ||
<WarningIcon | ||
color="primary.red.main" | ||
width="2rem" | ||
alignSelf="center" | ||
alignItems="center" | ||
justifySelf="center" | ||
transition="background 0.15s ease" | ||
/> | ||
<Text color="black" mt="0" fontSize="sm"> | ||
{title} | ||
</Text> | ||
</Flex> | ||
</Flex> | ||
|
||
<Flex ml="xs" alignItems="center" justifyItems="center"> | ||
{opened ? ( | ||
<ChevronUpIcon boxSize="25px" color="primary.red.main" /> | ||
) : ( | ||
<ChevronDownIcon boxSize="25px" color="primary.red.main" /> | ||
)} | ||
</Flex> | ||
</Flex> | ||
|
||
<Collapse in={opened} animateOpacity> | ||
<Box px="sm" py="xs" borderRadius="lg" backgroundColor="transparent"> | ||
<Text fontSize="sm">{message}</Text> | ||
</Box> | ||
</Collapse> | ||
</Box> | ||
); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good comms!