diff --git a/lib/theme/icons.js b/lib/theme/icons.js index 95b4faea3..849e23dd7 100644 --- a/lib/theme/icons.js +++ b/lib/theme/icons.js @@ -9,6 +9,241 @@ SPDX-License-Identifier: AGPL-3.0-or-later import { icons as daiUiIcons } from '@makerdao/dai-ui-icons'; import { icons as brandIcons } from '@makerdao/dai-ui-icons-branding'; +const skyIcon = ({ darkMode = false } = {}) => ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +); + export const icons = { chevron_right: daiUiIcons.chevron_right, chevron_left: daiUiIcons.chevron_left, @@ -36,6 +271,14 @@ export const icons = { ), viewBox: '0 0 20 20' }, + sky: { + path: skyIcon(), + viewBox: '0 0 160 56' + }, + sky_white: { + path: skyIcon({ darkMode: true }), + viewBox: '0 0 160 56' + }, maker: { path: ( diff --git a/modules/app/components/layout/Header.tsx b/modules/app/components/layout/Header.tsx index 851dbfd39..160015b79 100644 --- a/modules/app/components/layout/Header.tsx +++ b/modules/app/components/layout/Header.tsx @@ -134,6 +134,7 @@ const Header = (): JSX.Element => { const { network } = useWeb3(); const { data: gas } = useGasPrice({ network }); const [mode, setMode] = useColorMode(); + const [renderedMode, setRenderedMode] = useState('light'); const onToggleTheme = () => { const next = mode === 'dark' ? 'light' : 'dark'; @@ -142,6 +143,10 @@ const Header = (): JSX.Element => { setMode(next); }; + useEffect(() => { + setRenderedMode(mode); + }, [mode]); + return ( { > - - + + @@ -309,8 +318,12 @@ const MobileMenu = ({ hide, router, gas, onToggleTheme, mode, network }) => { }} > - - + + diff --git a/modules/app/components/layout/header/Banner.tsx b/modules/app/components/layout/header/Banner.tsx index 1049563b4..e38854f55 100644 --- a/modules/app/components/layout/header/Banner.tsx +++ b/modules/app/components/layout/header/Banner.tsx @@ -8,6 +8,9 @@ SPDX-License-Identifier: AGPL-3.0-or-later import { Text, Alert } from 'theme-ui'; import { keyframes } from '@emotion/react'; +import { ExternalLink } from '../../ExternalLink'; +import React from 'react'; +import { Icon } from '@makerdao/dai-ui-icons'; const scroll = keyframes({ from: { transform: 'translate(60vw, 0)' }, @@ -16,11 +19,26 @@ const scroll = keyframes({ const Banner = ({ content, - variant = 'banner' + variant = 'banner', + href }: { content: string | React.ReactElement; variant?: string; + href?: string; }): React.ReactElement => { + const arrow = href ? : null; + const textComponent = ( + + {content} {arrow} + + ); + return ( {typeof content === 'string' ? ( - - {content} - + href ? ( + + {textComponent} + + ) : ( +
{textComponent}
+ ) ) : ( content )} diff --git a/modules/delegates/api/fetchDelegateAddresses.ts b/modules/delegates/api/fetchDelegateAddresses.ts index baa03a0d1..33623063e 100644 --- a/modules/delegates/api/fetchDelegateAddresses.ts +++ b/modules/delegates/api/fetchDelegateAddresses.ts @@ -24,7 +24,9 @@ export async function fetchDelegateAddresses(network: SupportedNetworks): Promis ...delegate, blockTimestamp: new Date(delegate?.blockTimestamp), delegate: delegate?.delegate, - voteDelegate: delegate?.voteDelegate + voteDelegate: delegate?.voteDelegate, + // @ts-ignore: Property 'delegateVersion' might not exist on type 'AllDelegatesRecord' + version: delegate?.delegateVersion })) as AllDelegatesEntry[]; cacheSet(allDelegateAddressesKey, JSON.stringify(delegates), network, ONE_HOUR_IN_MS); diff --git a/modules/delegates/api/fetchDelegatedTo.ts b/modules/delegates/api/fetchDelegatedTo.ts index b189fd829..229c2d45e 100644 --- a/modules/delegates/api/fetchDelegatedTo.ts +++ b/modules/delegates/api/fetchDelegatedTo.ts @@ -60,7 +60,7 @@ export async function fetchDelegatedTo( } else { const delegatingTo = delegates.find( i => i?.voteDelegate?.toLowerCase() === delegateContractAddress.toLowerCase() - ) as (AllDelegatesRecord & { version: string }) | undefined; + ) as (AllDelegatesRecord & { version: number }) | undefined; if (!delegatingTo) { return acc; @@ -70,13 +70,13 @@ export async function fetchDelegatedTo( // Get the expiration date of the delegate const expirationDate = - delegatingTo.version === '2' + delegatingTo.version === 2 ? undefined : add(new Date(delegatingTo?.blockTimestamp), { years: 1 }); //only v1 delegate contracts expire - const isAboutToExpire = delegatingTo.version !== '2' && isAboutToExpireCheck(expirationDate); - const isExpired = delegatingTo.version !== '2' && isExpiredCheck(expirationDate); + const isAboutToExpire = delegatingTo.version !== 2 && isAboutToExpireCheck(expirationDate); + const isExpired = delegatingTo.version !== 2 && isExpiredCheck(expirationDate); // If it has a new owner address, check if it has renewed the contract const newOwnerAddress = getNewOwnerFromPrevious(delegatingToWalletAddress as string, network); diff --git a/modules/delegates/api/fetchDelegates.ts b/modules/delegates/api/fetchDelegates.ts index 3c22badea..3ce8385ba 100644 --- a/modules/delegates/api/fetchDelegates.ts +++ b/modules/delegates/api/fetchDelegates.ts @@ -58,9 +58,9 @@ function mergeDelegateInfo({ }): Delegate { // check if contract is expired to assing the status const expirationDate = - onChainDelegate.version === '2' ? undefined : add(new Date(onChainDelegate.blockTimestamp), { years: 1 }); - const isExpired = onChainDelegate.version === '2' ? false : isBefore(new Date(expirationDate!), new Date()); - const isAboutToExpire = onChainDelegate.version === '2' ? false : isAboutToExpireCheck(expirationDate); + onChainDelegate.version === 2 ? undefined : add(new Date(onChainDelegate.blockTimestamp), { years: 1 }); + const isExpired = onChainDelegate.version === 2 ? false : isBefore(new Date(expirationDate!), new Date()); + const isAboutToExpire = onChainDelegate.version === 2 ? false : isAboutToExpireCheck(expirationDate); return { voteDelegateAddress: onChainDelegate.voteDelegateAddress, @@ -101,7 +101,7 @@ function mergeDelegateInfo({ voteDelegateAddress: newOnChainDelegate.voteDelegateAddress } }), - version: onChainDelegate.version || '1' + version: onChainDelegate.version || 1 }; } @@ -336,10 +336,10 @@ export async function fetchAndMergeDelegates( ); const expirationDate = - delegate.version === '2' ? undefined : add(new Date(delegate.blockTimestamp), { years: 1 }); + delegate.version === 2 ? undefined : add(new Date(delegate.blockTimestamp), { years: 1 }); const expired = - delegate.version === '2' ? false : expirationDate && expirationDate > new Date() ? false : true; - const isAboutToExpire = delegate.version === '2' ? false : isAboutToExpireCheck(expirationDate); + delegate.version === 2 ? false : expirationDate && expirationDate > new Date() ? false : true; + const isAboutToExpire = delegate.version === 2 ? false : isAboutToExpireCheck(expirationDate); return { ...delegate, delegateType: ghDelegate ? DelegateTypeEnum.ALIGNED : DelegateTypeEnum.SHADOW, @@ -553,10 +553,10 @@ export async function fetchDelegatesPaginated({ ? DelegateStatusEnum.aligned : DelegateStatusEnum.shadow, creationDate: new Date(delegate.creationDate), - expirationDate: delegate.version === '2' ? undefined : new Date(delegate.expirationDate), + expirationDate: delegate.delegateVersion === 2 ? undefined : new Date(delegate.expirationDate), expired: delegate.expired, isAboutToExpire: - delegate.version === '2' ? false : isAboutToExpireCheck(new Date(delegate.expirationDate)), + delegate.delegateVersion === 2 ? false : isAboutToExpireCheck(new Date(delegate.expirationDate)), picture: githubDelegate?.picture, communication: githubDelegate?.communication, combinedParticipation: githubDelegate?.combinedParticipation, @@ -570,7 +570,7 @@ export async function fetchDelegatesPaginated({ execSupported: execSupported && { title: execSupported.title, address: execSupported.address }, previous: allDelegatesEntry?.previous, next: allDelegatesEntry?.next, - version: delegate.version + version: delegate.delegateVersion }; }) as DelegatePaginated[] }; diff --git a/modules/delegates/types/delegate.d.ts b/modules/delegates/types/delegate.d.ts index ff0f3330f..e26014a3b 100644 --- a/modules/delegates/types/delegate.d.ts +++ b/modules/delegates/types/delegate.d.ts @@ -29,7 +29,7 @@ export type DelegateContractInformation = { mkrDelegated: string; proposalsSupported: number; mkrLockedDelegate: MKRLockedDelegateAPIResponse[]; - version?: string | null; + version?: number | null; lastVoteDate: number | null; }; @@ -56,7 +56,7 @@ export type Delegate = { execSupported: CMSProposal | undefined; mkrLockedDelegate: MKRLockedDelegateAPIResponse[]; blockTimestamp: string; - version?: string | null; + version?: number | null; previous?: { address: string; voteDelegateAddress: string; @@ -133,7 +133,7 @@ export type AllDelegatesEntry = { blockTimestamp: Date; delegate: string; voteDelegate: string; - version?: string | null; + version?: number | null; }; export type AllDelegatesEntryWithName = AllDelegatesEntry & { @@ -169,5 +169,5 @@ export type DelegateInfo = Omit { ))}
- +
); }; @@ -59,105 +59,50 @@ export default function Footer({ locale = 'en' }: { locale?: string }): React.Re const links = [ { - header: t('Governance'), + header: t('Participate'), list: [ { url: 'https://forum.makerdao.com/', - title: t('Forum') - }, - { - url: 'https://manual.makerdao.com/', - title: t('Operational Manual') - }, - { - url: 'https://manual.makerdao.com/', - title: t('Governance FAQs') - }, - { - url: 'https://docs.google.com/spreadsheets/d/1LWNlv6hr8oXebk8rvXZBPRVDjN-3OrzI0IgLwBVk0vM/edit#gid=0', - title: t('Gov Tracking Sheet') - }, - { - url: 'https://manual.makerdao.com/governance/governance-cycle/monthly-governance-cycle', - title: t('Monthly Gov Cycle') - }, - { - url: 'https://manual.makerdao.com/governance/governance-cycle/weekly-governance-cycle', - title: t('Weekly Gov Cycle') + title: t('Community') } ] }, { - header: t('Products & Tools'), + header: t('Ecosystem'), list: [ { - url: 'https://makerdao.statuspage.io/', - title: t('Service Status') + url: 'https://sky.money/', + title: t('sky.money') }, - { - url: 'https://auctions.makerdao.network/', - title: t('Auctions Dashboard') + url: 'https://web3-growth.notion.site/Sky-Brand-Kit-ec871fa39f9d41bf9cc4446e7d1f6997?p=ebe95d12947642b6bf69cbac9d09c972&pm=c', + title: t('Brand Guidelines') }, { - url: 'https://migrate.makerdao.com/', - title: t('Migrate Dashboard') + url: 'https://www.notion.so/Sky-Brand-Kit-ec871fa39f9d41bf9cc4446e7d1f6997?pvs=4', + title: t('Media Assets') }, { - url: 'https://makerburn.com/', - title: t('MakerBurn') - }, - { - url: 'https://daistats.com/', - title: t('DAI Stats') - }, - { - url: 'https://vote.makerdao.com/terms', - title: t('Terms') + url: 'https://sky.money/faq', + title: t('FAQs') } ] }, { - header: t('Developer'), + header: t('Build'), list: [ { - url: 'https://makerdao.com/whitepaper', - title: t('Whitepaper') - }, - { - url: 'https://docs.makerdao.com/', - title: t('Technical Docs') - }, - { - url: 'https://vote.makerdao.com/api-docs', - title: t('API Docs') - }, - { - url: 'https://github.com/makerdao/developerguides', - title: t('Developer Guides') - }, - { - url: 'https://www.notion.so/makerdao/Maker-Brand-ac517c82ff9a43089d0db5bb2ee045a4', - title: t('Brand Assets') + url: 'https://developers.sky.money/', + title: t('Developer Documentation') } ] } ]; const logos = { - makerdao: [ - { title: 'Discord', url: 'https://chat.makerdao.com', icon: 'discord' }, - { title: 'Twitter', url: 'https://twitter.com/MakerDAO', icon: 'twitter' }, - { title: 'Reddit', url: 'https://www.reddit.com/r/MakerDAO/', icon: 'reddit' }, - { title: 'YouTube', url: 'https://www.youtube.com/MakerDAO', icon: 'youtube' }, - { title: 'GitHub', url: 'https://www.github.com/makerdao', icon: 'github' } - ], - makerdux: [ - { title: 'Discord', url: 'https://discord.gg/GHcFMdKden', icon: 'discord' }, - { title: 'Twitter', url: 'https://twitter.com/MakerDUX', icon: 'twitter' }, - { title: 'GitHub', url: 'https://github.com/makerdao/governance-portal-v2', icon: 'github' }, - { title: 'Canny', url: 'https://makergovernance.canny.io/', icon: 'canny' }, - { title: 'Immunefi', url: 'https://immunefi.com/bounty/makerdao/', icon: 'immunefi' } + sky: [ + { title: 'Discord', url: 'https://discord.gg/skyecosystem', icon: 'discord' }, + { title: 'Twitter', url: 'https://x.com/SkyEcosystem', icon: 'twitter' } ] }; @@ -197,7 +142,11 @@ export default function Footer({ locale = 'en' }: { locale?: string }): React.Re pb: 5 }} > - + -
); diff --git a/modules/home/data/bannerContent.json b/modules/home/data/bannerContent.json index 813e4ae5e..d91bf07ab 100644 --- a/modules/home/data/bannerContent.json +++ b/modules/home/data/bannerContent.json @@ -2,5 +2,11 @@ { "active": false, "content": "Warning: The hat is going to expire soon, please vote on the latest executive" + }, + { + "active": true, + "content": "MakerDAO is now Sky — the next evolution of DeFi. Explore Sky.money and get rewarded for saving without giving up control.", + "href": "https://sky.money", + "variant": "alerts.primary" } ] diff --git a/modules/migration/components/DelegateContractInfo.tsx b/modules/migration/components/DelegateContractInfo.tsx index e2798bb2a..a716dbc7e 100644 --- a/modules/migration/components/DelegateContractInfo.tsx +++ b/modules/migration/components/DelegateContractInfo.tsx @@ -26,7 +26,7 @@ export default function DelegateContractInfo({ const [modalOpen, setModalOpen] = useState(false); const openModal = () => { - if (delegate.version === '2' || (!delegate.isAboutToExpire && !delegate.expired)) { + if (delegate.version === 2 || (!delegate.isAboutToExpire && !delegate.expired)) { return; } setModalOpen(true); @@ -43,7 +43,7 @@ export default function DelegateContractInfo({ }} onClick={openModal} > - {delegate.version !== '2' && ( + {delegate.version !== 2 && ( V1 | @@ -51,7 +51,7 @@ export default function DelegateContractInfo({ - {delegate.version === '2' + {delegate.version === 2 ? 'NO EXPIRATION' : delegate.expired ? 'EXPIRED' @@ -59,7 +59,7 @@ export default function DelegateContractInfo({ ? 'EXPIRING' : 'EXPIRES'} {' '} - {delegate.version !== '2' && } + {delegate.version !== 2 && } { const banners = useMemo(() => { return ( - {activeBannerContent && } + {activeBannerContent && ( + + )} ); diff --git a/pages/migration/delegator.tsx b/pages/migration/delegator.tsx index 59086aecc..c2d0448c4 100644 --- a/pages/migration/delegator.tsx +++ b/pages/migration/delegator.tsx @@ -74,7 +74,7 @@ export default function DelegateMigrationPage(): React.ReactElement { i => i.address.toLowerCase() === delegate.previous?.address.toLowerCase() ); return ( - delegate.version === '2' || (!delegate.expired && !delegate.isAboutToExpire && isPreviousDelegate) + delegate.version === 2 || (!delegate.expired && !delegate.isAboutToExpire && isPreviousDelegate) ); }); }, [addressDelegations, delegatesThatAreAboutToExpiry]); diff --git a/playwright/forkVnet.ts b/playwright/forkVnet.ts index 6b7d91748..c9d3fc013 100644 --- a/playwright/forkVnet.ts +++ b/playwright/forkVnet.ts @@ -88,7 +88,7 @@ const forkVnet = async (displayName: string) => { ], method: 'POST', body: JSON.stringify({ - srcContainerId: 'a3cdcbc9-56a7-4583-bb2d-705f3bd58e43', //id for e2e-testing-aug-28-fork + srcContainerId: '6dd34974-e28e-4f28-bbd8-13898714f275', //id for e2e sep 30 fork dstContainerDisplayName: displayName }) }