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

Sync production with main #779

Merged
merged 40 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
4fac3f4
changes routes around to add a farming and domain route
marc-aurele-besner Jul 17, 2024
d6868d3
create these route page and layout
marc-aurele-besner Jul 17, 2024
738aec7
allow to import image from our docs domain
marc-aurele-besner Jul 17, 2024
0a2f2f9
don't show out of sync on domain
marc-aurele-besner Jul 17, 2024
4266087
rename old domainHeader to SectionHeader and add proper Domain and Fa…
marc-aurele-besner Jul 17, 2024
4d2bf7a
add farming component
marc-aurele-besner Jul 17, 2024
e0d0739
improve farming component
marc-aurele-besner Jul 17, 2024
57d1a62
Merge branch 'main' into feat/farmingSection
marc-aurele-besner Jul 17, 2024
56a3b34
change metadata image on farming page
marc-aurele-besner Jul 17, 2024
eb57acf
Merge branch 'feat/farmingSection' of https://github.com/subspace/ast…
marc-aurele-besner Jul 17, 2024
87a87d5
use NEXTAUTH_URL if available
marc-aurele-besner Jul 17, 2024
32e2727
improve account list dropdown address formatting
marc-aurele-besner Jul 22, 2024
7d81745
fix some routes and improve bottom farmer text
marc-aurele-besner Jul 22, 2024
05f2a9c
improve domain page
marc-aurele-besner Jul 22, 2024
c9d8215
improve farming page
marc-aurele-besner Jul 22, 2024
e9756c2
add auto id page
marc-aurele-besner Jul 22, 2024
925afcd
fix build warnings
marc-aurele-besner Jul 22, 2024
653dc62
Merge branch 'main' into feat/farmingSection
marc-aurele-besner Jul 22, 2024
8d8f807
Apply suggestions from code review
marc-aurele-besner Jul 23, 2024
232f569
Merge branch 'main' into feat/farmingSection
marc-aurele-besner Jul 23, 2024
790b2e4
Merge branch 'main' into feat/farmingSection
marc-aurele-besner Jul 24, 2024
6d7fc4a
Merge branch 'main' into feat/farmingSection
marc-aurele-besner Jul 25, 2024
c4c9818
fix website, academy, forum and yt links
marc-aurele-besner Jul 30, 2024
db75af8
fix proper social name
marc-aurele-besner Jul 30, 2024
bb49466
Fix build badge
marc-aurele-besner Jul 30, 2024
449f28e
Merge pull request #775 from autonomys/marc-aurele-besner-patch-1
marc-aurele-besner Jul 30, 2024
08893e2
fix account reward page
marc-aurele-besner Jul 30, 2024
d8f7827
Merge branch 'main' into feat/farmingSection
marc-aurele-besner Jul 30, 2024
f58a3a3
Fix query on nova blocks list
marc-aurele-besner Jul 30, 2024
4cd93f7
Merge pull request #777 from autonomys/bug/fixAccountRewardPage
marc-aurele-besner Jul 30, 2024
ef76de4
Apply suggestions from code review
marc-aurele-besner Jul 30, 2024
a2d847f
fix build following last commit
marc-aurele-besner Jul 30, 2024
fd15121
Merge branch 'main' into feat/farmingSection
marc-aurele-besner Jul 30, 2024
d4d2ceb
Merge pull request #754 from autonomys/feat/farmingSection
marc-aurele-besner Jul 30, 2024
19200a9
Merge branch 'main' into bug/novaBlocksPageQueryBroken
marc-aurele-besner Jul 30, 2024
a48f1cf
Merge pull request #778 from autonomys/bug/novaBlocksPageQueryBroken
marc-aurele-besner Jul 30, 2024
f46c57b
Merge branch 'main' into 774-update-branding-links
marc-aurele-besner Jul 30, 2024
aaa9b1f
Merge pull request #776 from autonomys/774-update-branding-links
marc-aurele-besner Jul 30, 2024
b9b7acb
fix route following s addition
marc-aurele-besner Jul 30, 2024
fec4bee
Merge pull request #780 from autonomys/bug/domainsRouteAppPage
marc-aurele-besner Jul 30, 2024
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
1 change: 1 addition & 0 deletions .vscode/astral.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"editor.formatOnSave": true,
"cSpell.words": [
"autonomys",
"autoid",
"extrinsics",
"gemini",
"graphiql",
Expand Down
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"editor.formatOnSave": true,
"cSpell.words": [
"autonomys",
"autoid",
"extrinsics",
"gemini",
"graphiql",
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![build](https://github.com/autonomys//blockexplorer/actions/workflows/build.yaml/badge.svg)
![build](https://github.com/autonomys/astral/actions/workflows/build.yaml/badge.svg)

# Astral

Expand Down
1 change: 1 addition & 0 deletions explorer/gql/oldSquidTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2602,6 +2602,7 @@ export type AllRewardForAccountByIdQuery = { __typename?: 'Query', accountReward
export type BlocksConnectionQueryVariables = Exact<{
first: Scalars['Int']['input'];
after?: InputMaybe<Scalars['String']['input']>;
orderBy: Array<BlockOrderByInput> | BlockOrderByInput;
}>;


Expand Down
11 changes: 11 additions & 0 deletions explorer/next.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
/** @type {import('next').NextConfig;} */
const nextConfig = {
reactStrictMode: true,
images: {
formats: ['image/avif', 'image/webp'],
remotePatterns: [
{
protocol: 'https',
hostname: 'docs.subspace.network',
port: '',
pathname: '**',
},
],
},
webpack: (config, { isServer }) => {
config.module.rules.push({
test: /\.svg$/,
Expand Down
Binary file added explorer/public/images/share-farming.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions explorer/src/app/[chain]/autoid/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { DomainHeader } from 'components/layout/DomainHeader'
import { MainLayout } from 'components/layout/Layout'
import type { ChildrenPageProps } from 'types/app'

export default async function Layout({ children }: ChildrenPageProps) {
return <MainLayout subHeader={<DomainHeader />}>{children}</MainLayout>
}
29 changes: 29 additions & 0 deletions explorer/src/app/[chain]/autoid/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { AutoIdPage } from '@/components/AutoId'
import { chains } from 'constants/chains'
import { metadata } from 'constants/metadata'
import { Metadata } from 'next'
import { FC } from 'react'
import type { ChainPageProps } from 'types/app'

export async function generateMetadata({ params: { chain } }: ChainPageProps): Promise<Metadata> {
const chainTitle = chains.find((c) => c.urls.page === chain)?.title || 'Unknown chain'
const title = `${metadata.title} - ${chainTitle} - Auto ID`
return {
...metadata,
title,
openGraph: {
...metadata.openGraph,
title,
},
twitter: {
...metadata.twitter,
title,
},
}
}

const Page: FC = () => {
return <AutoIdPage />
}

export default Page
7 changes: 7 additions & 0 deletions explorer/src/app/[chain]/domains/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { DomainHeader } from 'components/layout/DomainHeader'
import { MainLayout } from 'components/layout/Layout'
import type { ChildrenPageProps } from 'types/app'

export default async function Layout({ children }: ChildrenPageProps) {
return <MainLayout subHeader={<DomainHeader />}>{children}</MainLayout>
}
29 changes: 29 additions & 0 deletions explorer/src/app/[chain]/domains/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { DomainPage } from 'components/Domain'
import { chains } from 'constants/chains'
import { metadata } from 'constants/metadata'
import { Metadata } from 'next'
import { FC } from 'react'
import type { ChainPageProps } from 'types/app'

export async function generateMetadata({ params: { chain } }: ChainPageProps): Promise<Metadata> {
const chainTitle = chains.find((c) => c.urls.page === chain)?.title || 'Unknown chain'
const title = `${metadata.title} - ${chainTitle} - Domain`
return {
...metadata,
title,
openGraph: {
...metadata.openGraph,
title,
},
twitter: {
...metadata.twitter,
title,
},
}
}

const Page: FC = () => {
return <DomainPage />
}

export default Page
7 changes: 7 additions & 0 deletions explorer/src/app/[chain]/farming/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { FarmingHeader } from 'components/layout/FarmingHeader'
import { MainLayout } from 'components/layout/Layout'
import type { ChildrenPageProps } from 'types/app'

export default async function Layout({ children }: ChildrenPageProps) {
return <MainLayout subHeader={<FarmingHeader />}>{children}</MainLayout>
}
38 changes: 38 additions & 0 deletions explorer/src/app/[chain]/farming/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { DownloadPage } from '@/components/Farming'
import { chains } from 'constants/chains'
import { metadata, url } from 'constants/metadata'
import { Metadata } from 'next'
import { FC } from 'react'
import type { ChainPageProps } from 'types/app'

export async function generateMetadata({ params: { chain } }: ChainPageProps): Promise<Metadata> {
const chainTitle = chains.find((c) => c.urls.page === chain)?.title || 'Unknown chain'
const title = `${metadata.title} - ${chainTitle} - Farming`
const images = {
url: url + '/images/share-farming.png',
secureUrl: url + 'image/png',
width: 900,
height: 600,
alt: title,
}
return {
...metadata,
title,
openGraph: {
...metadata.openGraph,
title,
images,
},
twitter: {
...metadata.twitter,
title,
images,
},
}
}

const Page: FC = () => {
return <DownloadPage />
}

export default Page
9 changes: 7 additions & 2 deletions explorer/src/components/Account/AccountRewardList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { SortingState } from '@tanstack/react-table'
import { SortedTable } from 'components/common/SortedTable'
import { Spinner } from 'components/common/Spinner'
import { PAGE_SIZE } from 'constants/general'
import { INTERNAL_ROUTES } from 'constants/routes'
import { INTERNAL_ROUTES, Routes } from 'constants/routes'
import dayjs from 'dayjs'
import relativeTime from 'dayjs/plugin/relativeTime'
import { RewardEventOrderByInput, RewardsListQueryVariables } from 'gql/graphql'
Expand Down Expand Up @@ -73,6 +73,8 @@ export const AccountRewardList: FC = () => {
skip: !inFocus,
pollInterval: 6000,
},
selectedChain?.isDomain ? Routes.nova : Routes.consensus,
'accountReward',
)

const {
Expand Down Expand Up @@ -208,9 +210,12 @@ export const AccountRewardList: FC = () => {
useEffect(() => {
setIsVisible(inView)
}, [inView, setIsVisible])

return (
<div className='flex w-full flex-col align-middle'>
<AccountDetailsCard account={account} accountAddress={convertedAddress ?? '0x'} />
{convertedAddress && (
<AccountDetailsCard account={account} accountAddress={convertedAddress} />
)}

<div className='mt-5 flex w-full justify-between'>
<div className='text-base font-medium text-grayDark dark:text-white'>{`Rewards (${totalLabel})`}</div>
Expand Down
27 changes: 27 additions & 0 deletions explorer/src/components/AutoId/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
'use client'

import { FC } from 'react'

export const AutoIdPage: FC = () => {
return (
<div className='flex w-full flex-col items-center space-y-4'>
<div className='w-full max-w-4xl'>
<div className='mb-4 w-full rounded-[20px] border border-slate-100 bg-white px-3 py-4 shadow dark:border-none dark:bg-gradient-to-r dark:from-gradientTwilight dark:via-gradientDusk dark:to-gradientSunset sm:p-6'>
<div className='mb-10 flex flex-col items-center justify-center'>
<h1 className='mb-8 mt-6 text-center text-4xl font-bold text-gray-900 dark:text-white'>
Auto-ID
</h1>
</div>
<div className='m-6 flow-root text-gray-900 dark:text-white'>
<div className='mb-12 flex w-full items-center gap-5 overflow-x-auto'>
<p>
Auto ID is our first primitive enabling identity infrastructure at massive scale.
Documentation coming soon.
</p>
</div>
</div>
</div>
</div>
</div>
)
}
5 changes: 4 additions & 1 deletion explorer/src/components/Block/BlockList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import dayjs from 'dayjs'
import relativeTime from 'dayjs/plugin/relativeTime'
import {
Block,
BlockOrderByInput,
BlocksConnectionDomainQuery,
BlocksConnectionDomainQueryVariables,
BlocksConnectionQuery,
Expand Down Expand Up @@ -49,15 +50,17 @@ export const BlockList: FC = () => {
[selectedChain.isDomain],
)

const orderBy = useMemo(() => BlockOrderByInput.HeightDesc, [])
const variables = useMemo(
() => ({
first: pagination.pageSize,
after:
pagination.pageIndex > 0
? (pagination.pageIndex * pagination.pageSize).toString()
: undefined,
orderBy,
}),
[pagination.pageSize, pagination.pageIndex],
[pagination.pageSize, pagination.pageIndex, orderBy],
)

const { setIsVisible } = useSquidQuery<
Expand Down
4 changes: 2 additions & 2 deletions explorer/src/components/Block/query.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { gql } from '@apollo/client'

export const QUERY_BLOCK_LIST_CONNECTION = gql`
query BlocksConnection($first: Int!, $after: String) {
blocksConnection(orderBy: height_DESC, first: $first, after: $after) {
query BlocksConnection($first: Int!, $after: String, $orderBy: [BlockOrderByInput!]!) {
blocksConnection(orderBy: $orderBy, first: $first, after: $after) {
edges {
cursor
node {
Expand Down
95 changes: 95 additions & 0 deletions explorer/src/components/Domain/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
'use client'

import { BlockIcon, DocIcon } from '@/components/icons'
import { Routes } from 'constants/routes'
import useDomains from 'hooks/useDomains'
import Link from 'next/link'
import { FC, useMemo } from 'react'

export const DomainPage: FC = () => {
const { selectedChain } = useDomains()

const listOfCards = useMemo(
() => [
{
title: 'Nova',
description: 'EVM domain',
href: `/${selectedChain.urls.page}/${Routes.nova}`,
icon: <BlockIcon />,
darkBgClass:
'dark:bg-gradient-to-b dark:from-purpleLighterAccent dark:via-purpleMedium dark:to-purplePale',
},
{
title: 'Auto-ID',
description: 'Identity domain',
href: `/${selectedChain.urls.page}/${Routes.autoid}`,
icon: <DocIcon />,
darkBgClass: 'dark:bg-gradient-to-b dark:from-purpleDeep dark:to-purplePastel',
},
],
[selectedChain.urls.page],
)

return (
<div className='flex w-full flex-col items-center space-y-4'>
<div className='w-full max-w-4xl'>
<div className='mb-4 w-full rounded-[20px] border border-slate-100 bg-white px-3 py-4 shadow dark:border-none dark:bg-gradient-to-r dark:from-gradientTwilight dark:via-gradientDusk dark:to-gradientSunset sm:p-6'>
<div className='mb-10 flex flex-col items-center justify-center'>
<h1 className='mb-8 mt-6 text-center text-4xl font-bold text-gray-900 dark:text-white'>
Domains
</h1>
</div>
<div className='m-6 flow-root text-gray-900 dark:text-white'>
<div className='mb-12 flex w-full items-center gap-5 overflow-x-auto'>
<p>
The Autonomys Network can run multiple domains, each with different runtimes,
genesis configurations, and validator sets. Each domain is a separate blockchain
with its own state and history. Operators for each domain are responsible for
preparing blocks of transactions. Committing these domain blocks as bundles to the
Consensus Layer is done on a per-domain basis.
</p>
</div>
<div className='mb-12 flex w-full items-center gap-5 overflow-x-auto'>
<p>
At the moment, we have an EVM (Ethereum Virtual Machine) domain and a custom
decentralized identity domain. However, more custom or existing runtime domains
could be deployed in the future.
</p>
</div>
</div>
</div>

<div className='m-4 p-4'>
<div className='m-6 flow-root'>
<div className='mb-12 flex w-full items-center justify-center gap-5 overflow-x-auto'>
{listOfCards.map(({ title, description, href, icon, darkBgClass }, index) => (
<Link key={index} href={href}>
<div
key={index}
className={'h-[216px] w-1/5 min-w-[200px] grow cursor-pointer md:min-w-[228px]'}
>
<div
className={`flex h-full flex-col justify-center rounded-[20px] bg-white ${darkBgClass}`}
>
<div className='mb-6 flex w-full items-center justify-center align-middle'>
{icon}
</div>
<div className='flex w-full flex-col items-center justify-center align-middle'>
<h2 className='mb-2.5 text-center text-2xl font-normal text-gray-900 dark:text-white'>
{title}
</h2>
<p className='text-md text-center font-medium leading-relaxed dark:text-white'>
{description}
</p>
</div>
</div>
</div>
</Link>
))}
</div>
</div>
</div>
</div>
</div>
)
}
Loading
Loading