Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add startups sidebar to partners #2688

Merged
merged 5 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/app/layouts/default/header/menus/main-menu/main-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ import {treatSpaceOrEnterAsClick} from '~/helpers/events';
import './main-menu.scss';

function DropdownOrMenuItem({item}) {
if (! item.name && ! item.label) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some spaces here?

return null;
}
if ('menu' in item) {
return (
<Dropdown label={item.name} navAnalytics={`Main Menu (${item.name})`}>
Expand Down
2 changes: 2 additions & 0 deletions src/app/pages/partners/active-filters/active-filters.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
.active-filters {
@extend %content;

padding: 0;

@include wider-than($phone-max) {
margin-top: 4rem;
}
Expand Down
21 changes: 15 additions & 6 deletions src/app/pages/partners/results/results.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
@import 'mixins/placeholder-selectors';

.partners .results {
align-items: start;
padding: 2rem $normal-margin 20rem;
row-gap: 2rem;

@include width-up-to($phone-max) {
padding: 0 $normal-margin 6rem;
Expand All @@ -14,6 +12,16 @@
min-height: 60rem;
}

>:first-child {
@include width-up-to($phone-max) {
margin-bottom: $normal-margin;
}

@include wider-than($phone-max) {
margin-bottom: 3rem;
}
}

h2 {
margin: 0;
}
Expand Down Expand Up @@ -106,10 +114,11 @@
}

.boxed {
grid-gap: 3rem;
gap: 3rem;

@include width-up-to($phone-max) {
grid-gap: $normal-margin;
gap: $normal-margin;
padding: 0;
}
}

Expand All @@ -123,11 +132,11 @@
padding: 0;
}

&,
.sidebar-content {
display: flex;
flex-direction: column;
grid-gap: 3rem;
margin-top: 3rem;
gap: $normal-margin;
}
}

Expand Down
31 changes: 19 additions & 12 deletions src/app/pages/partners/results/results.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ function resultEntry(pd: PartnerData) {
cost: pd.affordability_cost,
rating: pd.average_rating.rating__avg,
ratingCount: pd.rating_count,
partnershipLevel: pd.partnership_level as string,
partnershipLevel: pd.partnership_level,
yearsAsPartner: pd.partner_anniversary_date
? differenceInYears(
Date.now(),
Expand Down Expand Up @@ -301,18 +301,25 @@ function ResultGridLoader({
linkTexts={linkTexts}
entries={filteredEntries}
/>
<div className="with-sidebar">
<div className="boxed">
{otherAges.map((age) => (
<HeadingAndResultGrid
key={age}
age={age}
entries={partnersByAge[age]}
/>
))}
{
otherAges.length > 0
? <div className="with-sidebar">
<div className="boxed">
{otherAges.map((age) => (
<HeadingAndResultGrid
key={age}
age={age}
entries={partnersByAge[age]}
/>
))}
</div>
<Sidebar entries={startups} />
</div>
<Sidebar entries={startups} />
</div>
: <div className="boxed">
<h2>Startups</h2>
<ResultGrid entries={startups} />
</div>
}
</section>
);
}
Expand Down