Skip to content

Commit

Permalink
Review UI improvements (#11882)
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkeye217 committed Jun 11, 2024
1 parent c9d253a commit bb359f6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
11 changes: 7 additions & 4 deletions web/src/components/filter/ReviewFilterGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -559,14 +559,16 @@ function GeneralFilterButton({
const trigger = (
<Button
size="sm"
variant={selectedLabels?.length ? "select" : "default"}
variant={
selectedLabels?.length || selectedZones?.length ? "select" : "default"
}
className="flex items-center gap-2 capitalize"
>
<FaFilter
className={`${selectedLabels?.length ? "text-selected-foreground" : "text-secondary-foreground"}`}
className={`${selectedLabels?.length || selectedZones?.length ? "text-selected-foreground" : "text-secondary-foreground"}`}
/>
<div
className={`hidden md:block ${selectedLabels?.length ? "text-selected-foreground" : "text-primary"}`}
className={`hidden md:block ${selectedLabels?.length || selectedZones?.length ? "text-selected-foreground" : "text-primary"}`}
>
Filter
</div>
Expand Down Expand Up @@ -641,7 +643,7 @@ type GeneralFilterContentProps = {
updateLabelFilter: (labels: string[] | undefined) => void;
setCurrentLabels: (labels: string[] | undefined) => void;
updateZoneFilter?: (zones: string[] | undefined) => void;
setCurrentZones?: (zones: string[] | undefined) => void;
setCurrentZones: (zones: string[] | undefined) => void;
onClose: () => void;
};
export function GeneralFilterContent({
Expand Down Expand Up @@ -793,6 +795,7 @@ export function GeneralFilterContent({
<Button
onClick={() => {
setCurrentLabels(undefined);
setCurrentZones(undefined);
updateLabelFilter(undefined);
}}
>
Expand Down
12 changes: 8 additions & 4 deletions web/src/components/overlay/MobileReviewSettingsDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,11 @@ export default function MobileReviewSettingsDrawer({
{features.includes("filter") && (
<Button
className="flex w-full items-center justify-center gap-2"
variant={filter?.labels ? "select" : "default"}
variant={filter?.labels || filter?.zones ? "select" : "default"}
onClick={() => setDrawerMode("filter")}
>
<FaFilter
className={`${filter?.labels ? "text-selected-foreground" : "text-secondary-foreground"}`}
className={`${filter?.labels || filter?.zones ? "text-selected-foreground" : "text-secondary-foreground"}`}
/>
Filter
</Button>
Expand Down Expand Up @@ -284,12 +284,16 @@ export default function MobileReviewSettingsDrawer({
<DrawerTrigger asChild>
<Button
className="rounded-lg capitalize"
variant={filter?.labels || filter?.after ? "select" : "default"}
variant={
filter?.labels || filter?.after || filter?.zones
? "select"
: "default"
}
size="sm"
onClick={() => setDrawerMode("select")}
>
<FaCog
className={`${filter?.labels || filter?.after ? "text-selected-foreground" : "text-secondary-foreground"}`}
className={`${filter?.labels || filter?.after || filter?.zones ? "text-selected-foreground" : "text-secondary-foreground"}`}
/>
</Button>
</DrawerTrigger>
Expand Down

0 comments on commit bb359f6

Please sign in to comment.