fix: reduce hub header panel contrast color button and badge

This commit is contained in:
Faisal Amir 2024-01-11 11:36:17 +07:00
parent 4a70b8a125
commit c64d0038f3
4 changed files with 10 additions and 5 deletions

View File

@ -6,6 +6,7 @@ const badgeVariants = cva('badge', {
variants: {
themes: {
primary: 'badge-primary',
warning: 'badge-warning',
success: 'badge-success',
secondary: 'badge-secondary',
danger: 'badge-danger',

View File

@ -21,6 +21,10 @@
@apply border-transparent bg-red-100 text-red-700;
}
&-warning {
@apply border-transparent bg-yellow-100 text-yellow-700;
}
&-outline {
@apply text-foreground border-border border;
}

View File

@ -8,7 +8,7 @@
}
&-secondary-blue {
@apply bg-blue-200 text-blue-900 hover:bg-blue-500/80;
@apply bg-blue-200 text-blue-600 hover:bg-blue-500/80;
}
&-danger {

View File

@ -71,7 +71,7 @@ const ExploreModelItemHeader: React.FC<Props> = ({ model, onClick, open }) => {
if (isDownloaded) {
downloadButton = (
<Button
themes="success"
themes="secondaryBlue"
className="min-w-[98px]"
onClick={onUseModelClick}
>
@ -92,21 +92,21 @@ const ExploreModelItemHeader: React.FC<Props> = ({ model, onClick, open }) => {
if (minimumRamModel > totalRam) {
return (
<Badge className="rounded-md bg-red-500 text-white">
<Badge className="rounded-md" themes="danger">
Not enough RAM
</Badge>
)
}
if (minimumRamModel < availableRam) {
return (
<Badge className="rounded-md bg-green-500 text-white">
<Badge className="rounded-md" themes="success">
Recommended
</Badge>
)
}
if (minimumRamModel < totalRam && minimumRamModel > availableRam) {
return (
<Badge className="rounded-md bg-yellow-500 text-white">
<Badge className="rounded-md" themes="warning">
Slow on your device
</Badge>
)