Scuffed popup
This commit is contained in:
BIN
src/assets/logo.png
Normal file
BIN
src/assets/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
@@ -14,6 +14,7 @@ export default async function createSchedule(scheduleName: string): Promise<stri
|
|||||||
schedules.push({
|
schedules.push({
|
||||||
name: scheduleName,
|
name: scheduleName,
|
||||||
courses: [],
|
courses: [],
|
||||||
|
hours: 0
|
||||||
});
|
});
|
||||||
|
|
||||||
await UserScheduleStore.set('schedules', schedules);
|
await UserScheduleStore.set('schedules', schedules);
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ export const UserScheduleStore = createLocalStore<IUserScheduleStore>({
|
|||||||
new UserSchedule({
|
new UserSchedule({
|
||||||
courses: [],
|
courses: [],
|
||||||
name: 'Schedule 1',
|
name: 'Schedule 1',
|
||||||
|
hours: 0,
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
activeIndex: 0,
|
activeIndex: 0,
|
||||||
|
|||||||
23
src/stories/components/PopupMain.stories.tsx
Normal file
23
src/stories/components/PopupMain.stories.tsx
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
import { Meta, StoryObj } from '@storybook/react';
|
||||||
|
import PopupMain from 'src/views/components/PopupMain';
|
||||||
|
|
||||||
|
const meta = {
|
||||||
|
title: 'Components/Common/PopupMain',
|
||||||
|
component: PopupMain,
|
||||||
|
parameters: {
|
||||||
|
layout: 'centered',
|
||||||
|
},
|
||||||
|
tags: ['autodocs'],
|
||||||
|
argTypes: {
|
||||||
|
|
||||||
|
},
|
||||||
|
} satisfies Meta<typeof PopupMain>;
|
||||||
|
export default meta;
|
||||||
|
|
||||||
|
type Story = StoryObj<typeof meta>;
|
||||||
|
|
||||||
|
export const Default: Story = {
|
||||||
|
args: {
|
||||||
|
|
||||||
|
},
|
||||||
|
};
|
||||||
@@ -57,6 +57,7 @@ const exampleCourse: Course = new Course({
|
|||||||
const exampleSchedule: UserSchedule = new UserSchedule({
|
const exampleSchedule: UserSchedule = new UserSchedule({
|
||||||
courses: [exampleCourse],
|
courses: [exampleCourse],
|
||||||
name: 'Example Schedule',
|
name: 'Example Schedule',
|
||||||
|
hours: 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
const meta = {
|
const meta = {
|
||||||
@@ -96,6 +97,7 @@ export const Open: Story = {
|
|||||||
activeSchedule: new UserSchedule({
|
activeSchedule: new UserSchedule({
|
||||||
courses: [],
|
courses: [],
|
||||||
name: 'Example Schedule',
|
name: 'Example Schedule',
|
||||||
|
hours: 0,
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,24 +1,44 @@
|
|||||||
import { background } from '@shared/messages';
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import useSchedules from '../hooks/useSchedules';
|
import logoImage from '../../assets/logo.png'; // Adjust the path as necessary
|
||||||
import { Button } from './common/Button/Button';
|
|
||||||
import ExtensionRoot from './common/ExtensionRoot/ExtensionRoot';
|
import ExtensionRoot from './common/ExtensionRoot/ExtensionRoot';
|
||||||
|
import Text from './common/Text/Text';
|
||||||
|
|
||||||
export default function PopupMain() {
|
export default function PopupMain() {
|
||||||
const [activeSchedule, schedules] = useSchedules();
|
// const [activeSchedule, schedules] = useSchedules();
|
||||||
|
|
||||||
// TODO: Add a button to to switch the active schedule
|
// TODO: Add a button to to switch the active schedule
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ExtensionRoot>
|
<ExtensionRoot>
|
||||||
<Button
|
<div className='h-[500px] w-[360px] rounded-lg bg-white shadow-md'>
|
||||||
onClick={() => {
|
<div className='mb-2 flex items-center justify-between bg-white px-4 py-3'>
|
||||||
if (!activeSchedule) return;
|
<div className='flex items-center gap-2'>
|
||||||
background.clearCourses({ scheduleName: activeSchedule?.name });
|
<div className='h-13 w-13'>
|
||||||
|
<img src={logoImage} alt='Logo' />
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<Text as='div' className='color-ut-burntorange text-lg font-500 leading-[100%]!'>
|
||||||
|
UT Registration
|
||||||
|
</Text>
|
||||||
|
<Text as='div' className='text-lg color-ut-orange font-500 leading-[100%]!'>
|
||||||
|
Plus
|
||||||
|
</Text>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className='flex items-center'>
|
||||||
|
<button style={{ backgroundColor: '#bf5700', borderRadius: '8px', padding: '8px' }} />
|
||||||
|
<button
|
||||||
|
style={{
|
||||||
|
backgroundColor: 'white',
|
||||||
|
marginLeft: '10px',
|
||||||
|
borderRadius: '8px',
|
||||||
|
padding: '8px',
|
||||||
|
boxShadow: '0px 2px 4px rgba(0, 0, 0, 0.1)',
|
||||||
}}
|
}}
|
||||||
>
|
/>
|
||||||
Clear Courses
|
</div>
|
||||||
</Button>
|
</div>
|
||||||
|
</div>
|
||||||
</ExtensionRoot>
|
</ExtensionRoot>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import { background } from '@shared/messages';
|
import { background } from '@shared/messages';
|
||||||
import { Course } from '@shared/types/Course';
|
import { Course } from '@shared/types/Course';
|
||||||
import { UserSchedule } from '@shared/types/UserSchedule';
|
import { UserSchedule } from '@shared/types/UserSchedule';
|
||||||
import React from 'react';
|
|
||||||
import { Button } from '@views/components/common/Button/Button';
|
import { Button } from '@views/components/common/Button/Button';
|
||||||
import Card from '@views/components/common/Card/Card';
|
import Card from '@views/components/common/Card/Card';
|
||||||
import Icon from '@views/components/common/Icon/Icon';
|
import Icon from '@views/components/common/Icon/Icon';
|
||||||
import Text from '@views/components/common/Text/Text';
|
import Text from '@views/components/common/Text/Text';
|
||||||
|
import React from 'react';
|
||||||
import styles from './CourseButtons.module.scss';
|
import styles from './CourseButtons.module.scss';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
@@ -83,48 +83,43 @@ export default function CourseButtons({ course, activeSchedule }: Props) {
|
|||||||
<Button
|
<Button
|
||||||
onClick={openRateMyProfessorURL}
|
onClick={openRateMyProfessorURL}
|
||||||
disabled={!course.instructors.length}
|
disabled={!course.instructors.length}
|
||||||
variant='primary'
|
variant='filled'
|
||||||
className={styles.button}
|
className={styles.button}
|
||||||
|
color='ut-black'
|
||||||
title='Search for this professor on RateMyProfessor'
|
title='Search for this professor on RateMyProfessor'
|
||||||
>
|
>
|
||||||
<Text /* size='medium' weight='regular' */color='white'>
|
<Text /* size='medium' weight='regular' */ color='white'>RateMyProf</Text>
|
||||||
RateMyProf
|
|
||||||
</Text>
|
|
||||||
<Icon className={styles.icon} color='white' name='school' size='medium' />
|
<Icon className={styles.icon} color='white' name='school' size='medium' />
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
onClick={openSyllabiURL}
|
onClick={openSyllabiURL}
|
||||||
variant='secondary'
|
variant='filled'
|
||||||
className={styles.button}
|
className={styles.button}
|
||||||
|
color='ut-black'
|
||||||
title='Search for syllabi for this course'
|
title='Search for syllabi for this course'
|
||||||
>
|
>
|
||||||
<Text /* size='medium' weight='regular' */ color='white'>
|
<Text /* size='medium' weight='regular' */ color='white'>Syllabi</Text>
|
||||||
Syllabi
|
|
||||||
</Text>
|
|
||||||
<Icon className={styles.icon} color='white' name='grading' size='medium' />
|
<Icon className={styles.icon} color='white' name='grading' size='medium' />
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
onClick={openTextbookURL}
|
onClick={openTextbookURL}
|
||||||
variant='tertiary'
|
variant='filled'
|
||||||
className={styles.button}
|
className={styles.button}
|
||||||
|
color='ut-black'
|
||||||
title='Search for textbooks for this course'
|
title='Search for textbooks for this course'
|
||||||
>
|
>
|
||||||
<Text /* size='medium' weight='regular' color='white' */>
|
<Text /* size='medium' weight='regular' color='white' */>Textbook</Text>
|
||||||
Textbook
|
|
||||||
</Text>
|
|
||||||
<Icon className={styles.icon} color='white' name='collections_bookmark' size='medium' />
|
<Icon className={styles.icon} color='white' name='collections_bookmark' size='medium' />
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
disabled={!activeSchedule}
|
disabled={!activeSchedule}
|
||||||
onClick={isCourseSaved ? handleRemoveCourse : handleSaveCourse}
|
onClick={isCourseSaved ? handleRemoveCourse : handleSaveCourse}
|
||||||
title={isCourseSaved ? 'Remove this course from your schedule' : 'Add this course to your schedule'}
|
title={isCourseSaved ? 'Remove this course from your schedule' : 'Add this course to your schedule'}
|
||||||
variant={isCourseSaved ? 'danger' : 'success'}
|
variant='filled'
|
||||||
className={styles.button}
|
className={styles.button}
|
||||||
|
color='ut-black'
|
||||||
>
|
>
|
||||||
|
<Text /* size='medium' weight='regular' color='white' */>{isCourseSaved ? 'Remove' : 'Add'}</Text>
|
||||||
<Text /* size='medium' weight='regular' color='white' */ >
|
|
||||||
{isCourseSaved ? 'Remove' : 'Add'}
|
|
||||||
</Text>
|
|
||||||
<Icon className={styles.icon} color='white' name={isCourseSaved ? 'remove' : 'add'} size='medium' />
|
<Icon className={styles.icon} color='white' name={isCourseSaved ? 'remove' : 'add'} size='medium' />
|
||||||
</Button>
|
</Button>
|
||||||
</Card>
|
</Card>
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ export default function TableRow({ row, isSelected, activeSchedule, onClick }: P
|
|||||||
|
|
||||||
return ReactDOM.createPortal(
|
return ReactDOM.createPortal(
|
||||||
<>
|
<>
|
||||||
<Button className={styles.rowButton} onClick={onClick} variant='secondary'>
|
<Button className={styles.rowButton} onClick={onClick} variant='filled' color='ut-black'>
|
||||||
<Icon name='bar_chart' color='white' size='medium' />
|
<Icon name='bar_chart' color='white' size='medium' />
|
||||||
</Button>
|
</Button>
|
||||||
{conflicts.length > 0 && (
|
{conflicts.length > 0 && (
|
||||||
|
|||||||
Reference in New Issue
Block a user