Skip to content

Commit

Permalink
refactor: Update spinner design (#223)
Browse files Browse the repository at this point in the history
  • Loading branch information
Razboy20 authored May 22, 2024
1 parent 229a8a2 commit 4f0ae43
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 44 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import type { Meta, StoryObj } from '@storybook/react';
import Spinner from '@views/components/common/Spinner/Spinner';
import Spinner from '@views/components/common/Spinner';

const meta = {
title: 'Components/Common/Spinner',
component: Spinner,
tags: ['autodocs'],
argTypes: {},
parameters: {
layout: 'centered',
},
} satisfies Meta<typeof Spinner>;

export default meta;
Expand Down
21 changes: 21 additions & 0 deletions src/views/components/common/Spinner.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import type { SVGProps } from 'react';
import React from 'react';

/**
* A simple spinner component that can be used to indicate loading.
*/
export default function Spinner({ className, ...rest }: SVGProps<SVGSVGElement>): JSX.Element {
return (
<div
className={`will-change-transform animate-spin w-16 h-16 text-ut-orange ${className ?? ''}`}
style={{ animationDuration: '225ms' }}
>
<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' {...rest}>
<path
fill='currentColor'
d='M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z'
/>
</svg>
</div>
);
}
23 changes: 0 additions & 23 deletions src/views/components/common/Spinner/Spinner.module.scss

This file was deleted.

17 changes: 0 additions & 17 deletions src/views/components/common/Spinner/Spinner.tsx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Course } from '@shared/types/Course';
import Spinner from '@views/components/common/Spinner/Spinner';
import Spinner from '@views/components/common/Spinner';
import Text from '@views/components/common/Text/Text';
import { CourseCatalogScraper } from '@views/lib/CourseCatalogScraper';
import { SiteSupport } from '@views/lib/getSiteSupport';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Course } from '@shared/types/Course';
import type { Distribution, LetterGrade } from '@shared/types/Distribution';
import { extendedColors } from '@shared/types/ThemeColors';
import Spinner from '@views/components/common/Spinner/Spinner';
import Spinner from '@views/components/common/Spinner';
import Text from '@views/components/common/Text/Text';
import {
NoDataError,
Expand Down

0 comments on commit 4f0ae43

Please sign in to comment.