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

* feat: add more relevant links to the From the Team section

* feat: add CRXPages.ts

* chore: update to TS 4.9 satisfies

---------

Co-authored-by: doprz <52579214+doprz@users.noreply.github.com>
This commit is contained in:
Tony Dinh
2024-10-22 17:17:12 -05:00
committed by GitHub
parent 6f1afc5b25
commit 643ea13207
2 changed files with 43 additions and 10 deletions

View File

@@ -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;

View File

@@ -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';
@@ -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>
@@ -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' />