Skip to content

Commit

Permalink
Merge pull request #1734 from sushi-labs/sitemap
Browse files Browse the repository at this point in the history
metadata improvement
  • Loading branch information
LufyCZ authored Oct 26, 2024
2 parents 51b15f2 + c3e8ba4 commit 52236e5
Show file tree
Hide file tree
Showing 24 changed files with 116 additions and 29 deletions.
2 changes: 2 additions & 0 deletions apps/web/src/app/(cms)/academy/sitemap.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { getAcademyArticles } from '@sushiswap/graph-client/strapi'
import type { MetadataRoute } from 'next'

export const revalidate = 0

const products = ['bentobox', 'furo', 'onsen', 'sushixswap']

export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
Expand Down
2 changes: 2 additions & 0 deletions apps/web/src/app/(cms)/blog/sitemap.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { getBlogArticles } from '@sushiswap/graph-client/strapi'
import type { MetadataRoute } from 'next'

export const revalidate = 0

export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
try {
const { articles } = await getBlogArticles({
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Metadata } from 'next'

export const metadata: Metadata = {
title: 'My Rewards',
description: 'Claim your rewards from SushiSwap.',
}

export default function Layout({ children }: { children: React.ReactNode }) {
return <>{children}</>
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import { Metadata } from 'next'
import { notFound } from 'next/navigation'
import React from 'react'

import { MigrateTabContent } from 'src/ui/pool/MigrateTabContent'
import { ChainId } from 'sushi'
import { isSushiSwapV2ChainId } from 'sushi/config'

export const metadata: Metadata = {
title: 'Migrate',
description: 'A SushiSwap V2 to V3 migration tool.',
}

export default function MigratePage({
params,
}: { params: { chainId: string } }) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Metadata } from 'next'

export const metadata: Metadata = {
title: 'My Positions',
description:
'Manage your liquidity on SushiSwap: add or remove liquidity, track all your positions and claim fees.',
}

export default function Layout({ children }: { children: React.ReactNode }) {
return <>{children}</>
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Metadata } from 'next'

export const metadata: Metadata = {
title: 'My Rewards',
description: 'Claim your rewards from SushiSwap.',
}

export default function Layout({ children }: { children: React.ReactNode }) {
return <>{children}</>
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Metadata } from 'next'
import { notFound } from 'next/navigation'
import { ChainId } from 'sushi/chain'
import {
Expand All @@ -7,6 +8,12 @@ import {
import { SidebarContainer } from '~evm/_common/ui/sidebar'
import { Providers } from './providers'

export const metadata: Metadata = {
title: 'Cross-Chain Swap',
description:
'Swap assets across multiple blockchains with ease using Cross-Chain Swap. Enjoy secure, seamless cross-chain swaps for a streamlined DeFi experience on Sushi.com.',
}

export default function CrossChainSwapLayout({
children,
params,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import { Container } from '@sushiswap/ui'
import { CrossChainSwapWidget } from 'src/ui/swap/cross-chain/cross-chain-swap-widget'

export const metadata = {
title: 'Cross-Chain Swap',
description: 'SushiSwap Cross-Chain Swap',
}

export default async function CrossChainSwapPage() {
return (
<Container maxWidth="lg" className="px-4">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import { Metadata } from 'next'
import { notFound } from 'next/navigation'
import { TWAP_SUPPORTED_CHAIN_IDS, isTwapSupportedChainId } from 'src/config'
import { ChainId } from 'sushi/chain'
import { SidebarContainer } from '~evm/_common/ui/sidebar'
import { Providers } from './providers'

export const metadata: Metadata = {
title: 'DCA',
description:
"Dollar-cost average into your favorite tokens with SushiSwap's DCA tool.",
}

export default function SwapDCALayout({
children,
params,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ const TWAPPanel = dynamic(
{ ssr: false },
)

export const metadata = {
title: 'Dollar-Cost Averaging (DCA)',
description: 'SushiSwap Dollar-Cost Averaging (DCA)',
}

export default function SwapDCAPage() {
return (
<Container maxWidth="lg" className="px-4">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
import { Metadata } from 'next'
import { notFound } from 'next/navigation'
import { TWAP_SUPPORTED_CHAIN_IDS, isTwapSupportedChainId } from 'src/config'
import { ChainId } from 'sushi/chain'
import { SidebarContainer } from '~evm/_common/ui/sidebar'
import { Providers } from './providers'

export const metadata: Metadata = {
title: 'Limit',
description: 'Trade with limit orders on SushiSwap.',
}

export default function SwapLimitLayout({
children,
params,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ const LimitPanel = dynamic(
{ ssr: false },
)

export const metadata = {
title: 'Limit Order',
description: 'SushiSwap Limit Order',
}

export default function SwapLimitPage() {
return (
<Container maxWidth="lg" className="px-4">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import { Metadata } from 'next'
import { notFound } from 'next/navigation'
import { SUPPORTED_NETWORKS, isSupportedChainId } from 'src/config'
import { ChainId } from 'sushi/chain'
import { SidebarContainer } from '~evm/_common/ui/sidebar'
import { Providers } from './providers'

export const metadata: Metadata = {
title: 'Swap',
description:
'Trade crypto effortlessly with SushiSwap, supporting over 30 chains and featuring a powerful aggregator for the best rates across DeFi.',
}

export default function SwapLayout({
children,
params,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import { Container } from '@sushiswap/ui'
import { SimpleSwapWidget } from 'src/ui/swap/simple/simple-swap-widget'

export const metadata = {
title: 'SushiSwap',
}

export default function SwapSimplePage() {
return (
<Container maxWidth="lg" className="px-4">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ import { ChainId } from 'sushi/chain'
import { SidebarProvider } from '~evm/_common/ui/sidebar'
import { Header } from '../header'

export const metadata = {
title: 'Pools 💦',
}

export default async function ExploreLayout({
children,
params,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { isPoolChainId } from '@sushiswap/graph-client/data-api'
import { Container } from '@sushiswap/ui'
import { Metadata } from 'next'
import { notFound } from 'next/navigation'
import React from 'react'
import { POOL_SUPPORTED_NETWORKS } from 'src/config'
Expand All @@ -9,6 +10,11 @@ import { ChainId } from 'sushi/chain'
import { SidebarContainer } from '~evm/_common/ui/sidebar'
import { NavigationItems } from '../navigation-items'

export const metadata: Metadata = {
title: 'Pools',
description: 'Explore SushiSwap pools.',
}

export default async function ExploreLayout({
children,
params,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
isSmartPoolChainId,
} from '@sushiswap/graph-client/data-api'
import { Container } from '@sushiswap/ui'
import { Metadata } from 'next'
import { notFound } from 'next/navigation'
import React from 'react'
import { GlobalStatsCharts } from 'src/ui/explore/global-stats-charts'
Expand All @@ -11,6 +12,12 @@ import { ChainId } from 'sushi/chain'
import { SidebarContainer } from '~evm/_common/ui/sidebar'
import { NavigationItems } from '../navigation-items'

export const metadata: Metadata = {
title: 'Smart Pools',
description:
'Smart pools optimize liquidity allocation within custom price ranges, enhancing trading efficiency by providing deeper liquidity around the current price, increasing Liquidity Providers fee earnings.',
}

export default async function ExploreLayout({
children,
params,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import { Container, typographyVariants } from '@sushiswap/ui'
import { Metadata } from 'next'
import { notFound } from 'next/navigation'
import { BackButton } from 'src/ui/pool/BackButton'
import { ChainId } from 'sushi/chain'
import { isMerklChainId } from 'sushi/config'

export const metadata: Metadata = {
title: 'Incentivize',
description:
'Add rewards to a pool to incentivize liquidity providers joining in.',
}

export default function Layout({
children,
params,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { getV2Pool } from '@sushiswap/graph-client/data-api'
import { Metadata } from 'next'
import { unstable_cache } from 'next/cache'
import { notFound } from 'next/navigation'
import { ChainId } from 'sushi'
import { isSushiSwapV2ChainId } from 'sushi/config'
import { isAddress } from 'viem'

export const metadata = {
export const metadata: Metadata = {
title: 'Pool 💦',
}

Expand Down
6 changes: 5 additions & 1 deletion apps/web/src/app/_common/cookies/cookie-dialog-container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,9 @@ function _CookieDialogContainer() {
const cookiez = cookies()
const cookiesConfirmed = cookiez.has('accepted-cookies')

return <CookieDialog open={!cookiesConfirmed} />
if (cookiesConfirmed) {
return null
}

return <CookieDialog open={true} />
}
12 changes: 12 additions & 0 deletions apps/web/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@ export const metadata: Metadata = {
},
description:
'A Decentralised Finance (DeFi) app with features such as swap, cross chain swap, streaming, vesting, and permissionless market making for liquidity providers.',
// openGraph: {
// type: 'website',
// locale: 'en_US',
// images: [
// {
// url: 'https://sushi.com/sushi-square.jpg',
// width: 1200,
// height: 1200,
// alt: 'Sushi 🍣',
// },
// ],
// },
}

export default function RootLayout({
Expand Down
7 changes: 6 additions & 1 deletion apps/web/src/ui/explore/tvl-chart.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use client'

import { AnalyticsDayBuckets } from '@sushiswap/graph-client/data-api'
import { useIsMounted } from '@sushiswap/hooks'
import format from 'date-fns/format'
import ReactEcharts from 'echarts-for-react'
import { EChartsOption } from 'echarts-for-react/lib/types'
Expand All @@ -16,6 +17,8 @@ interface TVLChart {
}

export const TVLChart: FC<TVLChart> = ({ data, chainId }) => {
const isMounted = useIsMounted()

const { resolvedTheme } = useTheme()

const [v2, v3, combinedTVL, currentDate] = useMemo(() => {
Expand Down Expand Up @@ -195,7 +198,9 @@ export const TVLChart: FC<TVLChart> = ({ data, chainId }) => {
id="hoveredTVLDate"
className="text-sm text-gray-500 dark:text-slate-500"
>
{format(new Date(currentDate), 'MMM dd yyyy HH:mm aa')}
{isMounted
? format(new Date(currentDate), 'MMM dd yyyy HH:mm aa')
: ''}
</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/ui/sidebar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ const Sidebar: FC<Omit<SidebarContainerProps, 'children' | 'shiftContent'>> = ({
return (
<CommandItem
key={network}
className="cursor-pointer aria-selected:!bg-[unset] aria-selected:!text-[unset] !p-0 my-0.5"
className="aria-selected:!bg-[unset] aria-selected:!text-[unset] !p-0 my-0.5"
testdata-id={`network-selector-${network}`}
value={`${name}__${network}`}
onSelect={
Expand All @@ -176,7 +176,7 @@ const Sidebar: FC<Omit<SidebarContainerProps, 'children' | 'shiftContent'>> = ({
}
>
<Button
className={'flex items-center !justify-normal gap-2'}
className="flex items-center !justify-normal gap-2"
fullWidth
variant={
selectedNetwork === network ? 'secondary' : 'ghost'
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ const Navigation: React.FC<NavProps> = ({
>
<NavigationMenuTrigger>{entry.title}</NavigationMenuTrigger>
<NavigationMenuContent>
<ul className="w-[300px] sm:w-[400px] gap-3 p-4">
<ul className="w-[250px] sm:w-[400px] gap-3 p-4">
{entry.items.map((component) => (
<NavigationListItem
key={component.title}
Expand Down

0 comments on commit 52236e5

Please sign in to comment.