Base alert toggles on width not device class

This commit is contained in:
Nicolas Mowen 2025-04-23 06:58:13 -06:00
parent f5fd42bab0
commit 952770157d

View File

@ -279,10 +279,9 @@ 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", "flex size-6 items-center justify-center rounded text-severity_alert sm:hidden",
severityToggle == "alert" ? "font-semibold" : "font-medium", severityToggle == "alert" ? "font-semibold" : "font-medium",
)} )}
> >
@ -292,8 +291,7 @@ export default function EventView({
<ActivityIndicator className="size-4" /> <ActivityIndicator className="size-4" />
)} )}
</div> </div>
) : ( <div className="hidden items-center sm:flex">
<>
<MdCircle className="size-2 text-severity_alert md:mr-[10px]" /> <MdCircle className="size-2 text-severity_alert md:mr-[10px]" />
<div className="hidden md:flex md:flex-row md:items-center"> <div className="hidden md:flex md:flex-row md:items-center">
{t("alerts")} {t("alerts")}
@ -303,8 +301,7 @@ export default function EventView({
<ActivityIndicator className="ml-2 size-4" /> <ActivityIndicator className="ml-2 size-4" />
)} )}
</div> </div>
</> </div>
)}
</ToggleGroupItem> </ToggleGroupItem>
<ToggleGroupItem <ToggleGroupItem
className={cn( className={cn(
@ -313,13 +310,10 @@ 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", "flex size-6 items-center justify-center rounded text-severity_detection sm:hidden",
severityToggle == "detection" severityToggle == "detection" ? "font-semibold" : "font-medium",
? "font-semibold"
: "font-medium",
)} )}
> >
{reviewCounts.detection > -1 ? ( {reviewCounts.detection > -1 ? (
@ -328,8 +322,7 @@ export default function EventView({
<ActivityIndicator className="size-4" /> <ActivityIndicator className="size-4" />
)} )}
</div> </div>
) : ( <div className="hidden items-center sm:flex">
<>
<MdCircle className="size-2 text-severity_detection md:mr-[10px]" /> <MdCircle className="size-2 text-severity_detection md:mr-[10px]" />
<div className="hidden md:flex md:flex-row md:items-center"> <div className="hidden md:flex md:flex-row md:items-center">
{t("detections")} {t("detections")}
@ -339,8 +332,7 @@ export default function EventView({
<ActivityIndicator className="ml-2 size-4" /> <ActivityIndicator className="ml-2 size-4" />
)} )}
</div> </div>
</> </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]" /> <MdCircle className="size-2 text-severity_significant_motion md:mr-[10px]" />
<div className="hidden md:block">{t("motion.label")}</div> <div className="hidden md:block">{t("motion.label")}</div>
</> </div>
)}
</ToggleGroupItem> </ToggleGroupItem>
</ToggleGroup> </ToggleGroup>