Skip to content

Commit

Permalink
Merge pull request #6 from marcusfrdk/development
Browse files Browse the repository at this point in the history
Some changes and fixes
  • Loading branch information
marcusfrdk authored Sep 1, 2024
2 parents b9aafbe + 596104f commit eee754a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions app/components/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ export default function Menu({isOpen, setIsOpen}: Props){
<>
<Container className={isOpen ? "open" : ""}>
<CloseContainer>
<div>
<div className="ellipsis">
<p className="ellipsis">{selectedProgram?.name}</p>
<p>{(selectedProgram?.code || "") + selectedProgram?.semester}</p>
<p className="ellipsis">{(selectedProgram?.code || "") + selectedProgram?.semester}</p>
</div>
<div onClick={() => setIsOpen(false)}>
<MenuIconClose size="75%" fill="var(--muted)" />
Expand Down
4 changes: 2 additions & 2 deletions app/components/MenuChange.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ export default function MenuChange(){
<h2>Ändra Program</h2>

<Select>
<p>{selectedProgram !== null ? selectedProgram.code + selectedProgram.semester : "Select program"}</p>
<p>{selectedProgram !== null ? selectedProgram.code + selectedProgram.semester : "Välj program"}</p>
<div>
<ChevronDown fill="var(--weak)" />
</div>
<select onChange={(e) => updateSelectedProgram(e.target.value)}>
<select defaultValue={selectedProgram ? selectedProgram?.code + selectedProgram?.semester : ""} onChange={(e) => updateSelectedProgram(e.target.value)}>
{Object.entries(programs).sort().map(([code, semesters]) => {
return (
<optgroup key={code} label={code}>
Expand Down
3 changes: 1 addition & 2 deletions app/components/MenuCompare.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ export default function MenuCompare(){
<div>
<AddIcon size="1.25rem" fill="var(--muted)" />
</div>
<select defaultValue="default" onChange={(e) => addComparison(e.target.value)}>
<option disabled value="default">Select from {Object.keys(programs).length} programs</option>
<select defaultChecked defaultValue={selectedProgram ? selectedProgram?.code + selectedProgram?.semester : ""} onChange={(e) => addComparison(e.target.value)}>
{Object.entries(programs).sort().map(([code, semesters]) => {
return (
<optgroup key={code} label={code}>
Expand Down
4 changes: 3 additions & 1 deletion app/components/Schedule.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,9 @@ export default function Schedule(){
code = "code";
}

const hasPrerequisites = course.prerequisites && (course.prerequisites.includes("avklar") || course.prerequisites.includes("genom"));
const prerequisites = course ? course.prerequisites.toLowerCase() : "";
const keywords = ["avkl"];
const hasPrerequisites = prerequisites && keywords.some(keyword => prerequisites.includes(keyword));

return (
<li
Expand Down
2 changes: 1 addition & 1 deletion app/components/SelectInitialProgram.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default function SelectInitialProgram(){
</div>
<Select>
<p>Välj ditt program</p>
<select defaultValue="default" onChange={handleSelection}>
<select defaultChecked defaultValue="default" onChange={handleSelection}>
<option disabled value="default">Välj bland {Object.keys(programs).length} program</option>
{Object.entries(programs).sort().map(([code, semesters]) => {
return (
Expand Down

0 comments on commit eee754a

Please sign in to comment.