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 Text from '@views/components/common/Text/Text';
import clsx from 'clsx'; import clsx from 'clsx';
import React from 'react'; import React from 'react';
@@ -13,26 +15,41 @@ interface LinkItem {
url: string; url: string;
} }
const links: LinkItem[] = [ const links = [
// { {
// text: 'Feedback Form', text: 'Rate us on Chrome Web Store',
// url: '#', url: 'https://chromewebstore.google.com/detail/ut-registration-plus/hboadpjkoaieogjimneceaahlppnipaa',
// }, },
// { {
// text: 'Apply to Longhorn Developers', text: 'Send us Feedback & Ideas',
// url: '#', url: CRX_PAGES.REPORT,
// }, },
{ {
text: 'Become a Beta Tester', text: 'Become a Beta Tester',
url: 'https://forms.gle/Y9dmQAb1yzW5PRg48', 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 * The "From The Team" section of the calendar website
* @returns * @returns
*/ */
export default function TeamLinks({ className }: Props): JSX.Element { 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 ( return (
<article className={clsx(className, 'flex flex-col gap-2')}> <article className={clsx(className, 'flex flex-col gap-2')}>
<Text variant='h3'>From the Team</Text> <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' className='flex items-center gap-0.5 text-ut-burntorange underline-offset-2 hover:underline'
target='_blank' target='_blank'
rel='noreferrer' rel='noreferrer'
onClick={event => handleClick(link, event)}
> >
<Text variant='p'>{link.text}</Text> <Text variant='p'>{link.text}</Text>
<OutwardArrowIcon className='h-3 w-3' /> <OutwardArrowIcon className='h-3 w-3' />