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

Cocurricular transcript styling adjustments #1783

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

sofistonehouse
Copy link
Contributor

@sofistonehouse sofistonehouse commented Apr 25, 2023

Before:
image

After:
image

Mobile View:
image

@sofistonehouse
Copy link
Contributor Author

Not styled correctly on mobile but I will continue to work on that

@sofistonehouse sofistonehouse marked this pull request as draft April 25, 2023 20:17
@amos-cha amos-cha added the Visual Design UI Changes that are primarily visual rather than "functional" label Apr 26, 2023
@sofistonehouse sofistonehouse marked this pull request as ready for review April 29, 2023 20:55
@sofistonehouse sofistonehouse linked an issue Apr 30, 2023 that may be closed by this pull request
Comment on lines +31 to +36
<div className={styles.organization_role}>Leader ({formatDuration(leaderSessions)})</div>
</div>
)}
{memberSessions.length > 0 && (
<div className={styles.participation_line}>
<div className={styles.organization_role}>Member ({formatDuration(memberSessions)})</div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency and readability, it's probably best to format these the same as Advisor above.

Suggested change
<div className={styles.organization_role}>Leader ({formatDuration(leaderSessions)})</div>
</div>
)}
{memberSessions.length > 0 && (
<div className={styles.participation_line}>
<div className={styles.organization_role}>Member ({formatDuration(memberSessions)})</div>
<div className={styles.organization_role}>
Leader ({formatDuration(leaderSessions)})
</div>
</div>
)}
{memberSessions.length > 0 && (
<div className={styles.participation_line}>
<div className={styles.organization_role}>
Member ({formatDuration(memberSessions)})
</div>

Comment on lines +84 to +103
const formatFinalDuration = (sessionRecords: MembershipHistorySession[]) => {
const sessions = sessionRecords
.map((s) => sessionService.parseSessionCode(s.SessionCode))
.sort(compareAsc);

const intervalDescriptions: string[] = [];
let interval: MembershipInterval | undefined;

sessions.forEach((session) => {
if (interval === undefined) {
// If this is the first session, initialize interval.
interval = new MembershipInterval(session);
} else {
// Extend the interval.
interval.extendTo(session);
}
});

return interval?.toString();
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a lot of repeated code for doing something only slightly different from formatDuration(sessions).

Perhaps you could eliminate formatFinalDuration(...) and update the formatDuration(sessions) function to the following:

const formatDuration = (sessionRecords: MembershipHistorySession[], summarizeDates: bool = false) => {
...
    } else if (interval.consecutiveWith(session) || summarizeDates) {
...
  return intervalDescriptions.join(', ');
};

Then you could just call formatDuration(sessions, true) instead of formatFinalDuration(...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Visual Design UI Changes that are primarily visual rather than "functional"
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve readability/look of Transcript
4 participants