-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Replace ForceUpdateBanner by RemoteBanner, get data from Firestore (+cheatcodes) * Rename FF showForceUpdateBanner to showRemoteBanner * Removed fallback values * Added subtitle web variant * Added error display to cheatcodes if input is wrong * Allowed setFF to take options for each FF * Added sentry when validation error * Added analytics * Story for RemoteBanner * Extracted Dumb remotebanner for storybook * Removed snapshots from RemoteBanner * Added a test for analytics and for sentry * Update dead code * Renamed all showForceUpdateBanner * Comment + sonar code smells * Revert "Extracted Dumb remotebanner for storybook" This reverts commit 2c19f42. * Revert "Update dead code" This reverts commit a4aec9b. * Renamed HasClickedBanner to HasClickedRemoteBanner as asked in ticket * Revert "Renamed HasClickedBanner to HasClickedRemoteBanner as asked in ticket" This reverts commit 85592e0. * Removed story
- Loading branch information
1 parent
c962603
commit 7b43ba0
Showing
39 changed files
with
833 additions
and
172 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
36 changes: 36 additions & 0 deletions
36
src/cheatcodes/pages/features/remoteBanner/CheatcodesScreenRemoteBanner.tsx
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import React, { useEffect, useState } from 'react' | ||
|
||
import { CheatcodesTemplateScreen } from 'cheatcodes/components/CheatcodesTemplateScreen' | ||
import { RemoteBanner } from 'features/remoteBanner/components/RemoteBanner' | ||
import { remoteBannerSchema } from 'features/remoteBanner/components/remoteBannerSchema' | ||
import { useFeatureFlagOptions } from 'libs/firebase/firestore/featureFlags/useFeatureFlagOptions' | ||
import { RemoteStoreFeatureFlags } from 'libs/firebase/firestore/types' | ||
import { ErrorBanner } from 'ui/components/banners/ErrorBanner' | ||
import { ViewGap } from 'ui/components/ViewGap/ViewGap' | ||
import { getSpacing } from 'ui/theme' | ||
|
||
export const CheatcodesScreenRemoteBanner = () => { | ||
const { options } = useFeatureFlagOptions(RemoteStoreFeatureFlags.SHOW_REMOTE_BANNER) | ||
const [error, setError] = useState('') | ||
|
||
useEffect(() => { | ||
try { | ||
remoteBannerSchema.validateSync(options) | ||
} catch (error) { | ||
setError(String(error)) | ||
} | ||
}, [options]) | ||
|
||
return ( | ||
<CheatcodesTemplateScreen title="RemoteBanner 🆒" flexDirection="column"> | ||
<ViewGap gap={getSpacing(3)}> | ||
<RemoteBanner from="Cheatcodes" /> | ||
{error ? ( | ||
<ErrorBanner | ||
message={`La bannière ne s‘affichera pas à cause de l’erreur suivante:\n${error}`} | ||
/> | ||
) : null} | ||
</ViewGap> | ||
</CheatcodesTemplateScreen> | ||
) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.