Skip to content

Commit

Permalink
chore(app, platforms): feature flag poap stamp (passportxyz#1447)
Browse files Browse the repository at this point in the history
* chore(app, platforms): feature flag poap stamp

* fix(app): remove poap from ui test
  • Loading branch information
Tim Schultz authored Jul 7, 2023
1 parent 117f4d1 commit 0dc836c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
4 changes: 2 additions & 2 deletions app/__tests__/components/ExpiredStampModal.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ describe("ExpiredStampModal", () => {
it("should render a list of platforms", () => {
renderWithContext(
{} as UserContextState,
{ ...mockCeramicContext, expiredProviders: ["Linkedin", "Ens", "POAP", "Lens"] },
{ ...mockCeramicContext, expiredProviders: ["Linkedin", "Ens", "Lens"] },
<ExpiredStampModal isOpen={true} onClose={() => {}} />
);

const exptedProviders = ["Linkedin", "ENS", "POAP", "Lens"];
const exptedProviders = ["Linkedin", "ENS", "Lens"];
exptedProviders.forEach((platform: string) => {
expect(screen.getByText(platform)).toBeInTheDocument();
});
Expand Down
10 changes: 6 additions & 4 deletions app/context/ceramicContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,12 @@ platforms.set("ETH", {
platFormGroupSpec: ETH.ProviderConfig,
});

platforms.set("POAP", {
platform: new POAP.POAPPlatform(),
platFormGroupSpec: POAP.ProviderConfig,
});
if (process.env.NEXT_PUBLIC_FF_NEW_POAP_STAMPS === "on") {
platforms.set("POAP", {
platform: new POAP.POAPPlatform(),
platFormGroupSpec: POAP.ProviderConfig,
});
}

platforms.set("Discord", {
platform: new Discord.DiscordPlatform(),
Expand Down
5 changes: 4 additions & 1 deletion platforms/src/platforms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ const platforms: Record<string, PlatformConfig> = {
Facebook,
Linkedin,
Ens,
POAP,
Brightid,
Poh,
ETH,
Expand All @@ -63,4 +62,8 @@ const platforms: Record<string, PlatformConfig> = {
Idena,
};

if (process.env.NEXT_PUBLIC_FF_NEW_POAP_STAMPS === "on") {
platforms.POAP = POAP;
}

export default platforms;

0 comments on commit 0dc836c

Please sign in to comment.