Skip to content
This repository has been archived by the owner on Oct 6, 2023. It is now read-only.

Commit

Permalink
feat(ui): new status icons
Browse files Browse the repository at this point in the history
  • Loading branch information
Akryum committed Jan 21, 2022
1 parent 7aefaac commit de822aa
Showing 1 changed file with 7 additions and 25 deletions.
32 changes: 7 additions & 25 deletions packages/peeky-client/src/features/StatusIcon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
import {
CircleIcon,
ClockIcon,
CheckCircleIcon,
XCircleIcon,
CheckIcon,
XIcon,
ChevronsRightIcon,
Expand All @@ -15,8 +13,8 @@ import type { TestStatus } from '../util/status'
const icons: Record<TestStatus, any> = {
idle: CircleIcon,
in_progress: ClockIcon,
success: CheckCircleIcon,
error: XCircleIcon,
success: CheckIcon,
error: XIcon,
skipped: ChevronsRightIcon,
todo: EditIcon,
}
Expand All @@ -39,22 +37,6 @@ const bgClasses: Record<TestStatus, string> = {
todo: 'bg-yellow-500',
}
const smallIcons: Omit<Record<TestStatus, any>, 'idle'> = {
in_progress: ClockIcon,
success: CheckIcon,
error: XIcon,
skipped: ChevronsRightIcon,
todo: EditIcon,
}
const smallClasses: Omit<Record<TestStatus, string>, 'idle'> = {
in_progress: 'bg-primary-500 text-white',
success: 'bg-green-500 text-white',
error: 'bg-red-500 text-white',
skipped: 'bg-gray-300 dark:bg-gray-700 text-white',
todo: 'bg-yellow-500 text-white',
}
const tooltips: Record<TestStatus, string> = {
idle: 'Idle',
in_progress: 'In progress',
Expand Down Expand Up @@ -108,13 +90,13 @@ const props = defineProps({
/>

<div
v-if="icon && smallIcons[status]"
class="absolute bottom-0 right-0 -m-0.5 rounded-full w-3/5 h-3/5"
:class="smallClasses[status]"
v-if="icon && icons[status]"
class="absolute bottom-0 left-0 w-full flex items-center justify-center"
>
<component
:is="smallIcons[status]"
class="w-full h-full stroke-current"
:is="icons[status]"
:class="classes[status]"
class="w-[12px] h-[12px]"
/>
</div>
</div>
Expand Down

0 comments on commit de822aa

Please sign in to comment.