Skip to content

Commit d73d433

Browse files
committed
Chore: Prod Release
- adding feature flags - re-instate some features - update banner Merge branch 'staging' of github.com:GoodDollar/GoodProtocolUI into production
2 parents 484fe32 + 5d8dfe1 commit d73d433

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+829
-574
lines changed

env/shared

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ REACT_APP_GOOGLE_ANALYTICS_ID=GTM-PF4KD8W
33
REACT_APP_MIXPANEL_KEY=047b2cacd19cc0f3ef8502ab4002762f
44
REACT_APP_INDICATIVE_KEY=e02fc9cc-5252-4c33-bf12-2bc9205615e9
55
REACT_APP_FEEDCONTEXT_PROD=kjzl6cwe1jw149ao1fmo5ip9866yqmyt2wpf6zaeinam7w02s00pdeitldtmjxc
6+
REACT_APP_POSTHOG_KEY=phc_VfJkmAUgLw36oH4oYeDmJHsvRrURBYF5zaFUeSKgfgD

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,10 @@
207207
},
208208
"dependencies": {
209209
"@babel/runtime": "^7.18.9",
210-
"@gooddollar/good-design": "^0.1.32",
210+
"@gooddollar/good-design": "^0.1.34",
211211
"@gooddollar/goodprotocol": "^2.0.24",
212212
"@gooddollar/web3sdk": "^0.1.26",
213-
"@gooddollar/web3sdk-v2": "^0.2.12",
213+
"@gooddollar/web3sdk-v2": "^0.2.13",
214214
"@headlessui/react": "1.5.0",
215215
"@kimafinance/kima-transaction-widget": "^1.1.42-beta.1",
216216
"@lingui/format-json": "^4.0.0",
@@ -232,6 +232,7 @@
232232
"ethers": "^5.7.2",
233233
"mobile-device-detect": "^0.4.3",
234234
"native-base": "3.4.11",
235+
"posthog-js": "^1.96.1",
235236
"react-native": "0.70.4",
236237
"react-native-safe-area-context": "3.4.1",
237238
"react-native-web": "0.17.7",
16.3 KB
Loading

src/components/AppBar.tsx

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { g$Price } from '@gooddollar/web3sdk'
77
import { isMobile } from 'react-device-detect'
88
import classNames from 'classnames'
99
import { Text, useBreakpointValue, ITextProps, Pressable } from 'native-base'
10+
import { useFeatureFlagEnabled, usePostHog } from 'posthog-js/react'
1011

1112
import { useActiveWeb3React } from '../hooks/useActiveWeb3React'
1213
import 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 && (

src/components/AppNotice/index.tsx

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const AppNoticeLink = styled.a`
4040
export type AppNoticeProps = {
4141
text: any
4242
bg?: string
43-
link?: string[]
43+
link?: string
4444
show?: boolean
4545
onClick?: () => void
4646
}
@@ -50,28 +50,15 @@ function AppNotice(props: AppNoticeProps): JSX.Element {
5050
return (
5151
<>
5252
{props.show && (
53-
<AppNoticeBanner className="mobile" style={{ backgroundColor: 'red' }} onClick={props.onClick}>
53+
<AppNoticeBanner className="mobile" style={{ backgroundColor: props.bg }} onClick={props.onClick}>
5454
<div>
5555
{props.text}
5656
{props.link && (
57-
<AppNoticeLink href={props.link[0]} target="_blank" rel="noreferrer">
57+
<AppNoticeLink href={props.link} target="_blank" rel="noreferrer">
5858
{' '}
59-
Contracts
59+
Learn more.
6060
</AppNoticeLink>
6161
)}
62-
{/* . Learn more */}
63-
{props.link && (
64-
<AppNoticeLink
65-
href={props.link[1]}
66-
style={{ lineHeight: '2.2' }}
67-
target="_blank"
68-
rel="noreferrer"
69-
>
70-
{' '}
71-
here
72-
</AppNoticeLink>
73-
)}
74-
.
7562
</div>
7663
</AppNoticeBanner>
7764
)}

src/components/BlockNativeOnboard/index.tsx

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -63,19 +63,17 @@ export const OnboardConnectButton: FC = () => {
6363
return null
6464
}
6565

66-
return <></>
67-
68-
// return (
69-
// <Web3ActionButton
70-
// text={buttonText}
71-
// web3Action={noop}
72-
// supportedChains={[SupportedChains.CELO, SupportedChains.MAINNET, SupportedChains.FUSE]}
73-
// handleConnect={onWalletConnect}
74-
// variant={'outlined'}
75-
// isDisabled={connecting}
76-
// isLoading={connecting}
77-
// />
78-
// )
66+
return (
67+
<Web3ActionButton
68+
text={buttonText}
69+
web3Action={noop}
70+
supportedChains={[SupportedChains.CELO, SupportedChains.MAINNET, SupportedChains.FUSE]}
71+
handleConnect={onWalletConnect}
72+
variant={'outlined'}
73+
isDisabled={connecting}
74+
isLoading={connecting}
75+
/>
76+
)
7977
}
8078

8179
// wrapper so we can pass the selected chain

src/hooks/useSendAnalyticsData.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const mixpanelKey = import.meta.env.REACT_APP_MIXPANEL_KEY
1313
export const analyticsConfig: IAnalyticsConfig = {
1414
google: { enabled: true },
1515
indicative: { apiKey: indicativeKey, enabled: !!indicativeKey },
16-
posthog: { apiKey: posthogKey, enabled: !!posthogKey },
16+
posthog: { apiKey: posthogKey, enabled: false },
1717
mixpanel: { apiKey: mixpanelKey, enabled: !!mixpanelKey },
1818
}
1919

src/index.tsx

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { Provider } from 'react-redux'
99
import { HashRouter as Router } from 'react-router-dom'
1010
import { AnalyticsProvider } from '@gooddollar/web3sdk-v2'
1111
import { NewsFeedProvider } from '@gooddollar/web3sdk-v2'
12+
import { PostHogProvider } from 'posthog-js/react'
1213

1314
import Blocklist from './components/Blocklist'
1415
import App from './pages/App'
@@ -84,23 +85,31 @@ ReactDOM.render(
8485
<OnboardProviderWrapper>
8586
<Web3ContextProvider>
8687
<LanguageProvider>
87-
<AnalyticsProvider config={analyticsConfig} appProps={appInfo}>
88-
<Blocklist>
89-
<UserUpdater />
90-
<ApplicationUpdater />
91-
<MulticallUpdater />
92-
<ThemeProvider>
93-
<NativeBaseProvider theme={nbTheme}>
94-
<GlobalStyle />
95-
<Router>
96-
<SimpleAppProvider>
97-
<App />
98-
</SimpleAppProvider>
99-
</Router>
100-
</NativeBaseProvider>
101-
</ThemeProvider>
102-
</Blocklist>
103-
</AnalyticsProvider>
88+
<PostHogProvider
89+
apiKey={
90+
import.meta.env.REACT_APP_POSTHOG_KEY ??
91+
'phc_VfJkmAUgLw36oH4oYeDmJHsvRrURBYF5zaFUeSKgfgD'
92+
}
93+
options={{ api_host: 'https://app.posthog.com' }}
94+
>
95+
<AnalyticsProvider config={analyticsConfig} appProps={appInfo}>
96+
<Blocklist>
97+
<UserUpdater />
98+
<ApplicationUpdater />
99+
<MulticallUpdater />
100+
<ThemeProvider>
101+
<NativeBaseProvider theme={nbTheme}>
102+
<GlobalStyle />
103+
<Router>
104+
<SimpleAppProvider>
105+
<App />
106+
</SimpleAppProvider>
107+
</Router>
108+
</NativeBaseProvider>
109+
</ThemeProvider>
110+
</Blocklist>
111+
</AnalyticsProvider>
112+
</PostHogProvider>
104113
</LanguageProvider>
105114
</Web3ContextProvider>
106115
</OnboardProviderWrapper>

src/language/locales/af/catalog.po

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2321,8 +2321,8 @@ msgid "Close"
23212321
msgstr ""
23222322

23232323
#: src/pages/gd/Claim/index.tsx:267
2324-
msgid "Collect G$"
2325-
msgstr ""
2324+
#~ msgid "Collect G$"
2325+
#~ msgstr ""
23262326

23272327
#: src/pages/gd/Swap/SwapConfirmModal/index.tsx:160
23282328
msgid "Confirm swap"
@@ -2464,8 +2464,8 @@ msgid "GoodDollar"
24642464
msgstr ""
24652465

24662466
#: src/pages/gd/Claim/index.tsx:278
2467-
msgid "GoodDollar creates free money as a public good, G$ tokens, which you can collect daily."
2468-
msgstr ""
2467+
#~ msgid "GoodDollar creates free money as a public good, G$ tokens, which you can collect daily."
2468+
#~ msgstr ""
24692469

24702470
#: src/pages/gd/Stake/index.tsx:463
24712471
#: src/pages/gd/Stake/index.tsx:467

src/language/locales/ar/catalog.po

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2321,8 +2321,8 @@ msgid "Close"
23212321
msgstr "إغلاق"
23222322

23232323
#: src/pages/gd/Claim/index.tsx:267
2324-
msgid "Collect G$"
2325-
msgstr ""
2324+
#~ msgid "Collect G$"
2325+
#~ msgstr ""
23262326

23272327
#: src/pages/gd/Swap/SwapConfirmModal/index.tsx:160
23282328
msgid "Confirm swap"
@@ -2464,8 +2464,8 @@ msgid "GoodDollar"
24642464
msgstr ""
24652465

24662466
#: src/pages/gd/Claim/index.tsx:278
2467-
msgid "GoodDollar creates free money as a public good, G$ tokens, which you can collect daily."
2468-
msgstr ""
2467+
#~ msgid "GoodDollar creates free money as a public good, G$ tokens, which you can collect daily."
2468+
#~ msgstr ""
24692469

24702470
#: src/pages/gd/Stake/index.tsx:463
24712471
#: src/pages/gd/Stake/index.tsx:467

0 commit comments

Comments
 (0)