Repository navigation
feat: co-branding links, starting with the T4P member name tag - #185
Merged
Merged
Conversation
A link like ?b=<code> turns on a co-branded overlay by default; people can still switch it off. Which code unlocks which brand, and the brand's text, live in the BRAND_LINKS secret, never in the repo, so a campaign is started, reworded or ended from the Cloudflare dashboard. The first brand is the membership-launch "Hello, I'm a T4P member" sticker with a join link along the ring.
Deploying palestine-pfp-maker with
|
| Latest commit: |
c98ccd3
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://b73b72e5.palestine-pfp-maker.pages.dev |
| Branch Preview URL: | https://mostafazh-members-banner.palestine-pfp-maker.pages.dev |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds co-branding links to PPM. The first one is the membership-launch "Hello, I'm a T4P member" name tag (design #8 from the Mattermost vote).
A link like
ppm.techforpalestine.org/?b=<code>turns a co-branded overlay on by default, and people can still switch it off. Without a valid code the page is unchanged.Which code unlocks which brand, and the brand's text, live only in the
BRAND_LINKSsecret, never in the repo:{ "<code>": { "brand": "t4p-member", "text": { "link": "join at t4p.al/j" } } }textis optional and overrides the brand's defaults key by key (label,hintand whatever the overlay draws), so changing the wording takes no code change. Edit the secret, then retry the deployment.BRANDSentry insrc/app/brands.tsx.Changes
src/lib/brands.ts:resolveBrandparses the secret. It accepts only known codes (no inherited keys), keeps short strings only, and turns co-branding off if the secret is broken.src/app/api/brand/route.ts:GET /api/brand?code=, rate limited to 20 per minute per IP and never cached.src/app/brands.tsx: the overlay registry with default text.src/app/member-tag.tsx: the name tag overlay. The handwritten "T4P member" is outlined path data inmember-tag-marker.ts, because html-to-image dropped the web font and fell back to serif in the downloaded PNG.page.tsx/share-panel.tsx: the overlay is chosen once and mirrored onto the story card. The co-brand replaces theppm.t4p.alring label, since both use the ring's bottom arc.Downloadedgains acobrandprop, either the brand id oroff.Config
BRAND_LINKSis set as a secret for Production and Preview, as{"t4p-members":{"brand":"t4p-member"}}.?b=t4p-members.Before going live
t4p.al/jredirect to the membership page exists. An IT request is filed. The frame prints "join at t4p.al/j"; if IT picks another path, change it withtext.linkin the secret.Verification
tsc --noEmit: clean.eslint: 0 errors, with 2 existing<img>warnings.vitest: 164/164 pass, including the newbrands.test.ts.branding,generate-pfpandstart-overspecs: 30/30 pass on chromium, firefox and webkit. They check that the sticker and link are in the downloaded PNG, that the tag is on by default and can be switched off, that the secret's text override works, and that nothing is offered without a valid code.