Skip to content

Commit

Permalink
Merge pull request #3 from rarimo/feature/bridge
Browse files Browse the repository at this point in the history
add oracles, tss pages
  • Loading branch information
napalmpapalam authored Dec 1, 2023
2 parents fa4b173 + c495edf commit 244732e
Show file tree
Hide file tree
Showing 123 changed files with 5,626 additions and 360 deletions.
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog], and this project adheres to [Semantic Versioning].

## [1.0.9] - 2023-12-01
### Added
- TSS pages
- Oracle pages
- Operation pages
- Confirmation pages
- Network pages
- Supported token pages

## [1.0.8] - 2023-11-23
### Changed
- Disabled eslint during the build in the next.config.js
Expand Down Expand Up @@ -51,7 +60,8 @@ The format is based on [Keep a Changelog], and this project adheres to [Semantic

- Initiated project

[Unreleased]: https://gitlab.com/rarimo/scan/compare/1.0.8...HEAD
[Unreleased]: https://gitlab.com/rarimo/scan/compare/1.0.9...HEAD
[1.0.9]: https://gitlab.com/rarimo/scan/compare/1.0.8...1.0.9
[1.0.8]: https://gitlab.com/rarimo/scan/compare/1.0.7...1.0.8
[1.0.7]: https://gitlab.com/rarimo/scan/compare/1.0.6...1.0.7
[1.0.6]: https://gitlab.com/rarimo/scan/compare/1.0.5...1.0.6
Expand Down
2 changes: 1 addition & 1 deletion codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { CodegenConfig } from '@graphql-codegen/cli'
const config: CodegenConfig = {
overwrite: true,
require: ['dotenv/config'],
schema: process.env.GRAPHQL_URL,
schema: process.env.NEXT_PUBLIC_GRAPHQL_URL,
documents: ['src/**/*.gql'],
generates: {
'src/graphql/generated.ts': {
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "scan",
"version": "1.0.8",
"version": "1.0.9",
"private": true,
"gitHooks": {
"pre-commit": "yarn lint",
Expand All @@ -14,7 +14,7 @@
"lint:scripts": "next lint",
"lint:styles": "stylelint \"src/**/*.{css,sass,scss}\" --max-warnings=0",
"rsc": "node scripts/release-sanity-check.mjs",
"codegen-generate": "graphql-codegen --require dotenv/config --config codegen.ts dotenv_config_path=.env"
"codegen-generate": "graphql-codegen --require dotenv/config --config codegen.ts dotenv_config_path=.env.local"
},
"dependencies": {
"@apollo/client": "^3.7.17",
Expand All @@ -27,7 +27,7 @@
"@hookform/resolvers": "^3.3.1",
"@mui/icons-material": "^5.14.3",
"@mui/material": "^5.14.3",
"@rarimo/client": "^2.0.0-rc.31",
"@rarimo/client": "^2.0.0-rc.32",
"graphql": "^16.7.1",
"graphql-tag": "^2.12.6",
"lodash-es": "^4.17.21",
Expand Down
34 changes: 34 additions & 0 deletions src/app/[locale]/confirmations/[root]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { Metadata } from 'next'
import { notFound } from 'next/navigation'

import { getConfirmationByRoot } from '@/callers'
import {
Confirmation,
ConfirmationOperations,
ConfirmationOperationVotes,
PageContainer,
} from '@/components'
import { createMetadata } from '@/config'
import { ConfirmationFragment } from '@/graphql'
import { getServerSideProps } from '@/helpers'

const getConfirmation = (root: string) => {
return getServerSideProps<ConfirmationFragment>(() => getConfirmationByRoot(root))
}

export function generateMetadata({ params }: { params: { root: string } }): Metadata {
return createMetadata(`Confirmation ${params.root} Details`)
}

export default async function ConfirmationPage({ params: { root } }: { params: { root: string } }) {
const { isNotFound, indexes } = await getConfirmation(root)
if (isNotFound) notFound()

return (
<PageContainer>
<Confirmation root={root} />
<ConfirmationOperations indexes={indexes} />
<ConfirmationOperationVotes indexes={indexes} />
</PageContainer>
)
}
16 changes: 16 additions & 0 deletions src/app/[locale]/confirmations/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Metadata } from 'next'

import { Confirmations, PageContainer } from '@/components'
import { createMetadata } from '@/config'

export function generateMetadata(): Metadata {
return createMetadata(`Confirmations`)
}

export default function ConfirmationsPage() {
return (
<PageContainer>
<Confirmations />
</PageContainer>
)
}
27 changes: 27 additions & 0 deletions src/app/[locale]/networks/[name]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { Metadata } from 'next'
import { notFound } from 'next/navigation'

import { getNetworkByName } from '@/callers'
import { Network, PageContainer } from '@/components'
import { createMetadata } from '@/config'
import { NetworkFragment } from '@/graphql'
import { getServerSideProps } from '@/helpers'

const getNetwork = (name: string) => {
return getServerSideProps<NetworkFragment>(() => getNetworkByName(name))
}

export function generateMetadata({ params }: { params: { name: string } }): Metadata {
return createMetadata(`Network ${params.name} Details`)
}

export default async function NetworkPage({ params: { name } }: { params: { name: string } }) {
const { isNotFound } = await getNetwork(name)
if (isNotFound) notFound()

return (
<PageContainer>
<Network name={name} />
</PageContainer>
)
}
16 changes: 16 additions & 0 deletions src/app/[locale]/networks/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Metadata } from 'next'

import { Networks, PageContainer } from '@/components'
import { createMetadata } from '@/config'

export function generateMetadata(): Metadata {
return createMetadata(`Networks`)
}

export default function NetworksPage() {
return (
<PageContainer>
<Networks />
</PageContainer>
)
}
28 changes: 28 additions & 0 deletions src/app/[locale]/operations/[index]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { Metadata } from 'next'
import { notFound } from 'next/navigation'

import { getOperationByIndex } from '@/callers'
import { Operation, OperationVotes, PageContainer } from '@/components'
import { createMetadata } from '@/config'
import { GetOperationByIndexQuery } from '@/graphql'
import { getServerSideProps } from '@/helpers'

const getOperation = (index: string) => {
return getServerSideProps<GetOperationByIndexQuery>(() => getOperationByIndex(index))
}

export function generateMetadata({ params }: { params: { index: string } }): Metadata {
return createMetadata(`Operation ${params.index} Details`)
}

export default async function OperationPage({ params: { index } }: { params: { index: string } }) {
const { isNotFound } = await getOperation(index)
if (isNotFound) notFound()

return (
<PageContainer>
<Operation index={index} />
<OperationVotes index={index} />
</PageContainer>
)
}
16 changes: 16 additions & 0 deletions src/app/[locale]/operations/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Metadata } from 'next'

import { Operations, PageContainer } from '@/components'
import { createMetadata } from '@/config'

export function generateMetadata(): Metadata {
return createMetadata(`Operations`)
}

export default function OperationsPage() {
return (
<PageContainer>
<Operations />
</PageContainer>
)
}
33 changes: 33 additions & 0 deletions src/app/[locale]/oracles/[address]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { Metadata } from 'next'
import { notFound } from 'next/navigation'

import { getOracleByAddress } from '@/callers'
import { getClient } from '@/client'
import { AccountTransactions, Oracle, PageContainer } from '@/components'
import { createMetadata } from '@/config'
import { OracleFragment } from '@/graphql'
import { getServerSideProps } from '@/helpers'

const getOracle = async (address: string) => {
return getServerSideProps<OracleFragment>(() => {
return getOracleByAddress(address)
})
}

export function generateMetadata({ params }: { params: { address: string } }): Metadata {
return createMetadata(`Oracle ${params.address} Details`)
}

export default async function OraclePage({ params: { address } }: { params: { address: string } }) {
const { isNotFound } = await getOracle(address)
if (isNotFound) notFound()

const account = await getClient().query.getAccount(address)

return (
<PageContainer>
<Oracle address={address} />
<AccountTransactions sender={account.base_account.pub_key!} />
</PageContainer>
)
}
16 changes: 16 additions & 0 deletions src/app/[locale]/oracles/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Metadata } from 'next'

import { Oracles, PageContainer } from '@/components'
import { createMetadata } from '@/config'

export function generateMetadata(): Metadata {
return createMetadata('Oracles')
}

export default function OraclesPage() {
return (
<PageContainer>
<Oracles />
</PageContainer>
)
}
31 changes: 31 additions & 0 deletions src/app/[locale]/supported-tokens/[index]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { Metadata } from 'next'
import { notFound } from 'next/navigation'

import { getCollectionByIndex } from '@/callers'
import { PageContainer, SupportedToken } from '@/components'
import { createMetadata } from '@/config'
import { CollectionFragment } from '@/graphql'
import { getServerSideProps } from '@/helpers'

const getCollection = (index: string) => {
return getServerSideProps<CollectionFragment>(() => getCollectionByIndex(index))
}

export function generateMetadata({ params }: { params: { index: string } }): Metadata {
return createMetadata(`Supported Token ${params.index} Details`)
}

export default async function SupportedTokenPage({
params: { index },
}: {
params: { index: string }
}) {
const { isNotFound } = await getCollection(index)
if (isNotFound) notFound()

return (
<PageContainer>
<SupportedToken index={index} />
</PageContainer>
)
}
16 changes: 16 additions & 0 deletions src/app/[locale]/supported-tokens/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Metadata } from 'next'

