Skip to content

Commit

Permalink
small cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
AaDalal committed Feb 25, 2024
1 parent ea40adf commit 2d9c53c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
5 changes: 4 additions & 1 deletion frontend/degree-plan/components/FourYearPlan/PlanPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,13 @@ export const PanelHeader = styled.div`
`;

export const PanelBody = styled.div`
padding: 10px;
padding: .5rem;
height: 100%;
overflow-y: auto;
flex-grow: 1;
display: flex;
flex-direction: column;
gap: .5rem;
`;

export const PanelContainer = styled.div`
Expand Down
30 changes: 15 additions & 15 deletions frontend/degree-plan/components/Requirements/ReqPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,30 +119,30 @@ const DegreeHeader = ({ degree, remove, setCollapsed, collapsed, editMode }: { d
)
}

const Degree = ({degree, rulesToFulfillments, activeDegreeplan, setSearchClosed, handleSearch, editMode, setModalKey, setModalObject}: any) => {
const Degree = ({degree, rulesToFulfillments, activeDegreeplan, editMode, setModalKey, setModalObject}: any) => {
const [collapsed, setCollapsed] = useState(false);

return (
<div>
<DegreeHeader
degree={degree}
key={degree.id}
remove={(id) => {
setModalObject(activeDegreeplan);
setModalKey("degree-remove");
}}
setCollapsed={setCollapsed}
collapsed={collapsed || editMode} // Collapse degree view in edit mode
editMode={editMode}
/>
degree={degree}
key={degree.id}
remove={() => {
setModalObject(activeDegreeplan);
setModalKey("degree-remove");
}}
setCollapsed={setCollapsed}
collapsed={collapsed || editMode} // Collapse degree view in edit mode
editMode={editMode}
/>
{!collapsed && !editMode &&
<DegreeBody>
{degree.rules.map((rule: any) => (
<RuleComponent
rulesToFulfillments={rulesToFulfillments}
activeDegreePlanId={activeDegreeplan.id}
rule={rule}
key={rule.id}
rulesToFulfillments={rulesToFulfillments}
activeDegreePlanId={activeDegreeplan.id}
rule={rule}
key={rule.id}
/>
))}
</DegreeBody>}
Expand Down

0 comments on commit 2d9c53c

Please sign in to comment.