Skip to content
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

Fixes for updating min values for hours spent and fixing moving page when favoriting libraries with wrapping text #623

Merged
merged 3 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions frontend/src/Components/ConvertSeconds.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
const convertSeconds = (secs: number) => {
const hours = Math.floor(secs / 3600);
const minutes = Math.floor((secs % 3600) / 60);
const seconds = Math.floor(secs % 60);

//removed seconds per #601 along with not using abbreviations
return hours
? { number: hours, label: `hr${hours === 1 ? '' : 's'}` }
: (minutes
? { number: minutes, label: `min${minutes === 1 ? '' : 's'}` }
: { number: seconds, label: `sec${seconds === 1 ? '' : 's'}` });
? { number: hours, label: `hour${hours === 1 ? '' : 's'}` }
: { number: minutes, label: `minute${minutes === 1 ? '' : 's'}` };
};

export default convertSeconds;
14 changes: 8 additions & 6 deletions frontend/src/Components/OpenContentItemAccordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,14 @@ export default function OpenContentItemAccordion({
activeKey === title ? 'max-h-[800px]' : 'max-h-0'
}`}
>
{contentItems.map((item) => (
<OpenContentCard
key={item.content_id}
content={item}
/>
))}
<div className="flex flex-col gap-4">
{contentItems.map((item) => (
<OpenContentCard
key={item.content_id}
content={item}
/>
))}
</div>
</div>
</div>
))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default function ResidentWeeklyActivityTable({
<thead>
<tr className="flex flex-row justify-between border border-x-0 border-t-0 mt-2">
<th className="body text-grey-4">Course Name</th>
<th className="body text-grey-4">Hours Spent</th>
<th className="body text-grey-4">Time Spent</th>
</tr>
</thead>
<tbody className="flex flex-col gap-4 mt-4 overflow-auto h-36 scrollbar">
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/Pages/MyProgress.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export default function MyProgress() {
<tr className="flex flex-row justify-between border border-x-0 border-t-0 body text-grey-4 text-left">
<th className="w-1/2">Course Name</th>
<th className="w-1/5">Status</th>
<th className="w-1/5">Hours Spent</th>
<th className="w-1/5">Time Spent</th>
</tr>
</thead>
<tbody className="flex flex-col gap-4 mt-4">
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/Pages/StudentLayer1.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export default function StudentLayer1() {
</div>
</div>
{/* right sidebar */}
<div className="min-w-[300px] border-l border-grey-1 flex flex-col gap-6 px-6 py-4">
<div className="min-w-[390px] border-l border-grey-1 flex flex-col gap-6 px-6 py-4">
<h2>Favorites</h2>
<div className="space-y-3 w-full">
{favorites?.data && favorites.data.length > 0 ? (
Expand Down
Loading