-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b092a38
commit b5a5d95
Showing
5 changed files
with
214 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
app/javascript/modules/listings/DirectoryPageNavigationBar.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
.directory-page-navigation-bar { | ||
position: sticky; | ||
top: 0; | ||
z-index: 1; | ||
background-color: #fff; | ||
margin: 0 auto; | ||
width: 100%; | ||
max-width: var(--bloom-width-5xl); | ||
|
||
--inter-row-gap: var(--bloom-s12); | ||
--max-width: var(--bloom-width-3xl); | ||
--max-width-large-screen: var(--bloom-width-5xl); | ||
--margin: var(--inter-row-gap) auto; | ||
--seeds-focus-ring-box-shadow: none !important; | ||
--seeds-focus-ring-outline: none !important; | ||
|
||
display: flex; | ||
flex-direction: row; | ||
max-width: var(--max-width); | ||
overflow-x: auto; | ||
overflow-y: hidden; | ||
margin: var(--margin); | ||
|
||
a:focus { | ||
box-shadow: none !important; | ||
} | ||
|
||
@media (min-width: $screen-lg) { | ||
--max-width: var(--max-width-large-screen); | ||
} | ||
|
||
.seeds-button { | ||
flex: 1 0 0; | ||
min-width: max-content; | ||
margin-left: 16px; | ||
padding: var(--sizes-size-s4, 16px) var(--sizes-size-s6, 24px); | ||
|
||
background: var(--components-tabs-background-color, #fff); | ||
color: var(--components-tabs-label-color, #767676); | ||
border: var(--borders-width-1, 1px) solid var(--components-tabs-border-color, #dedee0); | ||
border-radius: 0px; | ||
} | ||
.seeds-button:hover, | ||
.active { | ||
color: var(--components-tabs-active-label-color, #222); | ||
background: var(--components-tabs-background-color); | ||
|
||
border-top: var(--borders-width-1, 1px) solid var(--components-tabs-border-color, #dedee0); | ||
border-right: var(--borders-width-1, 1px) solid var(--components-tabs-border-color, #dedee0); | ||
border-left: var(--borders-width-1, 1px) solid var(--components-tabs-border-color, #dedee0); | ||
border-bottom: var(--components-tabs-active-indicator-width, 2px) solid | ||
var(--components-tabs-active-indicator-color, #0077da); | ||
} | ||
} |
64 changes: 64 additions & 0 deletions
64
app/javascript/modules/listings/DirectoryPageNavigationBar.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import React from "react" | ||
import "./DirectoryPageNavigationBar.scss" | ||
import { Button } from "@bloom-housing/ui-seeds" | ||
import { Icon } from "@bloom-housing/ui-components" | ||
|
||
const DirectoryPageNavigationBar = ({ | ||
directoryType, | ||
listingLengths, | ||
activeItem, | ||
setActiveItem, | ||
}: { | ||
directoryType: string | ||
listingLengths: { open: number; upcoming: number; fcfs: number; results: number } | ||
activeItem: string | ||
setActiveItem: React.Dispatch<string> | ||
}) => { | ||
return ( | ||
<div className="directory-page-navigation-bar"> | ||
<Button | ||
onClick={() => { | ||
document.querySelector("#enter-a-lottery").scrollIntoView({ behavior: "smooth" }) | ||
setActiveItem("enter-a-lottery") | ||
}} | ||
className={activeItem === "enter-a-lottery" ? "active" : ""} | ||
> | ||
<Icon size="medium" symbol="house" /> | ||
Enter a lottery ({listingLengths.open}) | ||
</Button> | ||
{directoryType === "forSale" && ( | ||
<Button | ||
onClick={() => { | ||
document.querySelector("#buy-now").scrollIntoView({ behavior: "smooth" }) | ||
setActiveItem("buy-now") | ||
}} | ||
className={activeItem === "buy-now" ? "active" : ""} | ||
> | ||
<Icon size="medium" symbol="house" /> | ||
Buy now ({listingLengths.fcfs}) | ||
</Button> | ||
)} | ||
<Button | ||
onClick={() => { | ||
document.querySelector("#upcoming-lotteries").scrollIntoView({ behavior: "smooth" }) | ||
setActiveItem("upcoming-lotteries") | ||
}} | ||
className={activeItem === "upcoming-lotteries" ? "active" : ""} | ||
> | ||
<Icon size="medium" symbol="clock" /> | ||
Upcoming lotteries ({listingLengths.upcoming}) | ||
</Button> | ||
<Button | ||
onClick={() => { | ||
document.querySelector("#lottery-results").scrollIntoView({ behavior: "smooth" }) | ||
setActiveItem("lottery-results") | ||
}} | ||
className={activeItem === "lottery-results" ? "active" : ""} | ||
> | ||
<Icon size="medium" symbol="clock" /> | ||
Lottery results ({listingLengths.results}) | ||
</Button> | ||
</div> | ||
) | ||
} | ||
export default DirectoryPageNavigationBar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.site-content { | ||
scroll-behavior: smooth; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters