Skip to content

Commit

Permalink
feat: make switcher demo feature
Browse files Browse the repository at this point in the history
  • Loading branch information
belopash committed May 9, 2024
1 parent b00ef31 commit 568e43b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@ jobs:
echo "::set-output name=wc_project_id::475eff0658d0f3300ca18971418d261b"
echo "::set-output name=testnet_squid_api_url::https://subsquid.squids.live/subsquid-network-testnet/v/v1/graphql"
echo "::set-output name=mainnet_squid_api_url::https://subsquid.squids.live/subsquid-network-mainnet/v/v1/graphql"
echo "::set-output name=enable_demo_features::false"
else
echo "::set-output name=app_env::dev"
echo "::set-output name=wc_project_id::ec2facac9eaaca7cc0584baadc935c01"
echo "::set-output name=testnet_squid_api_url::https://subsquid.squids.live/subsquid-network-testnet/v/v1/graphql"
echo "::set-output name=mainnet_squid_api_url::https://subsquid.squids.live/subsquid-network-mainnet/v/v1/graphql"
echo "::set-output name=enable_demo_features::true"
fi
env:
REF: ${{ github.ref }}
Expand Down
6 changes: 1 addition & 5 deletions src/hooks/demoFeaturesEnabled.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
import process from 'process';

export function demoFeaturesEnabled() {
return (
process.env.ENABLE_DEMO_FEATURES === 'true' || localStorage.getItem('demo-features') === 'true'
);
return process.env.ENABLE_DEMO_FEATURES === 'true';
}
3 changes: 2 additions & 1 deletion src/layouts/NetworkLayout/NetworkLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { Outlet } from 'react-router-dom';
import { Logo } from '@components/Logo';
import { NetworkSwitcher } from '@components/NetworkSwitcher';
import { TopBanner, useBannerHeight } from '@components/TopBanner';
import { demoFeaturesEnabled } from '@hooks/demoFeaturesEnabled';
import { MenuIcon } from '@icons/MenuIcon';
import { UserMenu } from '@layouts/NetworkLayout/UserMenu.tsx';
import { useSwitchNetwork } from '@network/useSwitchNetwork';
Expand Down Expand Up @@ -290,7 +291,7 @@ export const NetworkLayout = ({
) : null}
</AppToolbarSidebar>
<AppToolbarContent />
<NetworkSwitcher hideText={isMobile} />
{demoFeaturesEnabled() ? <NetworkSwitcher hideText={isMobile} /> : null}
{/*{narrowXs ? null : <AppToolbarDivider />}*/}
{narrowXs ? <AppToolbarContent /> : null}
<UserMenu />
Expand Down

0 comments on commit 568e43b

Please sign in to comment.