mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-07-03 10:31:14 +03:00
consistent destructive button style
remove text-white from individual buttons and add it to the variant
This commit is contained in:
parent
998cf0f2be
commit
fe01807614
@ -1,4 +1,4 @@
|
|||||||
import { Button } from "@/components/ui/button";
|
import { Button, buttonVariants } from "@/components/ui/button";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { useState, useEffect, useCallback, useMemo } from "react";
|
import { useState, useEffect, useCallback, useMemo } from "react";
|
||||||
import ActivityIndicator from "@/components/indicators/activity-indicator";
|
import ActivityIndicator from "@/components/indicators/activity-indicator";
|
||||||
@ -540,7 +540,7 @@ export default function Step3ChooseExamples({
|
|||||||
</AlertDialogCancel>
|
</AlertDialogCancel>
|
||||||
<AlertDialogAction
|
<AlertDialogAction
|
||||||
onClick={doRefresh}
|
onClick={doRefresh}
|
||||||
className="bg-destructive text-white hover:bg-destructive/90"
|
className={cn(buttonVariants({ variant: "destructive" }))}
|
||||||
>
|
>
|
||||||
{t("button.continue", { ns: "common" })}
|
{t("button.continue", { ns: "common" })}
|
||||||
</AlertDialogAction>
|
</AlertDialogAction>
|
||||||
|
|||||||
@ -32,7 +32,7 @@ import { ProfileOverridesBadge } from "./ProfileOverridesBadge";
|
|||||||
import { useSectionSchema } from "@/hooks/use-config-schema";
|
import { useSectionSchema } from "@/hooks/use-config-schema";
|
||||||
import type { FrigateConfig } from "@/types/frigateConfig";
|
import type { FrigateConfig } from "@/types/frigateConfig";
|
||||||
import { Badge } from "@/components/ui/badge";
|
import { Badge } from "@/components/ui/badge";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button, buttonVariants } from "@/components/ui/button";
|
||||||
import { LuChevronDown, LuChevronRight } from "react-icons/lu";
|
import { LuChevronDown, LuChevronRight } from "react-icons/lu";
|
||||||
import Heading from "@/components/ui/heading";
|
import Heading from "@/components/ui/heading";
|
||||||
import get from "lodash/get";
|
import get from "lodash/get";
|
||||||
@ -1236,7 +1236,7 @@ export function ConfigSection({
|
|||||||
{t("button.cancel", { ns: "common" })}
|
{t("button.cancel", { ns: "common" })}
|
||||||
</AlertDialogCancel>
|
</AlertDialogCancel>
|
||||||
<AlertDialogAction
|
<AlertDialogAction
|
||||||
className="bg-destructive text-white hover:bg-destructive/90"
|
className={cn(buttonVariants({ variant: "destructive" }))}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
onDeleteProfileSection?.();
|
onDeleteProfileSection?.();
|
||||||
setIsDeleteProfileDialogOpen(false);
|
setIsDeleteProfileDialogOpen(false);
|
||||||
|
|||||||
@ -1569,7 +1569,7 @@ function ObjectDetailsTab({
|
|||||||
{t("button.yes", { ns: "common" })}
|
{t("button.yes", { ns: "common" })}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
className="flex-1 text-white"
|
className="flex-1"
|
||||||
aria-label={t("button.no", { ns: "common" })}
|
aria-label={t("button.no", { ns: "common" })}
|
||||||
variant="destructive"
|
variant="destructive"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|||||||
@ -173,7 +173,7 @@ export function FrigatePlusDialog({
|
|||||||
{t("button.yes", { ns: "common" })}
|
{t("button.yes", { ns: "common" })}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
className="flex-1 text-white"
|
className="flex-1"
|
||||||
aria-label={t("button.no", { ns: "common" })}
|
aria-label={t("button.no", { ns: "common" })}
|
||||||
variant="destructive"
|
variant="destructive"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|||||||
@ -29,6 +29,7 @@ import useSWR from "swr";
|
|||||||
import { FrigateConfig } from "@/types/frigateConfig";
|
import { FrigateConfig } from "@/types/frigateConfig";
|
||||||
import { reviewQueries } from "@/utils/zoneEdutUtil";
|
import { reviewQueries } from "@/utils/zoneEdutUtil";
|
||||||
import IconWrapper from "../ui/icon-wrapper";
|
import IconWrapper from "../ui/icon-wrapper";
|
||||||
|
import { buttonVariants } from "@/components/ui/button";
|
||||||
import { Trans, useTranslation } from "react-i18next";
|
import { Trans, useTranslation } from "react-i18next";
|
||||||
import ActivityIndicator from "../indicators/activity-indicator";
|
import ActivityIndicator from "../indicators/activity-indicator";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/lib/utils";
|
||||||
@ -508,7 +509,7 @@ export default function PolygonItem({
|
|||||||
{t("button.cancel", { ns: "common" })}
|
{t("button.cancel", { ns: "common" })}
|
||||||
</AlertDialogCancel>
|
</AlertDialogCancel>
|
||||||
<AlertDialogAction
|
<AlertDialogAction
|
||||||
className="bg-destructive text-white hover:bg-destructive/90"
|
className={cn(buttonVariants({ variant: "destructive" }))}
|
||||||
onClick={handleDelete}
|
onClick={handleDelete}
|
||||||
>
|
>
|
||||||
{polygon.polygonSource === "override"
|
{polygon.polygonSource === "override"
|
||||||
|
|||||||
@ -11,8 +11,7 @@ const buttonVariants = cva(
|
|||||||
variant: {
|
variant: {
|
||||||
default: "bg-secondary text-primary hover:bg-secondary/80",
|
default: "bg-secondary text-primary hover:bg-secondary/80",
|
||||||
select: "bg-selected text-selected-foreground hover:bg-opacity-90",
|
select: "bg-selected text-selected-foreground hover:bg-opacity-90",
|
||||||
destructive:
|
destructive: "bg-destructive text-white hover:bg-destructive/90",
|
||||||
"bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
||||||
outline:
|
outline:
|
||||||
"border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
"border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
||||||
secondary: "bg-primary text-primary-foreground hover:bg-primary/90",
|
secondary: "bg-primary text-primary-foreground hover:bg-primary/90",
|
||||||
|
|||||||
@ -608,7 +608,6 @@ function Exports() {
|
|||||||
{t("button.cancel", { ns: "common" })}
|
{t("button.cancel", { ns: "common" })}
|
||||||
</AlertDialogCancel>
|
</AlertDialogCancel>
|
||||||
<Button
|
<Button
|
||||||
className="text-white"
|
|
||||||
aria-label="Delete Export"
|
aria-label="Delete Export"
|
||||||
variant="destructive"
|
variant="destructive"
|
||||||
onClick={() => onHandleDelete()}
|
onClick={() => onHandleDelete()}
|
||||||
@ -658,7 +657,6 @@ function Exports() {
|
|||||||
{t("button.cancel", { ns: "common" })}
|
{t("button.cancel", { ns: "common" })}
|
||||||
</AlertDialogCancel>
|
</AlertDialogCancel>
|
||||||
<Button
|
<Button
|
||||||
className="text-white"
|
|
||||||
variant="destructive"
|
variant="destructive"
|
||||||
onClick={() => void handleDeleteCase()}
|
onClick={() => void handleDeleteCase()}
|
||||||
>
|
>
|
||||||
|
|||||||
@ -567,7 +567,6 @@ function LibrarySelector({
|
|||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
variant="destructive"
|
variant="destructive"
|
||||||
className="text-white"
|
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (confirmDelete) {
|
if (confirmDelete) {
|
||||||
handleDeleteFace(confirmDelete);
|
handleDeleteFace(confirmDelete);
|
||||||
|
|||||||
@ -332,7 +332,7 @@ export default function Replay() {
|
|||||||
<Button
|
<Button
|
||||||
variant="destructive"
|
variant="destructive"
|
||||||
size="sm"
|
size="sm"
|
||||||
className="flex items-center gap-2 text-white"
|
className="flex items-center gap-2"
|
||||||
disabled={isStopping}
|
disabled={isStopping}
|
||||||
>
|
>
|
||||||
{isStopping && <ActivityIndicator className="size-4" />}
|
{isStopping && <ActivityIndicator className="size-4" />}
|
||||||
@ -355,10 +355,7 @@ export default function Replay() {
|
|||||||
</AlertDialogCancel>
|
</AlertDialogCancel>
|
||||||
<AlertDialogAction
|
<AlertDialogAction
|
||||||
onClick={handleStop}
|
onClick={handleStop}
|
||||||
className={cn(
|
className={cn(buttonVariants({ variant: "destructive" }))}
|
||||||
buttonVariants({ variant: "destructive" }),
|
|
||||||
"text-white",
|
|
||||||
)}
|
|
||||||
>
|
>
|
||||||
{t("page.confirmStop.confirm")}
|
{t("page.confirmStop.confirm")}
|
||||||
</AlertDialogAction>
|
</AlertDialogAction>
|
||||||
|
|||||||
@ -668,7 +668,6 @@ function LibrarySelector({
|
|||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
variant="destructive"
|
variant="destructive"
|
||||||
className="text-white"
|
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (confirmDelete) {
|
if (confirmDelete) {
|
||||||
handleDeleteCategory(confirmDelete);
|
handleDeleteCategory(confirmDelete);
|
||||||
|
|||||||
@ -1052,7 +1052,6 @@ export default function MotionSearchView({
|
|||||||
</div>
|
</div>
|
||||||
<Button
|
<Button
|
||||||
variant="destructive"
|
variant="destructive"
|
||||||
className="text-white"
|
|
||||||
size="sm"
|
size="sm"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
void cancelMotionSearchJob(jobId, jobCamera);
|
void cancelMotionSearchJob(jobId, jobCamera);
|
||||||
|
|||||||
@ -250,7 +250,7 @@ export default function CameraManagementView({
|
|||||||
<Button
|
<Button
|
||||||
variant="destructive"
|
variant="destructive"
|
||||||
onClick={() => setShowDeleteDialog(true)}
|
onClick={() => setShowDeleteDialog(true)}
|
||||||
className="mb-2 flex max-w-48 items-center gap-2 text-white"
|
className="mb-2 flex max-w-48 items-center gap-2"
|
||||||
>
|
>
|
||||||
<LuTrash2 className="h-4 w-4" />
|
<LuTrash2 className="h-4 w-4" />
|
||||||
{t("cameraManagement.deleteCamera")}
|
{t("cameraManagement.deleteCamera")}
|
||||||
|
|||||||
@ -446,10 +446,7 @@ export default function Go2RtcStreamsSettingsView({
|
|||||||
{t("button.cancel", { ns: "common" })}
|
{t("button.cancel", { ns: "common" })}
|
||||||
</AlertDialogCancel>
|
</AlertDialogCancel>
|
||||||
<AlertDialogAction
|
<AlertDialogAction
|
||||||
className={cn(
|
className={cn(buttonVariants({ variant: "destructive" }))}
|
||||||
buttonVariants({ variant: "destructive" }),
|
|
||||||
"text-white",
|
|
||||||
)}
|
|
||||||
onClick={() => deleteDialog && deleteStream(deleteDialog)}
|
onClick={() => deleteDialog && deleteStream(deleteDialog)}
|
||||||
>
|
>
|
||||||
{t("go2rtcStreams.deleteStream")}
|
{t("go2rtcStreams.deleteStream")}
|
||||||
|
|||||||
@ -24,7 +24,7 @@ import { resolveCameraName } from "@/hooks/use-camera-friendly-name";
|
|||||||
import { useDocDomain } from "@/hooks/use-doc-domain";
|
import { useDocDomain } from "@/hooks/use-doc-domain";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/lib/utils";
|
||||||
import Heading from "@/components/ui/heading";
|
import Heading from "@/components/ui/heading";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button, buttonVariants } from "@/components/ui/button";
|
||||||
import { Badge } from "@/components/ui/badge";
|
import { Badge } from "@/components/ui/badge";
|
||||||
import { Input } from "@/components/ui/input";
|
import { Input } from "@/components/ui/input";
|
||||||
import NameAndIdFields from "@/components/input/NameAndIdFields";
|
import NameAndIdFields from "@/components/input/NameAndIdFields";
|
||||||
@ -708,7 +708,7 @@ export default function ProfilesView({
|
|||||||
{t("button.cancel", { ns: "common" })}
|
{t("button.cancel", { ns: "common" })}
|
||||||
</AlertDialogCancel>
|
</AlertDialogCancel>
|
||||||
<AlertDialogAction
|
<AlertDialogAction
|
||||||
className="bg-destructive text-white hover:bg-destructive/90"
|
className={cn(buttonVariants({ variant: "destructive" }))}
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
handleDeleteProfile();
|
handleDeleteProfile();
|
||||||
|
|||||||
@ -83,7 +83,7 @@ export default function RegionGridSettingsView({
|
|||||||
onClick={() => setIsConfirmOpen(true)}
|
onClick={() => setIsConfirmOpen(true)}
|
||||||
disabled={isClearing}
|
disabled={isClearing}
|
||||||
variant="destructive"
|
variant="destructive"
|
||||||
className="flex flex-1 text-white md:max-w-sm"
|
className="flex flex-1 md:max-w-sm"
|
||||||
>
|
>
|
||||||
{t("maintenance.regionGrid.clear")}
|
{t("maintenance.regionGrid.clear")}
|
||||||
</Button>
|
</Button>
|
||||||
@ -106,10 +106,7 @@ export default function RegionGridSettingsView({
|
|||||||
{t("button.cancel", { ns: "common" })}
|
{t("button.cancel", { ns: "common" })}
|
||||||
</AlertDialogCancel>
|
</AlertDialogCancel>
|
||||||
<AlertDialogAction
|
<AlertDialogAction
|
||||||
className={cn(
|
className={cn(buttonVariants({ variant: "destructive" }))}
|
||||||
buttonVariants({ variant: "destructive" }),
|
|
||||||
"text-white",
|
|
||||||
)}
|
|
||||||
onClick={handleClear}
|
onClick={handleClear}
|
||||||
>
|
>
|
||||||
{t("maintenance.regionGrid.clear")}
|
{t("maintenance.regionGrid.clear")}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user