Skip to content

Commit

Permalink
Add tabbing for search screen view.
Browse files Browse the repository at this point in the history
  • Loading branch information
mathewjordan committed May 28, 2024
1 parent bcf54c6 commit c6a3b3c
Show file tree
Hide file tree
Showing 14 changed files with 479 additions and 107 deletions.
16 changes: 5 additions & 11 deletions components/Chat/Response/Response.styled.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,9 @@ const StyledResponse = styled("section", {
position: "relative",
gap: "$gr5",
zIndex: "0",
margin: "0 $gr4",

"@xl": {
margin: "0 $gr4",
},

"@lg": {
margin: "0",
"h1, h2, h3, h4, h5, h6, strong": {
fontFamily: "$northwesternSansBold",
},
});

Expand All @@ -39,9 +34,7 @@ const StyledResponseContent = styled("div", {
});

const StyledResponseWrapper = styled("div", {
background:
"linear-gradient(0deg, $white calc(100% - 100px), $brightBlueB calc(100% + 100px))",
padding: "$gr6 0 $gr4",
padding: "0",
});

const StyledImages = styled("div", {
Expand Down Expand Up @@ -78,9 +71,10 @@ const StyledImages = styled("div", {
});

const StyledQuestion = styled("h3", {
fontFamily: "$northwesternDisplayBold",
fontFamily: "$northwesternSansBold",
fontWeight: "400",
fontSize: "$gr6",
letterSpacing: "-0.012em",
lineHeight: "1.35em",
margin: "0",
padding: "0 0 $gr3 0",
Expand Down
2 changes: 1 addition & 1 deletion components/Chat/Response/Response.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const ChatResponse: React.FC<ChatResponseProps> = ({
}) => {
return (
<StyledResponseWrapper>
<Container containerType="wide">
<Container>
<StyledResponse>
<StyledResponseContent>
<StyledQuestion>{searchTerm}</StyledQuestion>
Expand Down
36 changes: 0 additions & 36 deletions components/Facets/Facets.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion components/Facets/Filter/Clear.styled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { styled } from "@/stitches.config";
/* eslint sort-keys: 0 */

const FilterClearStyled = styled("button", {
background: "$white",
background: "$transparent",
border: "none",
borderRadius: "50px",
color: "$black50",
Expand Down
2 changes: 1 addition & 1 deletion components/Facets/Filter/Clear.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const FilterClear: React.FC<FilterClearProps> = ({ isModal = false }) => {
isFixed={searchFixed}
isModal={isModal}
>
Clear All
Reset
</FilterClearStyled>
);
};
Expand Down
13 changes: 3 additions & 10 deletions components/Facets/Filter/Filter.styled.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as Dialog from "@radix-ui/react-dialog";

import { IconStyled } from "@/components/Shared/Icon";
import { ValueWrapper } from "@/components/Facets/UserFacets/UserFacets.styled";
import { styled } from "@/stitches.config";
Expand All @@ -15,11 +16,12 @@ const FilterActivate = styled(Dialog.Trigger, {
backgroundColor: "$purple",
border: "0",
color: "$white",
fontFamily: "$northwesternSansBold",
fontFamily: "$northwesternSansRegular",
fontSize: "$gr3",
borderRadius: "50px",
transition: "$dcAll",
padding: "0 $gr3 0 $gr1",
boxShadow: "0px 3px 15px #0002",

[`& ${IconStyled}`]: {
color: "$purple60",
Expand All @@ -29,7 +31,6 @@ const FilterActivate = styled(Dialog.Trigger, {
"&:hover": {
backgroundColor: "$purple120",
color: "$white",
boxShadow: "2px 2px 2px #0002",

[`& ${IconStyled}`]: {
color: "$white",
Expand All @@ -46,14 +47,6 @@ const FilterFloating = styled("div", {
boxShadow: "2px 2px 5px #0002",
borderRadius: "50px",
transition: "$dcAll",

[`& ${FilterActivate}`]: {
boxShadow: "2px 2px 5px #0002",
},

"&:hover": {
boxShadow: "2px 2px 5px #0004",
},
});

const FilterClose = styled(Dialog.Close, {});
Expand Down
12 changes: 12 additions & 0 deletions components/Facets/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import FacetsFilter from "@/components/Facets/Filter/Filter";
import { FilterProvider } from "@/context/filter-context";

const Facets: React.FC = () => {
return (
<FilterProvider>
<FacetsFilter />
</FilterProvider>
);
};

export default Facets;
188 changes: 188 additions & 0 deletions components/Search/Options.styled.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
import { IconStyled } from "../Shared/Icon";
import { Wrapper as WorkTypeWrapper } from "@/components/Facets/WorkType/WorkType.styled";
import { styled } from "@/stitches.config";

/* eslint sort-keys: 0 */

const StyledOptionsBar = styled("div", {
display: "flex",
justifyContent: "space-between",
position: "relative",
left: "0",
transition: "$dcScrollLeft",
zIndex: "1",
gap: "$gr3",

[`& ${WorkTypeWrapper}`]: {
borderRight: "1px solid $black10",
paddingRight: "$gr2",
transition: "$dcWidth",

"@sm": {
marginTop: "$gr3",
borderRight: "none",
paddingRight: "0",
},
},

"@sm": {
padding: "$gr4 0",
flexDirection: "column",
alignItems: "center",
},
});

const StyledOptionsWidth = styled("span", {
position: "absolute",
width: "100%",
});

const StyledOptionsFacets = styled("div", {
variants: {
isTabResults: {
false: {
display: "none",
},
true: {
display: "flex",
width: "100%",
justifyContent: "space-between",
},
},
},
});

const StyledOptionsExtras = styled("div", {
display: "flex",

"@sm": {
marginTop: "$gr4",
flexDirection: "column-reverse",
alignItems: "center",
},
});

const StyledOptionsTabs = styled("div", {
[`div[role="tablist"]`]: {
display: "flex",
flexShrink: "0",
flexGrow: "0",
flexWrap: "nowrap",
height: "38px",
boxShadow: "0px 3px 15px #0002",
borderRadius: "50px",
overflow: "hidden",

button: {
cursor: "pointer",
backgroundColor: "$purple",
border: "0",
color: "$white",
fontFamily: "$northwesternSansRegular",
fontSize: "$gr3",
padding: "0 $gr3",
transition: "$dcAll",
whiteSpace: "nowrap",
display: "flex",
alignItems: "center",

"&[data-state=active]": {
backgroundColor: "$purple",

[`& ${IconStyled}`]: {
color: "$purple30",
fill: "$purple30",
},
},

"&[data-state=inactive]": {
backgroundColor: "$white",
color: "$black50",

[`& ${IconStyled}`]: {
color: "$black20",
fill: "$black20",
},
},

"&:first-child": {
paddingLeft: "$gr1",
// borderRight: "1px solid $purple60",
},

"&:last-child": {
// borderRight: "1px solid $purple60",
},

"&:hover": {
backgroundColor: "$purple120",
color: "$white",

[`& ${IconStyled}`]: {
color: "$white",
fill: "$white",
},
},
},

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

const StyledOptions = styled("div", {
height: "38px",
transition: "$dcScrollHeight",
padding: "$gr4 0 0",
margin: "0 0 $gr6",

"@sm": {
backgroundColor: "$gray6",
height: "225px",
},

".facets-ui-container": {
transition: "$dcAll",
},

"&[data-filter-fixed='true']": {
flexGrow: "0",
flexShrink: "1",
height: "38px",

"@sm": {
backgroundColor: "transparent",
margin: "0",
},

[`& ${StyledOptionsExtras}`]: {
width: "0",
opacity: "0",
},

[`& ${StyledOptionsBar}`]: {
position: "fixed",
margin: "0",
top: "$gr6",
left: "50%",
zIndex: "1",
transform: "translate(-50%)",
backfaceVisibility: "hidden",
webkitFontSmoothing: "subpixel-antialiased",

"@sm": {
top: "$gr5",
},
},
},
});

export {
StyledOptions,
StyledOptionsBar,
StyledOptionsExtras,
StyledOptionsFacets,
StyledOptionsTabs,
StyledOptionsWidth,
};
Loading

0 comments on commit c6a3b3c

Please sign in to comment.