Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
18 changes: 9 additions & 9 deletions components/reverse-prompt-home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -487,15 +487,6 @@ export function ReversePromptHome({
</div>
))}
</div>
<div className="flex flex-wrap items-center justify-between gap-3 rounded-lg border border-zinc-900/15 bg-white/50 px-3 py-2.5">
<p className="text-xs text-zinc-600">Advertise your website</p>
<Link
href="/sponsor"
className="shrink-0 rounded border border-zinc-300 bg-white px-2.5 py-1 text-xs font-semibold text-zinc-700 transition-colors hover:border-zinc-500 hover:text-zinc-900 focus-visible:outline-2 focus-visible:outline-offset-2"
>
Claim spot
</Link>
</div>
</div>
) : null}
</form>
Expand Down Expand Up @@ -649,6 +640,15 @@ export function ReversePromptHome({
>
Discord
</a>
<span className="mx-2 text-zinc-300" aria-hidden>
·
</span>
<Link
href="/sponsor"
className="font-medium text-[#d31611] underline decoration-[#d31611] underline-offset-2 transition-colors hover:text-[#b0120e] hover:decoration-[#b0120e]"
>
Advertise
</Link>
</p>
</footer>
) : null}
Expand Down
17 changes: 6 additions & 11 deletions tests/sponsorship-ui.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,15 @@ test("sponsor page has requested audience snapshot and logos, with contact only
});


test("home footer preserves Discord while claim card sits below the example repos", () => {
test("home footer places Advertise beside Discord without a repo-example ad card", () => {
const home = readFileSync("components/reverse-prompt-home.tsx", "utf8");
const footer = home.slice(home.indexOf("<footer"), home.indexOf("</footer>"));
assert.match(footer, /href="https:\/\/discord\.gg\/eHN86K7rBj"/);
assert.match(footer, /Discord/);
assert.doesNotMatch(footer, /Advertise|Claim spot/);
assert.match(footer, /href="https:\/\/filiksyos.com"/);
const examplesEnd = home.indexOf("Advertise your website");
assert.ok(examplesEnd > home.indexOf("Try example repos:"));
assert.ok(examplesEnd < home.indexOf("</form>"));
const card = home.slice(examplesEnd, home.indexOf("</form>"));
assert.match(card, /href="\/sponsor"/);
assert.match(card, /Claim spot/);
assert.doesNotMatch(home, /Sponsor this spot/);
assert.match(footer, /href="\/sponsor"/);
assert.ok(footer.indexOf("Advertise") > footer.indexOf("Discord"));
assert.doesNotMatch(home, /Advertise your website|Claim spot|Sponsor this spot/);
assert.match(home, /Try example repos:/);
assert.doesNotMatch(home.slice(0, home.indexOf("<footer")), /href="\/sponsor"/);
});


Loading