Skip to content

Commit

Permalink
Release (#1492)
Browse files Browse the repository at this point in the history
* update contracts

* add version selector

* show banner on all pages

* show banner on all pages

* Announcement/warning messages cleanup

* new main announcement message
* contextual compute-to-data warnings in publish form & asset action

* copy update

* change hardcoded URLs

* change localStorage key

* to prevent user preferences clashes when switching between v3 & v4

* footer stats note changes

* move copy into content file
* mention external markets

* footer stats note copy changes

* modified pool widget footer

* take out pool reserve display
* style & spacing updates for fees

Co-authored-by: Matthias Kretschmann <[email protected]>
  • Loading branch information
mihaisc and kremalicious authored Jun 8, 2022
1 parent 5747795 commit 6dfeead
Show file tree
Hide file tree
Showing 22 changed files with 191 additions and 77 deletions.
4 changes: 2 additions & 2 deletions app.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ module.exports = {

// List of chainIds which metadata cache queries will return by default.
// This preselects the Chains user preferences.
chainIds: [3, 4, 80001, 1287],
chainIds: [1, 137, 56, 246, 1285],

// List of all supported chainIds. Used to populate the Chains user preferences list.
chainIdsSupported: [3, 4, 80001, 1287],
chainIdsSupported: [1, 137, 56, 246, 1285, 3, 4, 80001, 1287],

infuraProjectId: process.env.NEXT_PUBLIC_INFURA_PROJECT_ID || 'xxx',

Expand Down
5 changes: 4 additions & 1 deletion content/footer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@
"name": "Discord",
"url": "https://discord.gg/TnXjkR5"
}
]
],
"stats": {
"note": "Counted on-chain from our NFT and pool factories. Includes assets in all Ocean Market forks and [purgatory](https://github.com/oceanprotocol/list-purgatory)."
}
}
10 changes: 3 additions & 7 deletions content/site.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"siteTitle": "Ocean Market",
"siteTagline": "A marketplace to find, publish and trade data sets in the Ocean Network.",
"siteUrl": "https://v4.market.oceanprotocol.com",
"siteUrl": "https://market.oceanprotocol.com",
"siteImage": "/share.png",
"copyright": "All Rights Reserved. Powered by ",
"menu": [
Expand All @@ -14,12 +14,8 @@
"link": "/profile"
}
],
"announcement": "Data NFTs, One-Sided Staking and more. [Explore OceanONDA V4](https://blog.oceanprotocol.com).",
"warning": {
"main": "",
"polygonPublish": "Only republish data sets with a pool from ETH Mainnet into Polygon/Matic if the liquidity is **less than or equal to 1000 OCEAN in the original pool**. Doing otherwise will lead to [purgatory](https://github.com/oceanprotocol/list-purgatory) for the data set in Polygon/Matic."
},
"announcement": {
"main": "Ocean Market is [available on Polygon](https://blog.oceanprotocol.com/ocean-on-polygon-network-8abad19cbf47).",
"polygon": "Polygon/Matic EVM support is in early stages. [Use the Polygon Bridge](https://docs.oceanprotocol.com/tutorials/polygon-bridge/) to get mOCEAN."
"ctd": "Compute-to-Data is still in a testing phase, please use it only on test networks."
}
}
30 changes: 15 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@coingecko/cryptoformat": "^0.4.4",
"@loadable/component": "^5.15.2",
"@oceanprotocol/art": "^3.2.0",
"@oceanprotocol/lib": "^1.0.0-next.44",
"@oceanprotocol/lib": "^1.0.0-next.45",
"@oceanprotocol/typographies": "^0.1.0",
"@portis/web3": "^4.0.7",
"@tippyjs/react": "^4.2.6",
Expand Down
10 changes: 4 additions & 6 deletions src/@context/MarketMetadata/_types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ export interface AppConfig {
classNameLight: string
storageKey: string
}
v3MetadataCacheUri: string
v3MarketUri: string
}
export interface SiteContent {
siteTitle: string
Expand All @@ -40,13 +42,9 @@ export interface SiteContent {
name: string
link: string
}[]
announcement: string
warning: {
main: string
polygonPublish: string
}
announcement: {
main: string
polygon: string
ctd: string
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/@context/UserPreferences.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ interface UserPreferencesValue {

const UserPreferencesContext = createContext(null)

const localStorageKey = 'ocean-user-preferences'
const localStorageKey = 'ocean-user-preferences-v4'

function getLocalStorage(): UserPreferencesValue {
const storageParsed =
Expand Down
4 changes: 2 additions & 2 deletions src/components/@shared/atoms/Badge/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React, { ReactElement } from 'react'
import React, { ReactElement, ReactNode } from 'react'
import styles from './index.module.css'
import classNames from 'classnames/bind'

const cx = classNames.bind(styles)

export interface BadgeProps {
label: string
label: string | ReactNode
className?: string
}

Expand Down
13 changes: 5 additions & 8 deletions src/components/App/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,30 @@ import AnnouncementBanner from '@shared/AnnouncementBanner'
import PrivacyPreferenceCenter from '../Privacy/PrivacyPreferenceCenter'
import styles from './index.module.css'
import { ToastContainer } from 'react-toastify'
import { useRouter } from 'next/router'
import content from '../../../content/purgatory.json'
import contentPurgatory from '../../../content/purgatory.json'
import { useMarketMetadata } from '@context/MarketMetadata'

export default function App({
children
}: {
children: ReactElement
}): ReactElement {
const router = useRouter()

const { siteContent, appConfig } = useMarketMetadata()
const { accountId } = useWeb3()
const { isInPurgatory, purgatoryData } = useAccountPurgatory(accountId)

return (
<div className={styles.app}>
{router.pathname === '/' && siteContent?.warning.main !== '' && (
<AnnouncementBanner text={siteContent?.warning.main} />
{siteContent?.announcement !== '' && (
<AnnouncementBanner text={siteContent?.announcement} />
)}
<Header />

{isInPurgatory && (
<Alert
title={content.account.title}
title={contentPurgatory.account.title}
badge={`Reason: ${purgatoryData?.reason}`}
text={content.account.description}
text={contentPurgatory.account.description}
state="error"
/>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@
border-right: 0;
padding: 0;
}

.warning {
margin-bottom: var(--spacer);
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import { useWeb3 } from '@context/Web3'
import content from '../../../../../content/pages/startComputeDataset.json'
import { Asset } from '@oceanprotocol/lib'
import { AccessDetails } from 'src/@types/Price'
import { useMarketMetadata } from '@context/MarketMetadata'
import Alert from '@shared/atoms/Alert'

export default function FormStartCompute({
algorithms,
Expand Down Expand Up @@ -61,6 +63,7 @@ export default function FormStartCompute({
isConsumable: boolean
consumableFeedback: string
}): ReactElement {
const { siteContent } = useMarketMetadata()
const { isValid, values }: FormikContextType<{ algorithm: string }> =
useFormikContext()
const { asset, isAssetNetwork } = useAsset()
Expand Down Expand Up @@ -126,6 +129,11 @@ export default function FormStartCompute({

return (
<Form className={styles.form}>
<Alert
className={styles.warning}
state="info"
text={siteContent.warning.ctd}
/>
{content.form.data.map((field: FormFieldContent) => (
<Field
key={field.name}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Asset/AssetActions/Pool/Add/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export default function Add({
/>
</div>

<Output newPoolTokens={newPoolTokens} newPoolShare={newPoolShare} />
{/* TODO: will be fixed in #1481 <Output newPoolTokens={newPoolTokens} newPoolShare={newPoolShare} /> */}

<Actions
isDisabled={!isValid || !values.amount || values.amount === 0}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
font-size: var(--font-size-mini);
color: var(--color-secondary);
text-align: center;
padding-top: calc(var(--spacer) / 4);
padding-bottom: calc(var(--spacer) / 3);
padding-top: calc(var(--spacer) / 2);
padding-bottom: calc(var(--spacer) / 2);
}

.update:before {
Expand Down
15 changes: 15 additions & 0 deletions src/components/Asset/AssetActions/Pool/Sections/index.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,18 @@
margin-left: calc(var(--spacer) / 3);
margin-right: calc(var(--spacer) / 3);
}

.fees {
border-top: none;
padding-top: 0;
margin-top: -0.5rem;
}

.fees > div {
grid-template-columns: repeat(auto-fit, minmax(5rem, 1fr));
text-align: center;
}

.fees figure {
display: none;
}
12 changes: 2 additions & 10 deletions src/components/Asset/AssetActions/Pool/Sections/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,17 +110,9 @@ export default function PoolSections() {
titlePostfixTitle={`Weight of ${poolInfo?.weightBaseToken}% ${poolInfo?.baseTokenSymbol} & ${poolInfo?.weightDt}% ${poolInfo?.datatokenSymbol}`}
>
<Graph />
<Token
symbol={poolInfo?.baseTokenSymbol}
balance={`${poolData?.baseTokenLiquidity}`}
size="mini"
/>
<Token
symbol={poolInfo?.datatokenSymbol}
balance={`${poolData?.datatokenLiquidity}`}
size="mini"
/>
</PoolSection>

<PoolSection className={styles.fees}>
<Token
symbol="% swap fee"
balance={poolInfo?.liquidityProviderSwapFee}
Expand Down
10 changes: 3 additions & 7 deletions src/components/Footer/MarketStats/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import PriceUnit from '@shared/Price/PriceUnit'
import NetworkName from '@shared/NetworkName'
import styles from './Tooltip.module.css'
import { StatsValue } from './_types'
import content from '../../../../content/footer.json'
import Markdown from '@shared/Markdown'

export default function MarketStatsTooltip({
totalValueLockedInOcean,
Expand Down Expand Up @@ -39,13 +41,7 @@ export default function MarketStatsTooltip({
</li>
))}
</ul>
<p className={styles.note}>
Counted on-chain from our NFT and pool factories. Does not filter out
assets in{' '}
<a href="https://github.com/oceanprotocol/list-purgatory">
list-purgatory
</a>
</p>
<Markdown className={styles.note} text={content.stats.note} />
</>
)
}
Loading

0 comments on commit 6dfeead

Please sign in to comment.