Skip to content

Commit

Permalink
chore: make feature flag check static
Browse files Browse the repository at this point in the history
- As per: #2632 (comment)
  • Loading branch information
Mike-Heneghan committed Jan 18, 2024
1 parent aa17f63 commit adcb8c2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const CloseButton = styled(Box)(({ theme }) => ({
color: theme.palette.text.primary,
}));

const isUsingFeatureFlag = () => hasFeatureFlag("SHOW_INTERNAL_FEEDBACK");
const isUsingFeatureFlag = hasFeatureFlag("SHOW_INTERNAL_FEEDBACK");

interface IMoreInfo {
open: boolean;
Expand Down Expand Up @@ -98,7 +98,7 @@ const MoreInfo: React.FC<IMoreInfo> = ({ open, children, handleClose }) => (
<Container maxWidth={false} role="main" sx={{ bgcolor: "white" }}>
<DrawerContent>{children}</DrawerContent>
</Container>
{isUsingFeatureFlag() && <MoreInfoFeedbackComponent />}
{isUsingFeatureFlag && <MoreInfoFeedbackComponent />}
</Root>
);

Expand Down
4 changes: 2 additions & 2 deletions editor.planx.uk/src/pages/layout/PublicLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ const PublicFooter: React.FC = () => {
Boolean(item),
);

const isUsingFeatureFlag = () => hasFeatureFlag("SHOW_INTERNAL_FEEDBACK");
const isUsingFeatureFlag = hasFeatureFlag("SHOW_INTERNAL_FEEDBACK");

return (
<Box>
{isUsingFeatureFlag() ? <Feedback /> : <PhaseBanner />}
{isUsingFeatureFlag ? <Feedback /> : <PhaseBanner />}
<Footer items={[...footerItems]}>
<Box display="flex" alignItems="center">
<Box pr={2} display="flex">
Expand Down

0 comments on commit adcb8c2

Please sign in to comment.