Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(PC-34367) feat(firebase): add link to staging and production feature… #7647

Merged
merged 1 commit into from
Feb 7, 2025
Merged
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
49 changes: 47 additions & 2 deletions src/cheatcodes/pages/others/CheatcodesScreenFeatureFlags.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,56 @@ import styled from 'styled-components/native'

import { CheatcodesTemplateScreen } from 'cheatcodes/components/CheatcodesTemplateScreen'
import { useFeatureFlagAll } from 'cheatcodes/hooks/useFeatureFlagAll'
import { env } from 'libs/environment/env'
import { ButtonInsideText } from 'ui/components/buttons/buttonInsideText/ButtonInsideText'
import { Separator } from 'ui/components/Separator'
import { TypoDS, getSpacing } from 'ui/theme'
import { ExternalTouchableLink } from 'ui/components/touchableLink/ExternalTouchableLink'
import { ExternalSiteFilled } from 'ui/svg/icons/ExternalSiteFilled'
import { Spacer, TypoDS, getSpacing } from 'ui/theme'

export const CheatcodesScreenFeatureFlags = () => {
const featureFlags = useFeatureFlagAll()
const featureFlagsArray = Object.entries(featureFlags)

const title = `Feature Flags ${env.ENV} 🏳️`
const showTestingFeatureFlags = env.ENV !== 'testing'
const showStagingFeatureFlags = env.ENV !== 'staging'
const showProductionFeatureFlags = env.ENV !== 'production'

return (
<CheatcodesTemplateScreen title="Feature Flags 🏳️" flexDirection="column">
<CheatcodesTemplateScreen title={title} flexDirection="column">
{showTestingFeatureFlags ? (
<ExternalTouchableLink
as={ButtonInsideTextBlack}
buttonHeight="extraSmall"
icon={ExternalSiteFilled}
wording="Voir les feature flags testing"
externalNav={{
url: 'https://app.testing.passculture.team/cheatcodes/other/feature-flags',
}}
/>
) : null}
{showStagingFeatureFlags ? (
<ExternalTouchableLink
as={ButtonInsideTextBlack}
buttonHeight="extraSmall"
icon={ExternalSiteFilled}
wording="Voir les feature flags staging"
externalNav={{
url: 'https://app.staging.passculture.team/cheatcodes/other/feature-flags',
}}
/>
) : null}
{showProductionFeatureFlags ? (
<ExternalTouchableLink
as={ButtonInsideTextBlack}
buttonHeight="extraSmall"
icon={ExternalSiteFilled}
wording="Voir les feature flags production"
externalNav={{ url: 'https://passculture.app/cheatcodes/other/feature-flags' }}
/>
) : null}
<Spacer.Column numberOfSpaces={6} />
<TypoDS.BodyItalicAccent>
Nombre de feature flags&nbsp;: {featureFlagsArray.length}
</TypoDS.BodyItalicAccent>
Expand Down Expand Up @@ -45,3 +86,7 @@ const StyledTitle4 = styled(TypoDS.Title4)<{ active: boolean }>(({ theme, active
const StyledSeparator = styled(Separator.Horizontal)({
marginVertical: getSpacing(2),
})

const ButtonInsideTextBlack = styled(ButtonInsideText).attrs(({ theme }) => ({
buttonColor: theme.colors.black,
}))``
Loading