Skip to content

Commit

Permalink
Update mobile styling for Work Filter
Browse files Browse the repository at this point in the history
  • Loading branch information
adamjarling committed Feb 6, 2023
1 parent de832cd commit 7c11162
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 7 deletions.
5 changes: 5 additions & 0 deletions components/Facets/Filter/Filter.styled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ const FilterFooter = styled("footer", {
width: "100%",
display: "flex",
justifyContent: "space-between",
alignItems: "center",

button: {
display: "flex",
Expand All @@ -129,6 +130,10 @@ const FilterFooter = styled("footer", {
"&:last-child": {
marginRight: "0",
},

"@sm": {
fontSize: "$gr3",
},
},
});

Expand Down
24 changes: 23 additions & 1 deletion components/Facets/Filter/GroupList.styled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { styled } from "@/stitches.config";

/* eslint sort-keys: 0 */

const Group = styled(Accordion.Item, {});

const GroupContent = styled(Accordion.Content, {
marginBottom: "$gr2",
});
Expand Down Expand Up @@ -76,6 +78,10 @@ const GroupToggle = styled(Accordion.Trigger, {
opacity: "1",
},
},

"@sm": {
height: "$gr4",
},
});

const ItemList = styled(Tabs.List, {
Expand Down Expand Up @@ -123,13 +129,28 @@ const ItemToggle = styled(Tabs.Trigger, {
"&:hover, &:focus": {
color: "$purple",
},

"@sm": {
height: "$gr4",
},
});

const ItemContent = styled(Tabs.Content, {
padding: "0.5rem 2rem",

"@md": {
padding: "0.5rem $gr3 0.5rem $gr3",
},
});

const Group = styled(Accordion.Item, {});
const TabsRoot = styled(Tabs.Root, {
display: "flex",
padding: "1rem 0",

"@sm": {
flexDirection: "column",
},
});

export {
Group,
Expand All @@ -140,4 +161,5 @@ export {
ItemContent,
ItemList,
ItemToggle,
TabsRoot,
};
7 changes: 3 additions & 4 deletions components/Facets/Filter/GroupList.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as Accordion from "@radix-ui/react-accordion";
import * as Tabs from "@radix-ui/react-tabs";
import { ALL_FACETS, FACETS } from "@/lib/constants/facets-model";
import {
Group,
Expand All @@ -10,6 +9,7 @@ import {
ItemContent,
ItemList,
ItemToggle,
TabsRoot,
} from "@/components/Facets/Filter/GroupList.styled";
import Facet from "@/components/Facets/Facet/Facet";
import { IconChevronDown } from "@/components/Shared/SVG/Icons";
Expand All @@ -30,10 +30,9 @@ const FacetsGroupList: React.FC = () => {
}

return (
<Tabs.Root
<TabsRoot
defaultValue={defaultFacetId}
orientation="vertical"
style={{ display: "flex", padding: "1rem 0" }}
data-testid="facets-group-list"
>
<Accordion.Root type="single" defaultValue={defaultGroup}>
Expand Down Expand Up @@ -70,7 +69,7 @@ const FacetsGroupList: React.FC = () => {
</ItemContent>
);
})}
</Tabs.Root>
</TabsRoot>
);
};

Expand Down
8 changes: 7 additions & 1 deletion components/Facets/Filter/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,13 @@ const FilterModal: React.FC<FilterModalProps> = ({ q, setIsModalOpen }) => {
Results for &ldquo;<strong>{q}</strong>&rdquo;
</em>
)}
<FilterClose data-testid="facets-filter-close" aria-label="Cancel">
<FilterClose
data-testid="facets-filter-close"
aria-label="Cancel"
style={{
marginRight: "0",
}}
>
<IconClear />
</FilterClose>
</FilterHeader>
Expand Down
11 changes: 11 additions & 0 deletions components/Facets/Filter/Preview.styled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ const PreviewItem = styled("li", {
overflowWrap: "anywhere",
whiteSpace: "break-spaces",
},

"@md": {
padding: "0 $gr3",
},
});

const PreviewList = styled("ul", {
Expand All @@ -51,11 +55,18 @@ const PreviewList = styled("ul", {
});

const StyledPreview = styled("div", {
paddingTop: "1.5rem",

[`& ${StyledHeading}`]: {
fontFamily: "$northwesternDisplayBold",
fontSize: "$gr5",
fontWeight: "400",
padding: "0 $gr4",
marginTop: "0",

"@md": {
padding: "0 $gr3",
},
},
});

Expand Down
2 changes: 1 addition & 1 deletion components/Facets/Filter/Submit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const FacetsFilterSubmit: React.FC<FacetsFilterSubmitProps> = ({
};

return (
<div data-testid="facets-submit">
<div data-testid="facets-submit" style={{ display: "flex" }}>
<Button
isPrimary
isLowercase
Expand Down

0 comments on commit 7c11162

Please sign in to comment.