Skip to content

Commit

Permalink
feat: add more relevant links to the From the Team section (#380)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
tonydnh and doprz authored Oct 22, 2024
1 parent 6f1afc5 commit 643ea13
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 10 deletions.
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

0 comments on commit 643ea13

Please sign in to comment.