Skip to content
Open
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
2 changes: 1 addition & 1 deletion dev-mode-link-local-sdk.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import path from 'path';
import readline from 'readline';

// import package json
import packageJSON from './package.json' assert { type: 'json' };
import packageJSON from './package.json' with { type: 'json' };
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't assert is the proper way to import JSON modules..?


const packageJSONWatcher = {
STORAGE_KEY: 'STORAGE_FOR_RESTORING_PACKAGE_JSON',
Expand Down
8 changes: 4 additions & 4 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ import SpaceContextProvider from 'contexts/SpaceContext';
import { SpaceWidgetSection } from 'sections/space/SpaceWidgetSection';
import { blocksColors, getBlocksCSSVariables, Notification } from 'blocks';
import APP_PATHS from 'config/AppPaths';
import { useInAppNotifications, useRewardsNotification } from 'common';
import { useChainTestnetNotification, useInAppNotifications } from 'common';

dotenv.config();

Expand Down Expand Up @@ -112,13 +112,13 @@ const GlobalStyle = createGlobalStyle`
--r9: 36px;
--r10: 40px;
// TODO: Add more as needed

/* deprecated */
/* Colors */
${Object.entries(blocksColors)
.map(([colorName, code]) => `--${colorName}: ${code};`)
.join('')}

/* Font Family */
--font-family: 'FK Grotesk Neu';

Expand Down Expand Up @@ -194,7 +194,7 @@ export default function App() {

const { isActive, account, provider } = useAccount();
// TODO: comment until rewards v2 launch is accounced
useRewardsNotification();
useChainTestnetNotification();
const [currentTime, setcurrentTime] = useState(0);

const { pgpPvtKey } = useContext<any>(AppContext);
Expand Down
35 changes: 35 additions & 0 deletions src/blocks/illustrations/components/ChainTestnet.tsx

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/blocks/illustrations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ export { default as ChatIllustration } from './components/Chat';

export { default as ChatDark } from './components/ChatDark';

export { default as ChainTestnet } from './components/ChainTestnet';

export { default as CheckCircle } from './components/CheckCircle';

export { default as Communication } from './components/Communication';
Expand Down
5 changes: 3 additions & 2 deletions src/blocks/notification/Notification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const TextContainer = styled.div`

const NotificationTitle = styled.span`
${() => getTextVariantStyles('h5-semibold', 'components-in-app-notification-text-default')}
width: 95%;
`;

const NotificationDescription = styled.span`
Expand All @@ -57,9 +58,9 @@ const NotificationDescription = styled.span`
const IconContainer = styled.div`
display: flex;
align-items: center;
padding: var(--spacing-sm) var(--spacing-md);
padding: var(--spacing-sm) var(--spacing-xs);
border-radius: var(--radius-xxs) var(--radius-none) var(--radius-none) var(--radius-xxs);
background: radial-gradient(79.55% 79.55% at 50% 50%, #7e3bb9 0%, #171717 100%);
background: #1B43C8;
`;

const CloseButton = styled.div`
Expand Down
2 changes: 1 addition & 1 deletion src/common/Common.localStorageKeys.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const CommonLocalStorageKeys = {
notificationShown: 'notificationShown',
testnetNotificationShown: 'testnetNotificationShown',
resetStakeEndDate: 'resetStakeEndDate',
};

Expand Down
2 changes: 1 addition & 1 deletion src/common/hooks/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export { useIsVisible } from './useIsVisible';
export { usePushStakingStats } from './usePushStakingStats';
export { useRewardsNotification } from './useRewardsNotification';
export { useChainTestnetNotification } from './useChainTestnetNotification';
export { useDisclosure } from './useDisclosure';
export { useInAppNotifications } from './useInAppNotifications';
42 changes: 42 additions & 0 deletions src/common/hooks/useChainTestnetNotification.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// react
import { useEffect, useState } from 'react';

// components
import { ChainTestnet, notification } from 'blocks';
import { CommonLocalStorageKeys } from 'common';

export const useChainTestnetNotification = () => {
const [hasMounted, setHasMounted] = useState(false);

const notificationAlreadyShown = localStorage.getItem('testnetNotificationShown') === 'true';

const showNotification = () =>
notification.show({
title: 'Donut Testnet Closed beta is Live!',
description: 'Get a sneak peek into Testnet, Donut, build universal apps and win prizes!',
image: <ChainTestnet />,
position: 'bottom-left',
onClick: () => {
window.open('https://t.me/+dHOCilvxNR9jZjM9', '_blank');
localStorage.setItem(CommonLocalStorageKeys.testnetNotificationShown, 'true');
notification.hide();
},
onClose: () => {
localStorage.setItem(CommonLocalStorageKeys.testnetNotificationShown, 'true');
},
});

const showNotificationFn = () => {
if (!notificationAlreadyShown && !hasMounted) {
showNotification();
setHasMounted(true);
} else {
notification.hide();
setHasMounted(false);
}
};

useEffect(() => {
showNotificationFn();
}, []);
};
48 changes: 0 additions & 48 deletions src/common/hooks/useRewardsNotification.tsx

This file was deleted.

Loading