import { PageContainer, SupportedTokens } from '@/components'
import { createMetadata } from '@/config'

export function generateMetadata(): Metadata {
return createMetadata(`Supported Tokens`)
}

export default function SupportedTokensPage() {
return (
<PageContainer>
<SupportedTokens />
</PageContainer>
)
}
31 changes: 31 additions & 0 deletions src/app/[locale]/tss/[address]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { Metadata } from 'next'
import { notFound } from 'next/navigation'

import { getTSSByAddress } from '@/callers'
import { getClient } from '@/client'
import { AccountTransactions, PageContainer, TSSDetails } from '@/components'
import { createMetadata } from '@/config'
import { TssFragment } from '@/graphql'
import { getServerSideProps } from '@/helpers'

const getTSS = (address: string) => {
return getServerSideProps<TssFragment>(() => getTSSByAddress(address))
}

export function generateMetadata({ params }: { params: { address: string } }): Metadata {
return createMetadata(`TSS ${params.address} Details`)
}

export default async function TSSPage({ params: { address } }: { params: { address: string } }) {
const { isNotFound } = await getTSS(address)
if (isNotFound) notFound()

const account = await getClient().query.getAccount(address)

return (
<PageContainer>
<TSSDetails address={address} />
<AccountTransactions sender={account.base_account.pub_key!} />
</PageContainer>
)
}
16 changes: 16 additions & 0 deletions src/app/[locale]/tss/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Metadata } from 'next'

import { PageContainer, TSSs } from '@/components'
import { createMetadata } from '@/config'

export function generateMetadata(): Metadata {
return createMetadata('TSS')
}

export default function TSSsPage() {
return (
<PageContainer>
<TSSs />
</PageContainer>
)
}
Loading

0 comments on commit 244732e

Please sign in to comment.