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

fix: bottom-aligned all calendar elements, updated calendar header & main popup layout #388

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 10 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
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,11 @@
"@commitlint/types": "^19.5.0",
"@crxjs/vite-plugin": "2.0.0-beta.21",
"@iconify-json/bi": "^1.2.1",
"@iconify-json/ic": "^1.2.1",
"@iconify-json/iconoir": "^1.2.2",
"@iconify-json/material-symbols": "^1.2.4",
"@iconify-json/ri": "^1.2.1",
"@iconify-json/streamline": "^1.2.1",
"@semantic-release/exec": "^6.0.3",
"@sentry/types": "^8.34.0",
"@storybook/addon-designs": "^8.0.3",
Expand Down
20 changes: 20 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/stories/components/calendar/CalendarHeader.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Meta, StoryObj } from '@storybook/react';
import CalendarHeader from '@views/components/calendar/CalenderHeader';
import CalendarHeader from '@views/components/calendar/CalendarHeader';

const meta = {
title: 'Components/Calendar/CalendarHeader',
Expand Down
3 changes: 0 additions & 3 deletions src/views/components/PopupMain.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,6 @@ export default function PopupMain(): JSX.Element {
</div>
{enableDataRefreshing && (
<div className='inline-flex items-center self-center gap-1'>
<Text variant='mini' className='text-ut-gray !font-normal'>
LAST UPDATED: {getUpdatedAtDateTimeString(activeSchedule.updatedAt)}
</Text>
{/* <button
className='h-4 w-4 bg-transparent p-0 btn'
onClick={() => {
Expand Down
2 changes: 1 addition & 1 deletion src/views/components/calendar/Calendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import type { CalendarTabMessages } from '@shared/messages/CalendarMessages';
import type { Course } from '@shared/types/Course';
import CalendarBottomBar from '@views/components/calendar/CalendarBottomBar';
import CalendarGrid from '@views/components/calendar/CalendarGrid';
import CalendarHeader from '@views/components/calendar/CalendarHeader';
import { CalendarSchedules } from '@views/components/calendar/CalendarSchedules';
import CalendarHeader from '@views/components/calendar/CalenderHeader';
import ImportantLinks from '@views/components/calendar/ImportantLinks';
import Divider from '@views/components/common/Divider';
import CourseCatalogInjectedPopup from '@views/components/injected/CourseCatalogInjectedPopup/CourseCatalogInjectedPopup';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,6 @@ export default function CalendarHeader({ onSidebarToggle }: CalendarHeaderProps)
totalHours={activeSchedule.hours}
totalCourses={activeSchedule.courses.length}
/>
{enableDataRefreshing && (
<div className='flex items-center gap-1 screenshot:hidden'>
<Text variant='mini' className='text-nowrap text-ut-gray font-normal!'>
LAST UPDATED: {getUpdatedAtDateTimeString(activeSchedule.updatedAt)}
</Text>
{/* <button className='inline-block h-4 w-4 bg-transparent p-0 btn'>
<RefreshIcon className='h-4 w-4 animate-duration-800 text-ut-black' />
</button> */}
</div>
)}
</div>
<div className='hidden flex-row items-center justify-end gap-6 screenshot:hidden lg:flex'>
{enableCourseStatusChips && (
Expand All @@ -98,7 +88,7 @@ export default function CalendarHeader({ onSidebarToggle }: CalendarHeaderProps)

{/* <Button variant='single' icon={UndoIcon} color='ut-black' />
<Button variant='single' icon={RedoIcon} color='ut-black' /> */}
<Button variant='single' icon={SettingsIcon} color='ut-black' onClick={handleOpenOptions} />
<Button variant='single' icon={SettingsIcon} color='theme-black' onClick={handleOpenOptions} />
</div>
</div>
);
Expand Down
43 changes: 33 additions & 10 deletions src/views/components/common/ScheduleDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,40 @@ export default function ScheduleDropdown(props: ScheduleDropdownProps) {
<>
<DisclosureButton className='w-full flex items-center border-none bg-transparent px-3.5 py-2.5 text-left'>
<div className='flex-1'>
<Text as='div' variant='h4' className='mb-1 w-100% text-ut-burntorange'>
{(activeSchedule ? activeSchedule.name : 'Schedule').toUpperCase()}:
<Text
as='div'
variant='h3'
className='mb-1 w-100% text-ut-burntorange'
style={{ textTransform: 'none' }}
>
{activeSchedule ? activeSchedule.name : 'Schedule'}
</Text>
<p className='-mb-0.5'>
<Text variant='h3' className='text-theme-black leading-[75%]!'>
{activeSchedule ? activeSchedule.hours : 0} HOURS
</Text>
<Text variant='h4' className='ml-2.5 text-ut-black leading-[75%]!'>
{activeSchedule ? activeSchedule.courses.length : 0} Courses
</Text>
</p>
<div className='flex gap-2.5 text-theme-black leading-[75%]!'>
<div className='flex gap-1.25'>
<Text variant='h4' className='text-theme-black leading-[75%]!'>
{activeSchedule ? activeSchedule.hours : 0}
</Text>
<Text
variant='h4'
className='text-theme-black leading-[75%]!'
style={{ fontVariant: 'all-small-caps' }}
>
{activeSchedule.hours === 1 ? 'Hour' : 'Hours'}
</Text>
</div>
<div className='flex gap-1.25'>
<Text variant='h4' className='text-theme-black leading-[75%]!'>
{activeSchedule ? activeSchedule.courses.length : 0}
</Text>
<Text
variant='h4'
className='text-theme-black leading-[75%]!'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we're using leading-[75%] various times, does it make sense to add to our theme config instead of having it as an arbitrary value?

style={{ fontVariant: 'all-small-caps' }}
>
{activeSchedule.courses.length === 1 ? 'Course' : 'Courses'}
</Text>
</div>
</div>
</div>
<Text className='text-ut-burntorange text-2xl! font-normal!'>
{open ? <DropdownArrowDown /> : <DropdownArrowUp />}
Expand Down
41 changes: 32 additions & 9 deletions src/views/components/common/ScheduleTotalHoursAndCourses.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,39 @@ export default function ScheduleTotalHoursAndCourses({
totalCourses,
}: ScheduleTotalHoursAndCoursesProps): JSX.Element {
return (
<div className='min-w-full w-0 flex items-center gap-2.5 whitespace-nowrap'>
<Text className='truncate text-ut-burntorange uppercase' variant='h1' as='span'>
{`${scheduleName}: `}
</Text>
<Text variant='h3' as='div' className='flex flex-row items-center gap-2 text-theme-black'>
{totalHours} {totalHours === 1 ? 'Hour' : 'Hours'}
<Text variant='h4' as='span' className='hidden capitalize screenshot:inline sm:inline'>
{totalCourses} {totalCourses === 1 ? 'Course' : 'Courses'}
</Text>
<div className='block min-w-full w-0 items-center gap-2.5 whitespace-nowrap'>
<Text className='truncate text-ut-burntorange' variant='h1' as='span' style={{ textTransform: 'none' }}>
Samathingamajig marked this conversation as resolved.
Show resolved Hide resolved
{`${scheduleName}`}
Samathingamajig marked this conversation as resolved.
Show resolved Hide resolved
</Text>
<br />
<div className='flex flex-row items-center gap-2.5 text-theme-black'>
<div className='flex flex-row items-center gap-1.25 text-theme-black'>
<Text variant='h3' as='span' className='hidden capitalize screenshot:inline sm:inline'>
{totalHours}
</Text>
<Text
variant='h3'
as='span'
className='hidden capitalize screenshot:inline sm:inline'
style={{ fontVariant: 'all-small-caps' }}
>
{totalHours === 1 ? 'Hour' : 'Hours'}
</Text>
</div>
<div className='flex flex-row items-center gap-1.25 text-theme-black'>
<Text variant='h3' as='span' className='hidden capitalize screenshot:inline sm:inline'>
{totalCourses}
</Text>
<Text
variant='h3'
as='span'
className='hidden capitalize screenshot:inline sm:inline'
style={{ fontVariant: 'all-small-caps' }}
>
{totalCourses === 1 ? 'Course' : 'Courses'}
</Text>
</div>
</div>
</div>
);
}
6 changes: 1 addition & 5 deletions src/views/components/settings/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -421,11 +421,7 @@ export default function Settings(): JSX.Element {
</div>
{DISPLAY_PREVIEWS && (
<Preview>
<div className='inline-flex items-center self-center gap-1'>
<Text variant='small' className='text-ut-gray !font-normal'>
LAST UPDATED: {getUpdatedAtDateTimeString(activeSchedule.updatedAt)}
</Text>
</div>
<div className='inline-flex items-center self-center gap-1' />
Samathingamajig marked this conversation as resolved.
Show resolved Hide resolved
<Text
variant='h2-course'
className={clsx('text-center text-theme-red !font-normal', {
Expand Down
Loading