Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 9c79f7e
Author: Aaron Chan <[email protected]>
Date:   Tue Nov 12 22:35:23 2024 -0800

    fix: add support for multi word names and support accent a in font

commit 73a3e56
Merge: f05a574 eea9b48
Author: Aaron Chan <[email protected]>
Date:   Tue Nov 12 16:59:52 2024 -0800

    Merge branch 'develop' of https://github.com/ucsddesignco/stride2024 into develop

commit f05a574
Author: Aaron Chan <[email protected]>
Date:   Tue Nov 12 16:12:44 2024 -0800

    feat: account for longer names for badge
  • Loading branch information
aaronchan32 committed Nov 13, 2024
1 parent d78accd commit 0b27376
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 3 deletions.
Binary file modified public/fonts/Iosevka-Curly-SemiBoldItalic.woff2
Binary file not shown.
5 changes: 5 additions & 0 deletions src/app/badge/[slug]/ViewBadge.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
padding-inline: var(--main-padding);
position: relative;

h1,
p {
margin-inline: auto;
}

#mascot-badge-container {
aspect-ratio: 252/378;
width: 100%;
Expand Down
3 changes: 1 addition & 2 deletions src/app/badge/[slug]/findBadge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ export async function getUser(url: string) {
const userInfo = await User.findOne({ url }, { email: 0 }).lean();

if (!userInfo) {
return { error: 'User not found' };
return { error: 'User Not Found' };
}

return userInfo;
} catch (error) {
console.error(error);
throw new Error('Failed to find user');
}
}
1 change: 1 addition & 0 deletions src/app/badge/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export default async function ViewBadge({
return (
<main id="view-badge-page">
<h1>{data.error}</h1>
<p>Please contact [email protected] for assistance.</p>
</main>
);
}
Expand Down
5 changes: 4 additions & 1 deletion src/components/Register/MascotBadge/MascotBadge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ const DEFAULT_VALUES = {
const parseFormData = (formData: TFormData): ParsedFormData => {
const name = formData.name || DEFAULT_VALUES.name;
const pronouns = formData.pronouns || DEFAULT_VALUES.pronouns;
const [firstName, lastName] = name.split(' ');
const lastNameIndex = name.indexOf(' ');
const firstName = name.substring(0, lastNameIndex);
const lastName = name.substring(lastNameIndex + 1);

let [firstPronoun, secondPronoun] = pronouns.split(' ');
if (pronouns.includes('/')) {
[firstPronoun, secondPronoun] = pronouns
Expand Down

0 comments on commit 0b27376

Please sign in to comment.