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({
|
||||
name: scheduleName,
|
||||
courses: [],
|
||||
hours: 0
|
||||
});
|
||||
|
||||
await UserScheduleStore.set('schedules', schedules);
|
||||
|
||||
@@ -14,6 +14,7 @@ export const UserScheduleStore = createLocalStore<IUserScheduleStore>({
|
||||
new UserSchedule({
|
||||
courses: [],
|
||||
name: 'Schedule 1',
|
||||
hours: 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({
|
||||
courses: [exampleCourse],
|
||||
name: 'Example Schedule',
|
||||
hours: 0,
|
||||
});
|
||||
|
||||
const meta = {
|
||||
@@ -96,6 +97,7 @@ export const Open: Story = {
|
||||
activeSchedule: new UserSchedule({
|
||||
courses: [],
|
||||
name: 'Example Schedule',
|
||||
hours: 0,
|
||||
}),
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1,24 +1,44 @@
|
||||
import { background } from '@shared/messages';
|
||||
import React from 'react';
|
||||
import useSchedules from '../hooks/useSchedules';
|
||||
import { Button } from './common/Button/Button';
|
||||
import logoImage from '../../assets/logo.png'; // Adjust the path as necessary
|
||||
import ExtensionRoot from './common/ExtensionRoot/ExtensionRoot';
|
||||
import Text from './common/Text/Text';
|
||||
|
||||
export default function PopupMain() {
|
||||
const [activeSchedule, schedules] = useSchedules();
|
||||
// const [activeSchedule, schedules] = useSchedules();
|
||||
|
||||
// TODO: Add a button to to switch the active schedule
|
||||
|
||||
return (
|
||||
<ExtensionRoot>
|
||||
<Button
|
||||
onClick={() => {
|
||||
if (!activeSchedule) return;
|
||||
background.clearCourses({ scheduleName: activeSchedule?.name });
|
||||
<div className='h-[500px] w-[360px] rounded-lg bg-white shadow-md'>
|
||||
<div className='mb-2 flex items-center justify-between bg-white px-4 py-3'>
|
||||
<div className='flex items-center gap-2'>
|
||||
<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
|
||||
</Button>
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ExtensionRoot>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { background } from '@shared/messages';
|
||||
import { Course } from '@shared/types/Course';
|
||||
import { UserSchedule } from '@shared/types/UserSchedule';
|
||||
import React from 'react';
|
||||
import { Button } from '@views/components/common/Button/Button';
|
||||
import Card from '@views/components/common/Card/Card';
|
||||
import Icon from '@views/components/common/Icon/Icon';
|
||||
import Text from '@views/components/common/Text/Text';
|
||||
import React from 'react';
|
||||
import styles from './CourseButtons.module.scss';
|
||||
|
||||
type Props = {
|
||||
@@ -83,48 +83,43 @@ export default function CourseButtons({ course, activeSchedule }: Props) {
|
||||
<Button
|
||||
onClick={openRateMyProfessorURL}
|
||||
disabled={!course.instructors.length}
|
||||
variant='primary'
|
||||
variant='filled'
|
||||
className={styles.button}
|
||||
color='ut-black'
|
||||
title='Search for this professor on RateMyProfessor'
|
||||
>
|
||||
<Text /* size='medium' weight='regular' */color='white'>
|
||||
RateMyProf
|
||||
</Text>
|
||||
<Text /* size='medium' weight='regular' */ color='white'>RateMyProf</Text>
|
||||
<Icon className={styles.icon} color='white' name='school' size='medium' />
|
||||
</Button>
|
||||
<Button
|
||||
onClick={openSyllabiURL}
|
||||
variant='secondary'
|
||||
variant='filled'
|
||||
className={styles.button}
|
||||
color='ut-black'
|
||||
title='Search for syllabi for this course'
|
||||
>
|
||||
<Text /* size='medium' weight='regular' */ color='white'>
|
||||
Syllabi
|
||||
</Text>
|
||||
<Text /* size='medium' weight='regular' */ color='white'>Syllabi</Text>
|
||||
<Icon className={styles.icon} color='white' name='grading' size='medium' />
|
||||
</Button>
|
||||
<Button
|
||||
onClick={openTextbookURL}
|
||||
variant='tertiary'
|
||||
variant='filled'
|
||||
className={styles.button}
|
||||
color='ut-black'
|
||||
title='Search for textbooks for this course'
|
||||
>
|
||||
<Text /* size='medium' weight='regular' color='white' */>
|
||||
Textbook
|
||||
</Text>
|
||||
<Text /* size='medium' weight='regular' color='white' */>Textbook</Text>
|
||||
<Icon className={styles.icon} color='white' name='collections_bookmark' size='medium' />
|
||||
</Button>
|
||||
<Button
|
||||
disabled={!activeSchedule}
|
||||
onClick={isCourseSaved ? handleRemoveCourse : handleSaveCourse}
|
||||
title={isCourseSaved ? 'Remove this course from your schedule' : 'Add this course to your schedule'}
|
||||
variant={isCourseSaved ? 'danger' : 'success'}
|
||||
variant='filled'
|
||||
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' />
|
||||
</Button>
|
||||
</Card>
|
||||
|
||||
@@ -84,7 +84,7 @@ export default function TableRow({ row, isSelected, activeSchedule, onClick }: P
|
||||
|
||||
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' />
|
||||
</Button>
|
||||
{conflicts.length > 0 && (
|
||||
|
||||
Reference in New Issue
Block a user