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

chore: market notification [skip cypress] #1828

Merged
merged 6 commits into from
Nov 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/layouts/MainLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
import { Box } from '@mui/material';
import React, { ReactNode } from 'react';
import AnalyticsConsent from 'src/components/Analytics/AnalyticsConsent';
import { useProtocolDataContext } from 'src/hooks/useProtocolDataContext';
import TopBarNotify from 'src/layouts/TopBarNotify';
import { FORK_ENABLED } from 'src/utils/marketsAndNetworksConfig';

import { AppFooter } from './AppFooter';
import { AppHeader } from './AppHeader';

export function MainLayout({ children }: { children: ReactNode }) {
const { currentMarket } = useProtocolDataContext();

return (
<>
{currentMarket === 'proto_mainnet' || currentMarket === 'proto_avalanche_v3' ? (
<TopBarNotify notifyText="An issue in a certain feature of the Aave Protocol was identified. Some markets or assets are temporarily paused. No funds are at risk." />
) : null}

<AppHeader />
<Box component="main" sx={{ display: 'flex', flexDirection: 'column', flex: 1 }}>
{children}
Expand Down
7 changes: 4 additions & 3 deletions src/layouts/TopBarNotify.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { useRootStore } from 'src/store/root';

interface TopBarNotifyProps {
notifyText: ReactNode;
learnMoreLink: string;
learnMoreLink?: string;
}

export default function TopBarNotify({ notifyText, learnMoreLink }: TopBarNotifyProps) {
Expand Down Expand Up @@ -65,7 +65,8 @@ export default function TopBarNotify({ notifyText, learnMoreLink }: TopBarNotify
<Box sx={{ padding: md ? '20px 10px' : '', paddingRight: 0 }}>
<Typography component="div">
<Trans>{notifyText}</Trans>
{md ? (

{learnMoreLink && md ? (
<Link
sx={{ color: 'white', textDecoration: 'underline', paddingLeft: 2 }}
target={'_blank'}
Expand All @@ -77,7 +78,7 @@ export default function TopBarNotify({ notifyText, learnMoreLink }: TopBarNotify
</Typography>
</Box>
<Box>
{!md ? (
{!md && learnMoreLink ? (
<Button
component="a"
target={'_blank'}
Expand Down
Loading