Skip to content

Commit

Permalink
add: backoffice feature flag wrapper component
Browse files Browse the repository at this point in the history
  • Loading branch information
EnzoVieira committed Jan 26, 2024
1 parent c50dcdd commit 334c41f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
13 changes: 13 additions & 0 deletions components/FeatureFlags/BackOfficeWrapper.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
type BackOfficeWrapperProps = {
children: React.ReactNode;
};

export default function BackOfficeWrapper({
children,
}: BackOfficeWrapperProps) {
if (process.env.NEXT_PUBLIC_BACKOFFICE_FEATURE_FLAG === "true") {
return <>{children}</>;
}

return null;
}
16 changes: 10 additions & 6 deletions components/JoinUs/index.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import BackOfficeWrapper from "@components/FeatureFlags/BackOfficeWrapper";

export default function JoinUs(props) {
return (
<a
href="https://sei23.eventbrite.pt"
className={`flex h-28 w-28 flex-shrink-0 rotate-15 transform items-center justify-center font-ibold text-xl text-${props.fgColor} bg-${props.button} translate-x-0 select-none rounded-full`}
>
Join us 👋
</a>
<BackOfficeWrapper>
<a
href="https://sei23.eventbrite.pt"
className={`flex h-28 w-28 flex-shrink-0 rotate-15 transform items-center justify-center font-ibold text-xl text-${props.fgColor} bg-${props.button} translate-x-0 select-none rounded-full`}
>
Join us 👋
</a>
</BackOfficeWrapper>
);
}

0 comments on commit 334c41f

Please sign in to comment.