Skip to content

Commit f8a7a66

Browse files
authored
refactor: delete CircularProgress (commaai#519)
1 parent ee3f11a commit f8a7a66

File tree

5 files changed

+7
-104
lines changed

5 files changed

+7
-104
lines changed

src/components/material/Button.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Show, splitProps } from 'solid-js'
33
import clsx from 'clsx'
44

55
import ButtonBase, { ButtonBaseProps } from './ButtonBase'
6-
import CircularProgress from './CircularProgress'
6+
import Icon from './Icon'
77

88
type ButtonProps = ButtonBaseProps & {
99
color?: 'primary' | 'secondary' | 'tertiary' | 'error'
@@ -42,7 +42,7 @@ const Button: ParentComponent<ButtonProps> = (props) => {
4242
{props.leading}
4343
<span class={clsx('text-label-lg', props.loading && 'invisible')}>{props.children}</span>
4444
<Show when={props.loading}>
45-
<CircularProgress class="absolute left-1/2 top-1/2 ml-[-10px] mt-[-10px]" color="inherit" size={20} />
45+
<Icon name="autorenew" class="absolute left-1/2 top-1/2 ml-[-10px] mt-[-10px] animate-spin" size="20" />
4646
</Show>
4747
{props.trailing}
4848
</ButtonBase>

src/components/material/CircularProgress.tsx

Lines changed: 0 additions & 72 deletions
This file was deleted.

src/pages/dashboard/activities/PairActivity.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import QrScanner from 'qr-scanner'
55

66
import { pairDevice } from '~/api/devices'
77
import Button from '~/components/material/Button'
8-
import CircularProgress from '~/components/material/CircularProgress'
8+
import Icon from '~/components/material/Icon'
99
import IconButton from '~/components/material/IconButton'
1010
import TopAppBar from '~/components/material/TopAppBar'
1111

@@ -96,8 +96,8 @@ const PairActivity: VoidComponent<{ onPaired: () => void }> = (props) => {
9696
<TopAppBar>Add new device</TopAppBar>
9797

9898
<div class="flex flex-col items-center gap-4">
99-
<CircularProgress class="m-4" color="primary" size={64} />
100-
Pairing your device...
99+
<Icon name="autorenew" class="animate-spin" size="40" />
100+
<span class="text-title-md">Pairing your device...</span>
101101
</div>
102102
</>
103103
)

src/pages/dashboard/activities/SettingsActivity.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import { formatDate } from '~/utils/format'
1616

1717
import ButtonBase from '~/components/material/ButtonBase'
1818
import Button from '~/components/material/Button'
19-
import CircularProgress from '~/components/material/CircularProgress'
2019
import Icon from '~/components/material/Icon'
2120
import IconButton from '~/components/material/IconButton'
2221
import TopAppBar from '~/components/material/TopAppBar'
@@ -281,8 +280,8 @@ const PrimeManage: VoidComponent<{ dongleId: string }> = (props) => {
281280
<Suspense
282281
fallback={
283282
<div class="my-2 flex flex-col items-center gap-4">
284-
<CircularProgress />
285-
Fetching subscription status...
283+
<Icon name="autorenew" class="animate-spin" size="40" />
284+
<span class="text-title-md">Fetching subscription status...</span>
286285
</div>
287286
}
288287
>

tailwind.config.ts

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -226,28 +226,6 @@ export default {
226226
right: '-8%',
227227
},
228228
},
229-
'circular-rotate': {
230-
'0%': {
231-
transform: 'rotate(0deg)',
232-
},
233-
'100%': {
234-
transform: 'rotate(360deg)',
235-
},
236-
},
237-
'circular-dash': {
238-
'0%': {
239-
strokeDasharray: '1px, 200px',
240-
strokeDashoffset: '0',
241-
},
242-
'50%': {
243-
strokeDasharray: '100px, 200px',
244-
strokeDashoffset: '-15',
245-
},
246-
'100%': {
247-
strokeDasharray: '100px, 200px',
248-
strokeDashoffset: '-125',
249-
},
250-
},
251229
},
252230
screens: {
253231
// Larger screen phones (iPhone Pro/Max, Galaxy Ultra, Pixel XL/Pro...)
@@ -256,8 +234,6 @@ export default {
256234
animation: {
257235
indeterminate1: 'indeterminate1 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite',
258236
indeterminate2: 'indeterminate2 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite',
259-
'circular-rotate': 'circular-rotate 1.4s linear infinite',
260-
'circular-dash': 'circular-dash 1.4s ease-in-out infinite',
261237
},
262238
transitionProperty: {
263239
indeterminate: 'transform, background-color',

0 commit comments

Comments
 (0)