Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testnet > Staging #205

Merged
merged 9 commits into from
Dec 14, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import { signOut } from 'next-auth/react';
import { useRouter } from 'next-nprogress-bar';

import { featureToggle } from '@/environment/environment';
import { auth } from '@/locale/en/auth';

import { LogoutOutlined } from '@mui/icons-material';
Expand Down Expand Up @@ -32,11 +31,9 @@ export default function AuthDropdown({ onClose }: Props) {
return (
<>
<AuthDropdownCurrent onClose={onClose} />
{featureToggle?.wallet && (
<Box sx={{ display: { xs: 'block', lg: 'none' }, px: 2, pt: 1 }}>
<WalletWidget id="wallet-button" />
</Box>
)}
<Box sx={{ display: { xs: 'block', lg: 'none' }, px: 2, pt: 1 }}>
<WalletWidget id="wallet-button" />
</Box>
<Divider sx={{ my: 1 }} />
<AuthDropdownProfilesList onClose={onClose} />
<MenuItem onClick={onSignOut}>
Expand Down
5 changes: 4 additions & 1 deletion src/app/(light)/dashboard/components/dashboard-layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use client';

import { usePathname } from 'next/navigation';
import { PropsWithChildren, ReactNode } from 'react';

import { sandboxAlert } from '@/locale/en/alert-messages';
Expand All @@ -26,6 +27,8 @@ export default function DashboardLayout({
mobileMenuItems,
}: PropsWithChildren<Props>) {
const testnet = currentEnv() === 'testnet';
const pathname = usePathname();
const isNotWalletPage = !pathname.includes('wallet');

return (
<Stack
Expand Down Expand Up @@ -67,7 +70,7 @@ export default function DashboardLayout({
overflow: 'hidden',
}}
>
{testnet && <SandboxAlert />}
{testnet && isNotWalletPage && <SandboxAlert />}
{children}
</DashboardPage>
{mobileMenuItems}
Expand Down
9 changes: 3 additions & 6 deletions src/app/(light)/dashboard/components/sidebar/sidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use client';
import { PropsWithChildren, ReactNode } from 'react';

import { featureToggle } from '@/environment/environment';
import { CONTAINER_PX } from '@/theme/config/style-tokens';

import { Box } from '@mui/material';
Expand Down Expand Up @@ -58,11 +57,9 @@ export default function Sidebar({
menuItems={menuItems}
secondMenuItems={secondMenuItems}
/>
{featureToggle?.wallet && (
<Box sx={{ display: { xs: 'none', lg: 'block' } }}>
<WalletWidget id="wallet-button" />
</Box>
)}
<Box sx={{ display: { xs: 'none', lg: 'block' } }}>
<WalletWidget id="wallet-button" />
</Box>

<AuthComponent id="profile-button" controlId="profile-menu" />
</Stack>
Expand Down
2 changes: 1 addition & 1 deletion src/locale/en/alert-messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ export const sandboxAlert = {
};

export const sandboxWalletAlert = {
title: 'Be aware the money on Sandbox is fake and worthless',
title: `Just a heads-up, the money on Sandbox is not real and doesn't hold any value.`,
};