Skip to content

Commit 1d00434

Browse files
authored
Add merch card to resources menu (#1060)
lgtm!
1 parent 5153a18 commit 1d00434

File tree

4 files changed

+20
-13
lines changed

4 files changed

+20
-13
lines changed

components/Header.tsx

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ import Link from "next/link"
22
import { FormattedMessage, useIntl } from "react-intl"
33

44
import mastodonLogo from "../public/logos/wordmark-white-text.svg"
5+
import merch from "../public/merch.jpg"
56
import Image from "next/legacy/image"
7+
import NewImage from "next/image"
68
import { useState, useEffect, useRef, useId } from "react"
79
import classNames from "classnames"
810
import { locales } from "../data/locales"
@@ -111,18 +113,6 @@ const Header = ({ transparent = true }: HeaderProps) => {
111113
/>
112114
),
113115
},
114-
{
115-
value: "https://shop.joinmastodon.org/",
116-
label: (
117-
<FormattedMessage id="nav.merch.title" defaultMessage="Merch" />
118-
),
119-
description: (
120-
<FormattedMessage
121-
id="nav.merch.description"
122-
defaultMessage="Support your friends building Mastodon (and look cool while doing it)."
123-
/>
124-
),
125-
},
126116
{
127117
value: "/verification",
128118
label: (
@@ -139,6 +129,20 @@ const Header = ({ transparent = true }: HeaderProps) => {
139129
),
140130
},
141131
],
132+
banner: <div className="md:px-3">
133+
<a href="https://shop.joinmastodon.org/" className="block relative overflow-hidden rounded-md inset-ring">
134+
<NewImage src={merch} fill={true} className='absolute z-0 object-cover' alt='' />
135+
136+
<div className="relative pt-32 text-white py-3 px-5 md:px-4 bg-overlay-gradient">
137+
<span className="block font-extrabold"><FormattedMessage id="nav.merch.title" defaultMessage="Merch" /></span>
138+
139+
<span className="mt-1 block font-extranormal"><FormattedMessage
140+
id="nav.merch.description"
141+
defaultMessage="Support your friends building Mastodon."
142+
/></span>
143+
</div>
144+
</a>
145+
</div>,
142146
footer: {
143147
value: "https://github.com/mastodon/mastodon",
144148
label: (
@@ -292,6 +296,8 @@ const Header = ({ transparent = true }: HeaderProps) => {
292296
))}
293297
</ul>
294298

299+
{item.banner}
300+
295301
{item.footer && (
296302
<div className="md:bg-gray-4 md:p-4">
297303
<a

locales/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134
"nav.docs.title": "Documentation",
135135
"nav.hosting.title": "For Institutions",
136136
"nav.impressum.title": "Impressum",
137-
"nav.merch.description": "Support your friends building Mastodon (and look cool while doing it).",
137+
"nav.merch.description": "Support your friends building Mastodon.",
138138
"nav.merch.title": "Merch",
139139
"nav.privacy_policy.title": "Privacy Policy",
140140
"nav.product.title": "Product",

public/merch.jpg

148 KB
Loading

tailwind.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ const config = {
105105
},
106106
backgroundImage: {
107107
"blurple-gradient": `linear-gradient(0deg, #563acc 12.87%, #6364ff 88.62%)`,
108+
"overlay-gradient": `linear-gradient(180deg, rgba(29,0,35, 0) 12.87%, rgba(29,0,35, 1) 100%)`,
108109
},
109110
gap: {
110111
gutter: "var(--gutter-width)",

0 commit comments

Comments
 (0)