Skip to content

Commit

Permalink
style: fix where network switcher opens depending if it's side bar or…
Browse files Browse the repository at this point in the history
… not, and fix other styling issues (#961)

* style: fix where network swithcer opens depending if it's side bar or not, and fix other styling issues

* style: fix padding my transactions
  • Loading branch information
albertfolch-redeemeum authored Dec 8, 2023
1 parent 6468583 commit ea897c4
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 10 deletions.
18 changes: 15 additions & 3 deletions src/components/header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,12 @@ export const HeaderComponent = forwardRef<HTMLElement, Props>(
</Grid>
) : (
<>
<Grid flexDirection="row" alignItems="center" $width="initial">
<Grid
flexDirection="row"
alignItems="center"
$width="initial"
gap="1rem"
>
<LinkWithQuery
to={BosonRoutes.Root}
style={{ display: "flex" }}
Expand All @@ -338,6 +343,7 @@ export const HeaderComponent = forwardRef<HTMLElement, Props>(
src={logoUrl || logo}
alt="logo image"
data-testid="logo"
style={{ maxWidth: "100%" }}
width={logoUrl ? undefined : isLteXS ? 104 : 204}
height={
logoUrl
Expand All @@ -352,7 +358,11 @@ export const HeaderComponent = forwardRef<HTMLElement, Props>(
<X
color={colors.secondary}
onClick={toggleMenu}
style={{ cursor: "pointer" }}
style={{
cursor: "pointer",
minWidth: "24px",
maxWidth: "24px"
}}
size="24"
/>
)}
Expand Down Expand Up @@ -381,7 +391,9 @@ export const HeaderComponent = forwardRef<HTMLElement, Props>(
{!burgerMenuBreakpoint && (
<>
{CTA}
<ChainSelector />
<ChainSelector
leftAlign={navigationBarPosition === "left"}
/>
<ConnectButton />
</>
)}
Expand Down
3 changes: 2 additions & 1 deletion src/components/header/HeaderLinks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ const NavigationLinks = styled.div<{
align-items: stretch;
justify-content: space-between;
gap: 2rem;
a {
a,
[data-anchor] {
justify-content: flex-start;
padding: 0.5rem;
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/header/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export default function Search({ isMobile, navigationBarPosition }: Props) {
isMobile={isMobile}
$navigationBarPosition={navigationBarPosition}
>
{!isMobile && <MagnifyingGlass size={24} />}
{!isMobile && <MagnifyingGlass size={24} style={{ minWidth: "24px" }} />}
<Input
data-testid="search-by-name-input"
onChange={handleChange}
Expand Down
14 changes: 9 additions & 5 deletions src/pages/landing/Landing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const ExploreContainer = styled.div`
margin-top: 2rem;
`;

const DarkerBackground = styled.div`
const DarkerBackground = styled.div.attrs({ id: "darker-background" })`
background-color: var(--secondary);
width: 100vw;
position: relative;
Expand Down Expand Up @@ -90,6 +90,10 @@ export default function Landing() {
const bannerImgPosition = useCustomStoreQueryParameter(
"bannerImgPosition"
) as unknown as "under" | "over" | "";
const navigationBarPosition = useCustomStoreQueryParameter(
"navigationBarPosition"
);
const isSideNavBar = ["left", "right"].includes(navigationBarPosition);
const title = useCustomStoreQueryParameter("title");
const description = useCustomStoreQueryParameter("description");
const bannerUrl = useCustomStoreQueryParameter("bannerUrl");
Expand All @@ -102,6 +106,7 @@ export default function Landing() {
const realBannerImgPosition = title ? bannerImgPosition : "over";
const withUnderBanner = bannerUrl && realBannerImgPosition === "under";
const TitleAndDescriptionWrapper = withUnderBanner ? Layout : Div;
const LayoutWrapper = isSideNavBar ? Grid : DarkerBackground;
return (
<LandingPage isCustomStoreFront={isCustomStoreFront}>
{isCustomStoreFront ? (
Expand Down Expand Up @@ -159,7 +164,6 @@ export default function Landing() {
flexBasis="50%"
flexDirection={isLteS ? "column-reverse" : "row"}
gap="2.5rem"
data-hero-wrapper
>
<GridWithZindex alignItems="flex-start" flexDirection="column">
<Title tag="h1" fontWeight="600">
Expand Down Expand Up @@ -202,16 +206,16 @@ export default function Landing() {
</Grid>
</>
)}
<DarkerBackground>
<LayoutRoot>
<LayoutWrapper>
<LayoutRoot style={{ ...(isSideNavBar && { padding: "initial" }) }}>
<LandingPage
isCustomStoreFront={isCustomStoreFront}
style={{ paddingTop: "2rem", paddingBottom: "2rem" }}
>
<FeaturedOffers title="Products" />
</LandingPage>
</LayoutRoot>
</DarkerBackground>
</LayoutWrapper>
</LandingPage>
);
}

0 comments on commit ea897c4

Please sign in to comment.