@@ -7,6 +7,7 @@ import { g$Price } from '@gooddollar/web3sdk'
77import { isMobile } from 'react-device-detect'
88import classNames from 'classnames'
99import { Text , useBreakpointValue , ITextProps , Pressable } from 'native-base'
10+ import { useFeatureFlagEnabled , usePostHog } from 'posthog-js/react'
1011
1112import { useActiveWeb3React } from '../hooks/useActiveWeb3React'
1213import Web3Network from './Web3Network'
@@ -31,7 +32,6 @@ const AppBarWrapper = styled.header`
3132 .site-logo {
3233 height: 29px;
3334 }
34- height: 150px;
3535
3636 .mobile-menu-button {
3737 display: none;
@@ -208,6 +208,10 @@ function AppBar(): JSX.Element {
208208 const { chainId } = useActiveWeb3React ( )
209209 const [ sidebarOpen , setSidebarOpen ] = useState ( false )
210210 const isSimpleApp = useIsSimpleApp ( )
211+ const showPrice = useFeatureFlagEnabled ( 'show-gd-price' )
212+ const posthog = usePostHog ( )
213+ const payload = posthog ?. getFeatureFlagPayload ( 'app-notice' )
214+ const { enabled : appNoticeEnabled , message, color, link } = ( payload as any ) || { }
211215
212216 const [ G$Price ] = usePromise ( async ( ) => {
213217 try {
@@ -245,13 +249,10 @@ function AppBar(): JSX.Element {
245249 return (
246250 < AppBarWrapper
247251 className = "relative z-10 flex flex-row justify-between w-screen flex-nowrap background"
248- style = { { flexDirection : 'column' } }
252+ style = { { flexDirection : 'column' , height : appNoticeEnabled ? '150px' : '87px' } }
249253 >
250254 < >
251- < AppNotice
252- text = { i18n . _ ( t `There has been a security breach. The app will be disabled until further notice` ) }
253- show = { true }
254- />
255+ { appNoticeEnabled && < AppNotice text = { message } bg = { color } link = { link } show = { true } /> }
255256 < div className = "lg:px-8 lg:pt-4 lg:pb-2" >
256257 < TopBar $mobile = { isMobile } className = "flex items-center justify-between" >
257258 < div className = "flex flex-col" >
@@ -262,7 +263,9 @@ function AppBar(): JSX.Element {
262263 < LogoPrimary className = "w-auto site-logo lg:block" />
263264 ) }
264265 </ LogoWrapper >
265- < G$Balance price = { G$Price } display = { showBalance } color = { fontColor } pl = "0" p = "2" />
266+ { showPrice && (
267+ < G$Balance price = { G$Price } display = { showBalance } color = { fontColor } pl = "0" p = "2" />
268+ ) }
266269 </ div >
267270
268271 < div className = "flex flex-row items-end h-10 space-x-2" >
@@ -284,14 +287,14 @@ function AppBar(): JSX.Element {
284287
285288 { ! isMinipay && (
286289 < div className = { mainMenuContainer } >
287- { /* { !isSimpleApp ? <Web3Bar /> : isMobile ? <NavBar /> : null} */ }
290+ { ! isSimpleApp ? < Web3Bar /> : isMobile ? < NavBar /> : null }
288291 { /* // : isMobile ? <NavBar /> : null } <-- enable for opera when swap is ready */ }
289292 </ div >
290293 ) }
291294 </ div >
292295 </ TopBar >
293296 < div className = "px-4 pb-2 lg:hidden" >
294- < G$Balance price = { G$Price } color = { fontColor } padding = "0" />
297+ { showPrice && < G$Balance price = { G$Price } color = { fontColor } padding = "0" /> }
295298 </ div >
296299 </ div >
297300 { isMobile && (
0 commit comments