Skip to content

Commit

Permalink
chore: market notification [skip cypress] (#1828)
Browse files Browse the repository at this point in the history
* chore: market notification

* chore: market notification

* chore: warning update

* chore: update msg

* chore: fix msg

* chore: update msg
  • Loading branch information
foodaka authored Nov 4, 2023
1 parent 8848779 commit 3081b1c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
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

0 comments on commit 3081b1c

Please sign in to comment.