Skip to content

Commit

Permalink
Add a feature-flagged Gates logo
Browse files Browse the repository at this point in the history
Note the feature is always turned off.

Refs https://prereview.slack.com/archives/C047UQFMEFM/p1717528800002019
  • Loading branch information
thewilkybarkid committed Jun 7, 2024
1 parent 0b5a9f7 commit 2f4aa1a
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 0 deletions.
25 changes: 25 additions & 0 deletions assets/logos/gates.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions src/home-page/home-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ import type { RecentReviewRequest } from './recent-review-requests'

export const createPage = ({
canRequestReviews,
canSeeGatesLogo,
recentPrereviews,
recentReviewRequests,
}: {
canRequestReviews: boolean
canSeeGatesLogo: boolean
recentPrereviews: ReadonlyArray<RecentPrereview>
recentReviewRequests: ReadonlyArray<RecentReviewRequest>
}) =>
Expand Down Expand Up @@ -300,6 +302,21 @@ export const createPage = ({
/>
</a>
</li>
${canSeeGatesLogo
? html`
<li>
<a href="https://www.gatesfoundation.org/">
<img
src="${assets['gates.svg']}"
width="500"
height="100"
loading="lazy"
alt="Bill & Melinda Gates Foundation"
/>
</a>
</li>
`
: ''}
<li>
<a href="https://chanzuckerberg.com/">
<img
Expand Down
1 change: 1 addition & 0 deletions src/home-page/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const home = ({
RT.Do,
RT.apS('recentPrereviews', getRecentPrereviews()),
RT.apSW('canRequestReviews', RT.fromReader(canRequestReviews(user))),
RT.let('canSeeGatesLogo', () => false),
RT.apSW('recentReviewRequests', getRecentReviewRequests()),
RT.map(createPage),
)
3 changes: 3 additions & 0 deletions visual-regression/home-page/home-page.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ test('content looks right', async ({ showPage }) => {
const response = createPage({
recentPrereviews: [recentPrereview1, recentPrereview2, recentPrereview3, recentPrereview4, recentPrereview5],
canRequestReviews: false,
canSeeGatesLogo: false,
recentReviewRequests: [
recentReviewRequest1,
recentReviewRequest2,
Expand All @@ -30,6 +31,7 @@ test('content looks right when empty', async ({ showPage }) => {
const response = createPage({
recentPrereviews: [],
canRequestReviews: false,
canSeeGatesLogo: false,
recentReviewRequests: [],
})

Expand All @@ -42,6 +44,7 @@ test('content looks right when reviews can be requested', async ({ showPage }) =
const response = createPage({
recentPrereviews: [recentPrereview1],
canRequestReviews: true,
canSeeGatesLogo: false,
recentReviewRequests: [recentReviewRequest1],
})

Expand Down

0 comments on commit 2f4aa1a

Please sign in to comment.