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: migration update showing #293

Merged
merged 9 commits into from
Oct 12, 2024
Merged
Show file tree
Hide file tree
Changes from 8 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
32 changes: 32 additions & 0 deletions src/stories/components/UpdateText.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import type { Meta, StoryObj } from '@storybook/react';
import type { UpdateTextProps } from '@views/components/common/UpdateText';
import UpdateText from '@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<typeof UpdateText>;

export default meta;

type Story = StoryObj<typeof meta>;

const Template = (args: React.JSX.IntrinsicAttributes & UpdateTextProps) => <UpdateText {...args} />;

export const Default: Story = {
render: Template,
args: {
courses: ['12345', '23456', '34567', '45678', '56789'],
},
};
Default.args = {
courses: ['12345', '23456', '34567', '45678', '56789'],
};
32 changes: 32 additions & 0 deletions src/views/components/common/UpdateText.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import Text from '@views/components/common/Text/Text';
import React from 'react';

/**
* Props for the Update Text
*/
export type UpdateTextProps = {
courses: string[];
};

export default function UpdateText({ courses }: UpdateTextProps): JSX.Element {
return (
<div className='max-w-64 flex flex-col justify-center gap-2'>
<div className='flex flex-col gap-0 text-center'>
<Text variant='h4' className='text-ut-burntorange'>
This extension has updated!
</Text>
<Text variant='p' className='text-ut-black'>
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)
</Text>
</div>
<div className='flex flex-col gap-1 text-center'>
{courses.map((course) => (
<Text key={course} variant='p' className='text-ut-orange underline'>
{course}
</Text>
))}
</div>
</div>
);
}
Loading