Skip to content

Commit

Permalink
[C] styled-components props cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgoff committed Jun 21, 2024
1 parent 4bd1a58 commit b1b9ff9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions components/layout/NavButtons/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const NavButtons = ({
passHref={true}
>
<NavButton
active={
$active={
hasDefault ? activeType !== linkRight : activeType === linkLeft
}
onClick={() => setActiveType(linkLeft)}
Expand Down Expand Up @@ -68,7 +68,7 @@ const Nav = styled.nav`
> * {
margin-left: 0.5em;
}
${respond(`
${respond(`
float: none;
top: 40px;
display: grid;
Expand All @@ -88,7 +88,7 @@ const NavButton = styled.a`
padding: 1em 2em;
background-color: var(--neutral10);
${(p) =>
p.active
p.$active
? `background-color: var(--turquoise60); color: var(--white);`
: `&:hover {
background-color: var(--turquoise20);
Expand All @@ -99,7 +99,7 @@ const NavButton = styled.a`
place-content: center;
min-width: auto;
padding: 0.5em;
font-size: 24px;
font-size: 24px;
`)}
`;

Expand Down
4 changes: 2 additions & 2 deletions components/layout/Tabs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const Tabs = ({ children, labels, defaultTab = 0 }) => {
</Tab>
))}
</TabList>
<TabPanel active={active}>{childrenWithPanelProps}</TabPanel>
<TabPanel $active={active}>{childrenWithPanelProps}</TabPanel>
</TabContainer>
);
};
Expand Down Expand Up @@ -150,7 +150,7 @@ const TabPanel = styled.div`
}
${(p) =>
`>*:nth-child(${
p.active + 1
p.$active + 1
}) {z-index: 1; opacity: 1; visibility: visible;}`}
`;

Expand Down
10 changes: 5 additions & 5 deletions components/page/FilterBar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const FilterBar = ({ filterType, setLiveRegionMessage }) => {
<div></div>
<span>Filter</span>
</ToggleButton>
<ToggleDropdown id="filter-dropdown" opened={filterOpen}>
<ToggleDropdown id="filter-dropdown" $opened={filterOpen}>
<li>
<MixedLink url={asPath} params={{ filter: "" }}>
<T i18nKey={`filters.all`} />
Expand Down Expand Up @@ -121,7 +121,7 @@ const FilterBar = ({ filterType, setLiveRegionMessage }) => {
<div id="sort"></div>
<span>{t(`filters.sort`)}</span>
</ToggleButton>
<ToggleDropdown id="sort-dropdown" opened={sortOpen}>
<ToggleDropdown id="sort-dropdown" $opened={sortOpen}>
{sortItems.map((item, i) => {
const active = query?.sort?.includes(item.slug);

Expand Down Expand Up @@ -251,12 +251,12 @@ const ToggleButton = styled.button`
const ToggleDropdown = styled.ul`
position: absolute;
top: 40px;
opacity: ${(p) => (p.opened ? 1 : 0)};
visibility: ${(p) => (p.opened ? "visible" : "hidden")};
opacity: ${(p) => (p.$opened ? 1 : 0)};
visibility: ${(p) => (p.$opened ? "visible" : "hidden")};
width: 300px;
background-color: var(--neutral20);
transition: opacity 0.2s;
z-index: ${(p) => (p.opened ? 1 : -1)};
z-index: ${(p) => (p.$opened ? 1 : -1)};
${respond(`width: auto;`, "640px")}
li {
Expand Down

0 comments on commit b1b9ff9

Please sign in to comment.