mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-05-05 04:57:42 +03:00
Base alert toggles on width not device class
This commit is contained in:
parent
f5fd42bab0
commit
952770157d
@ -279,32 +279,29 @@ export default function EventView({
|
|||||||
value="alert"
|
value="alert"
|
||||||
aria-label={t("alerts")}
|
aria-label={t("alerts")}
|
||||||
>
|
>
|
||||||
{isMobileOnly ? (
|
<div
|
||||||
<div
|
className={cn(
|
||||||
className={cn(
|
"flex size-6 items-center justify-center rounded text-severity_alert sm:hidden",
|
||||||
"flex size-6 items-center justify-center rounded text-severity_alert",
|
severityToggle == "alert" ? "font-semibold" : "font-medium",
|
||||||
severityToggle == "alert" ? "font-semibold" : "font-medium",
|
)}
|
||||||
)}
|
>
|
||||||
>
|
{reviewCounts.alert > -1 ? (
|
||||||
|
reviewCounts.alert
|
||||||
|
) : (
|
||||||
|
<ActivityIndicator className="size-4" />
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<div className="hidden items-center sm:flex">
|
||||||
|
<MdCircle className="size-2 text-severity_alert md:mr-[10px]" />
|
||||||
|
<div className="hidden md:flex md:flex-row md:items-center">
|
||||||
|
{t("alerts")}
|
||||||
{reviewCounts.alert > -1 ? (
|
{reviewCounts.alert > -1 ? (
|
||||||
reviewCounts.alert
|
` ∙ ${reviewCounts.alert}`
|
||||||
) : (
|
) : (
|
||||||
<ActivityIndicator className="size-4" />
|
<ActivityIndicator className="ml-2 size-4" />
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
) : (
|
</div>
|
||||||
<>
|
|
||||||
<MdCircle className="size-2 text-severity_alert md:mr-[10px]" />
|
|
||||||
<div className="hidden md:flex md:flex-row md:items-center">
|
|
||||||
{t("alerts")}
|
|
||||||
{reviewCounts.alert > -1 ? (
|
|
||||||
` ∙ ${reviewCounts.alert}`
|
|
||||||
) : (
|
|
||||||
<ActivityIndicator className="ml-2 size-4" />
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</ToggleGroupItem>
|
</ToggleGroupItem>
|
||||||
<ToggleGroupItem
|
<ToggleGroupItem
|
||||||
className={cn(
|
className={cn(
|
||||||
@ -313,34 +310,29 @@ export default function EventView({
|
|||||||
value="detection"
|
value="detection"
|
||||||
aria-label={t("detections")}
|
aria-label={t("detections")}
|
||||||
>
|
>
|
||||||
{isMobileOnly ? (
|
<div
|
||||||
<div
|
className={cn(
|
||||||
className={cn(
|
"flex size-6 items-center justify-center rounded text-severity_detection sm:hidden",
|
||||||
"flex size-6 items-center justify-center rounded text-severity_detection",
|
severityToggle == "detection" ? "font-semibold" : "font-medium",
|
||||||
severityToggle == "detection"
|
)}
|
||||||
? "font-semibold"
|
>
|
||||||
: "font-medium",
|
{reviewCounts.detection > -1 ? (
|
||||||
)}
|
reviewCounts.detection
|
||||||
>
|
) : (
|
||||||
|
<ActivityIndicator className="size-4" />
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<div className="hidden items-center sm:flex">
|
||||||
|
<MdCircle className="size-2 text-severity_detection md:mr-[10px]" />
|
||||||
|
<div className="hidden md:flex md:flex-row md:items-center">
|
||||||
|
{t("detections")}
|
||||||
{reviewCounts.detection > -1 ? (
|
{reviewCounts.detection > -1 ? (
|
||||||
reviewCounts.detection
|
` ∙ ${reviewCounts.detection}`
|
||||||
) : (
|
) : (
|
||||||
<ActivityIndicator className="size-4" />
|
<ActivityIndicator className="ml-2 size-4" />
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
) : (
|
</div>
|
||||||
<>
|
|
||||||
<MdCircle className="size-2 text-severity_detection md:mr-[10px]" />
|
|
||||||
<div className="hidden md:flex md:flex-row md:items-center">
|
|
||||||
{t("detections")}
|
|
||||||
{reviewCounts.detection > -1 ? (
|
|
||||||
` ∙ ${reviewCounts.detection}`
|
|
||||||
) : (
|
|
||||||
<ActivityIndicator className="ml-2 size-4" />
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</ToggleGroupItem>
|
</ToggleGroupItem>
|
||||||
<ToggleGroupItem
|
<ToggleGroupItem
|
||||||
className={cn(
|
className={cn(
|
||||||
@ -350,14 +342,11 @@ export default function EventView({
|
|||||||
value="significant_motion"
|
value="significant_motion"
|
||||||
aria-label={t("motion.label")}
|
aria-label={t("motion.label")}
|
||||||
>
|
>
|
||||||
{isMobileOnly ? (
|
<GiSoundWaves className="size-6 rotate-90 text-severity_significant_motion sm:hidden" />
|
||||||
<GiSoundWaves className="size-6 rotate-90 text-severity_significant_motion" />
|
<div className="hidden items-center sm:flex">
|
||||||
) : (
|
<MdCircle className="size-2 text-severity_significant_motion md:mr-[10px]" />
|
||||||
<>
|
<div className="hidden md:block">{t("motion.label")}</div>
|
||||||
<MdCircle className="size-2 text-severity_significant_motion md:mr-[10px]" />
|
</div>
|
||||||
<div className="hidden md:block">{t("motion.label")}</div>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</ToggleGroupItem>
|
</ToggleGroupItem>
|
||||||
</ToggleGroup>
|
</ToggleGroup>
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user