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

feat: add more relevant links to the From the Team section #380

Merged
merged 3 commits into from
Oct 22, 2024
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
15 changes: 15 additions & 0 deletions src/shared/types/CRXPages.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* An object containing the paths to various pages used in the CRX application.
*/
export const CRX_PAGES = {
DEBUG: '/debug.html',
CALENDAR: '/calendar.html',
OPTIONS: '/options.html',
REPORT: '/report.html',
} as const;

/**
* Represents a type that corresponds to the keys of the `CRX_PAGES` object.
* This type is used to ensure that only valid page keys are used within the application.
*/
export type CRX_Page = keyof typeof CRX_PAGES;
38 changes: 28 additions & 10 deletions src/views/components/calendar/TeamLinks.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { CRX_PAGES } from '@shared/types/CRXPages';
import { openReportWindow } from '@shared/util/openReportWindow';
import Text from '@views/components/common/Text/Text';
import clsx from 'clsx';
import React from 'react';
Expand All @@ -13,26 +15,41 @@ interface LinkItem {
url: string;
}

const links: LinkItem[] = [
// {
// text: 'Feedback Form',
// url: '#',
// },
// {
// text: 'Apply to Longhorn Developers',
// url: '#',
// },
const links = [
{
text: 'Rate us on Chrome Web Store',
url: 'https://chromewebstore.google.com/detail/ut-registration-plus/hboadpjkoaieogjimneceaahlppnipaa',
},
{
text: 'Send us Feedback & Ideas',
url: CRX_PAGES.REPORT,
},
{
text: 'Become a Beta Tester',
url: 'https://forms.gle/Y9dmQAb1yzW5PRg48',
},
];
{
text: 'Credits – Meet the team',
url: CRX_PAGES.OPTIONS,
},
{
text: 'Apply to Longhorn Developers',
url: 'https://forms.gle/cdkLKmFwPmvHmiBe9',
},
] as const satisfies LinkItem[];

/**
* The "From The Team" section of the calendar website
* @returns
*/
export default function TeamLinks({ className }: Props): JSX.Element {
const handleClick = (link: LinkItem, event: React.MouseEvent) => {
if (link.url === CRX_PAGES.REPORT) {
event.preventDefault();
openReportWindow();
}
};

return (
<article className={clsx(className, 'flex flex-col gap-2')}>
<Text variant='h3'>From the Team</Text>
Expand All @@ -43,6 +60,7 @@ export default function TeamLinks({ className }: Props): JSX.Element {
className='flex items-center gap-0.5 text-ut-burntorange underline-offset-2 hover:underline'
target='_blank'
rel='noreferrer'
onClick={event => handleClick(link, event)}
>
<Text variant='p'>{link.text}</Text>
<OutwardArrowIcon className='h-3 w-3' />
Expand Down
Loading