Skip to content

Commit

Permalink
feature flag AGS
Browse files Browse the repository at this point in the history
  • Loading branch information
BrettCleary committed Oct 23, 2023
1 parent 8d4ab63 commit f6e4a9b
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 17 deletions.
5 changes: 4 additions & 1 deletion src/frontend/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import DownloadToastManager from './components/UI/DownloadToastManager'
import TopNavBar from './components/UI/TopNavBar'
import StoreNavHandler from './StoreNavHandler'
import QaAuthHandler from './QaAuthHandler'
import { ENABLE_AMAZON_STORE } from './constants'

function App() {
const { sidebarCollapsed, isSettingsModalOpen } = useContext(ContextProvider)
Expand Down Expand Up @@ -65,7 +66,9 @@ function App() {
/>
<Route path="epicstore" element={<WebView key="epicstore" />} />
<Route path="gogstore" element={<WebView key="gogstore" />} />
<Route path="amazonstore" element={<WebView />} />
{ENABLE_AMAZON_STORE ? (
<Route path="amazonstore" element={<WebView />} />
) : null}
<Route path="wiki" element={<WebView key="wiki" />} />
<Route path="metamaskHome" element={<MetaMaskHome />} />
<Route
Expand Down
23 changes: 13 additions & 10 deletions src/frontend/components/UI/TopNavBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import {
EPIC_STORE_URL,
GOG_STORE_URL,
AMAZON_STORE,
HYPERPLAY_STORE_URL
HYPERPLAY_STORE_URL,
ENABLE_AMAZON_STORE
} from 'frontend/constants'
import webviewNavigationStore from 'frontend/store/WebviewNavigationStore'
import { extractMainDomain } from '../../../helpers/extract-main-domain'
Expand Down Expand Up @@ -103,15 +104,17 @@ const TopNavBar = observer(() => {
{t('GOG', 'GOG')}
</Button>
</NavLink>
<NavLink to="/amazonstore">
<Button
type="link"
size="small"
style={getStoreTextStyle(AMAZON_STORE)}
>
{t('Amazon', 'Amazon')}
</Button>
</NavLink>
{ENABLE_AMAZON_STORE ? (
<NavLink to="/amazonstore">
<Button
type="link"
size="small"
style={getStoreTextStyle(AMAZON_STORE)}
>
{t('Amazon', 'Amazon')}
</Button>
</NavLink>
) : null}
</>
)}
</div>
Expand Down
1 change: 1 addition & 0 deletions src/frontend/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ export const WIKI_URL = 'https://docs.hyperplay.xyz/'
export const GOG_LOGIN_URL =
'https://auth.gog.com/auth?client_id=46899977096215655&redirect_uri=https%3A%2F%2Fembed.gog.com%2Fon_login_success%3Forigin%3Dclient&response_type=code&layout=galaxy'
export const AMAZON_STORE = `https://gaming.amazon.com`
export const ENABLE_AMAZON_STORE = false
13 changes: 7 additions & 6 deletions src/frontend/screens/Library/components/LibraryTopBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { Category } from 'frontend/types'
import { observer } from 'mobx-react-lite'
import libraryState from '../../../../state/libraryState'
import storeAuthState from 'frontend/state/storeAuthState'
import { ENABLE_AMAZON_STORE } from 'frontend/constants'

export interface LibraryTopBarInterface {
filters: DropdownItemType[]
Expand Down Expand Up @@ -54,21 +55,21 @@ export const LibraryTopBar = observer(
<Tabs.Tab value="hyperplay">
<div className="menu">{t('HyperPlay')}</div>
</Tabs.Tab>
{isEpicLoggedin && (
{isEpicLoggedin ? (
<Tabs.Tab value="legendary">
<div className="menu">EPIC</div>
</Tabs.Tab>
)}
{isGOGLoggedin && (
) : null}
{isGOGLoggedin ? (
<Tabs.Tab value="gog">
<div className="menu">GOG</div>
</Tabs.Tab>
)}
{isAmazonLoggedin && (
) : null}
{isAmazonLoggedin && ENABLE_AMAZON_STORE ? (
<Tabs.Tab value="nile">
<div className="menu">Amazon</div>
</Tabs.Tab>
)}
) : null}
<Tabs.Tab value="sideload">
<div className="menu">{t('Other')}</div>
</Tabs.Tab>
Expand Down

0 comments on commit f6e4a9b

Please sign in to comment.