From 8c897a319791e2347979d531de507cb97ded916f Mon Sep 17 00:00:00 2001 From: Derek Chen Date: Sat, 12 Oct 2024 00:21:07 -0500 Subject: [PATCH 1/9] feat: update component!!! --- src/views/components/common/UpdateText.tsx | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/views/components/common/UpdateText.tsx diff --git a/src/views/components/common/UpdateText.tsx b/src/views/components/common/UpdateText.tsx new file mode 100644 index 000000000..6a83708fa --- /dev/null +++ b/src/views/components/common/UpdateText.tsx @@ -0,0 +1,32 @@ +import React from 'react'; +import Text from '@views/components/common/Text/Text'; + +/** + * Props for the Update Text + */ +export type DividerProps = { + courses: string[]; +}; + +export default function UpdateText({ courses }: DividerProps): JSX.Element { + return ( +
+
+ + This extension has updated! + + + You may have already began planning your Spring 2025 schedule. Here are the Unique Numbers you had + from the old version: (Please open each link and re- add course to your new schedule) + +
+
+ {courses.map((course, index) => ( + + {course} + + ))} +
+
+ ); +} From 2ea041e1f0745f8484da1e6006e5ddabdea1b07b Mon Sep 17 00:00:00 2001 From: Derek Chen Date: Sat, 12 Oct 2024 00:27:18 -0500 Subject: [PATCH 2/9] feat: made stories --- src/stories/components/UpdateText.stories.tsx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/stories/components/UpdateText.stories.tsx diff --git a/src/stories/components/UpdateText.stories.tsx b/src/stories/components/UpdateText.stories.tsx new file mode 100644 index 000000000..16cac80c4 --- /dev/null +++ b/src/stories/components/UpdateText.stories.tsx @@ -0,0 +1,19 @@ +import type { Meta, StoryObj } from '@storybook/react'; +import UpdateText, { DividerProps } from 'src/views/components/common/UpdateText'; +import React from 'react'; + +const meta = { + title: 'Components/Common/UpdateText', + component: UpdateText, + parameters: { + layout: 'centered', + }, + tags: ['autodocs'], + argTypes: { + courses: { control: 'object' }, + }, +} satisfies Meta; + +export default meta; + +type Story = StoryObj; From 38a6322fdeaf142ac5857669d12c28b62326d5fe Mon Sep 17 00:00:00 2001 From: Derek Chen Date: Sat, 12 Oct 2024 00:28:50 -0500 Subject: [PATCH 3/9] feat: whoops named props wrong --- src/stories/components/UpdateText.stories.tsx | 4 +++- src/views/components/common/UpdateText.tsx | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/stories/components/UpdateText.stories.tsx b/src/stories/components/UpdateText.stories.tsx index 16cac80c4..ccec75f0f 100644 --- a/src/stories/components/UpdateText.stories.tsx +++ b/src/stories/components/UpdateText.stories.tsx @@ -1,5 +1,5 @@ import type { Meta, StoryObj } from '@storybook/react'; -import UpdateText, { DividerProps } from 'src/views/components/common/UpdateText'; +import UpdateText, { UpdateTextProps } from 'src/views/components/common/UpdateText'; import React from 'react'; const meta = { @@ -17,3 +17,5 @@ const meta = { export default meta; type Story = StoryObj; + +const Template: Story = args => ; diff --git a/src/views/components/common/UpdateText.tsx b/src/views/components/common/UpdateText.tsx index 6a83708fa..346279956 100644 --- a/src/views/components/common/UpdateText.tsx +++ b/src/views/components/common/UpdateText.tsx @@ -4,11 +4,11 @@ import Text from '@views/components/common/Text/Text'; /** * Props for the Update Text */ -export type DividerProps = { +export type UpdateTextProps = { courses: string[]; }; -export default function UpdateText({ courses }: DividerProps): JSX.Element { +export default function UpdateText({ courses }: UpdateTextProps): JSX.Element { return (
From 3ee6be3d157fec97aa059548f9a93092ef0daced Mon Sep 17 00:00:00 2001 From: Derek Chen Date: Sat, 12 Oct 2024 00:30:04 -0500 Subject: [PATCH 4/9] feat: props for stories --- src/stories/components/UpdateText.stories.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/stories/components/UpdateText.stories.tsx b/src/stories/components/UpdateText.stories.tsx index ccec75f0f..0cec85540 100644 --- a/src/stories/components/UpdateText.stories.tsx +++ b/src/stories/components/UpdateText.stories.tsx @@ -18,4 +18,14 @@ export default meta; type Story = StoryObj; -const Template: Story = args => ; +const Template = (args: React.JSX.IntrinsicAttributes & UpdateTextProps) => ; + +export const Default: Story = { + render: Template, + args: { + courses: ['12345', '23456', '34567', '45678', '56789'], + }, +}; +Default.args = { + courses: ['12345', '23456', '34567', '45678', '56789'], +}; From 809253ceb565f3d4413a397e4a105a02246cb326 Mon Sep 17 00:00:00 2001 From: Derek Chen Date: Sat, 12 Oct 2024 00:35:34 -0500 Subject: [PATCH 5/9] style: text styling --- src/views/components/common/UpdateText.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/views/components/common/UpdateText.tsx b/src/views/components/common/UpdateText.tsx index 346279956..4e277e2c3 100644 --- a/src/views/components/common/UpdateText.tsx +++ b/src/views/components/common/UpdateText.tsx @@ -10,17 +10,17 @@ export type UpdateTextProps = { export default function UpdateText({ courses }: UpdateTextProps): JSX.Element { return ( -
-
- +
+
+ This extension has updated! - + You may have already began planning your Spring 2025 schedule. Here are the Unique Numbers you had from the old version: (Please open each link and re- add course to your new schedule)
-
+
{courses.map((course, index) => ( {course} From c61edf1ad8720844e412c86f5704d65c1268f7dd Mon Sep 17 00:00:00 2001 From: Derek Chen Date: Sat, 12 Oct 2024 00:38:33 -0500 Subject: [PATCH 6/9] feat: an underline --- src/stories/components/UpdateText.stories.tsx | 3 ++- src/views/components/common/UpdateText.tsx | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/stories/components/UpdateText.stories.tsx b/src/stories/components/UpdateText.stories.tsx index 0cec85540..66a8d7489 100644 --- a/src/stories/components/UpdateText.stories.tsx +++ b/src/stories/components/UpdateText.stories.tsx @@ -1,5 +1,6 @@ import type { Meta, StoryObj } from '@storybook/react'; -import UpdateText, { UpdateTextProps } from 'src/views/components/common/UpdateText'; +import type { UpdateTextProps } from '@views/components/common/UpdateText'; +import UpdateText from '@views/components/common/UpdateText'; import React from 'react'; const meta = { diff --git a/src/views/components/common/UpdateText.tsx b/src/views/components/common/UpdateText.tsx index 4e277e2c3..3c62deeae 100644 --- a/src/views/components/common/UpdateText.tsx +++ b/src/views/components/common/UpdateText.tsx @@ -1,5 +1,5 @@ -import React from 'react'; import Text from '@views/components/common/Text/Text'; +import React from 'react'; /** * Props for the Update Text @@ -10,7 +10,7 @@ export type UpdateTextProps = { export default function UpdateText({ courses }: UpdateTextProps): JSX.Element { return ( -
+
This extension has updated! @@ -22,7 +22,7 @@ export default function UpdateText({ courses }: UpdateTextProps): JSX.Element {
{courses.map((course, index) => ( - + {course} ))} From 1e585353822d0c5e533d556a15f49c6030af4ded Mon Sep 17 00:00:00 2001 From: Derek Chen Date: Sat, 12 Oct 2024 00:41:27 -0500 Subject: [PATCH 7/9] feat: key change --- src/views/components/common/UpdateText.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/components/common/UpdateText.tsx b/src/views/components/common/UpdateText.tsx index 3c62deeae..d0321f508 100644 --- a/src/views/components/common/UpdateText.tsx +++ b/src/views/components/common/UpdateText.tsx @@ -22,7 +22,7 @@ export default function UpdateText({ courses }: UpdateTextProps): JSX.Element {
{courses.map((course, index) => ( - + {course} ))} From 14d486b2c87047db4c150fbe18d4d4081991337e Mon Sep 17 00:00:00 2001 From: doprz <52579214+doprz@users.noreply.github.com> Date: Sat, 12 Oct 2024 15:15:12 -0500 Subject: [PATCH 8/9] chore: small ui and arg updates --- src/views/components/common/UpdateText.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/views/components/common/UpdateText.tsx b/src/views/components/common/UpdateText.tsx index d0321f508..29f82a681 100644 --- a/src/views/components/common/UpdateText.tsx +++ b/src/views/components/common/UpdateText.tsx @@ -12,17 +12,17 @@ export default function UpdateText({ courses }: UpdateTextProps): JSX.Element { return (
- + This extension has updated! You may have already began planning your Spring 2025 schedule. Here are the Unique Numbers you had - from the old version: (Please open each link and re- add course to your new schedule) + from the old version: (Please open each link and re-add course to your new schedule)
- {courses.map((course, index) => ( - + {courses.map((course) => ( + {course} ))} From 4a805f1ea74e0dbe64102f455315e4b497ae336c Mon Sep 17 00:00:00 2001 From: doprz <52579214+doprz@users.noreply.github.com> Date: Sat, 12 Oct 2024 15:20:33 -0500 Subject: [PATCH 9/9] chore: fix lint, format, and jsdoc --- src/views/components/common/UpdateText.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/views/components/common/UpdateText.tsx b/src/views/components/common/UpdateText.tsx index 29f82a681..f815aa29f 100644 --- a/src/views/components/common/UpdateText.tsx +++ b/src/views/components/common/UpdateText.tsx @@ -8,6 +8,14 @@ export type UpdateTextProps = { courses: string[]; }; +/** + * UpdateText component displays a message indicating that the extension has been updated + * and lists the unique course numbers from the old version. + * + * @param props - The properties object. + * @param props.courses - An array of course unique numbers to be displayed. + * @returns The rendered UpdateText component. + */ export default function UpdateText({ courses }: UpdateTextProps): JSX.Element { return (
@@ -21,7 +29,7 @@ export default function UpdateText({ courses }: UpdateTextProps): JSX.Element {
- {courses.map((course) => ( + {courses.map(course => ( {course}