1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00
This commit is contained in:
Matthias Kretschmann 2021-11-24 13:31:23 +00:00
parent e2b5707859
commit 155d65eb58
Signed by: m
GPG Key ID: 606EEEF3C479A91F
14 changed files with 19 additions and 17 deletions

View File

@ -26,7 +26,8 @@ function encodeSvg(svgString: string): string {
} }
export function generateNftOptions(): NftOptions { export function generateNftOptions(): NftOptions {
// @images/arrow.svg test // TODO: crop image properly in the end as generated SVG waves are a super-wide image,
// and add a filled background deciding on either black or white.
const image = renderStaticWaves() const image = renderStaticWaves()
// const image = new XMLSerializer().serializeToString(waves) // const image = new XMLSerializer().serializeToString(waves)
// const image = `<svg><path d="M0 10.4304L16.3396 10.4304L8.88727 17.6833L10.2401 19L20 9.5L10.2401 0L8.88727 1.31491L16.3396 8.56959L0 8.56959V10.4304Z" /></svg>` // const image = `<svg><path d="M0 10.4304L16.3396 10.4304L8.88727 17.6833L10.2401 19L20 9.5L10.2401 0L8.88727 1.31491L16.3396 8.56959L0 8.56959V10.4304Z" /></svg>`
@ -52,6 +53,7 @@ export function generateNftCreateData(nftOptions: NftOptions): any {
symbol: nftOptions.symbol, symbol: nftOptions.symbol,
templateIndex: 1, templateIndex: 1,
// TODO: figure out if Buffer.from method is working in browser in final build // TODO: figure out if Buffer.from method is working in browser in final build
// as BTOA is deprecated.
tokenURI: window?.btoa(JSON.stringify(nftOptions)) tokenURI: window?.btoa(JSON.stringify(nftOptions))
// tokenURI: Buffer.from(JSON.stringify(nftOptions)).toString('base64') // should end up as data:application/json;base64 // tokenURI: Buffer.from(JSON.stringify(nftOptions)).toString('base64') // should end up as data:application/json;base64
} }

View File

@ -1,5 +1,5 @@
.display { .display {
composes: selection from '@shared/FormFields/AssetSelection.module.css'; composes: selection from '@shared/FormFields/AssetSelection/index.module.css';
} }
.display [class*='loaderWrap'] { .display [class*='loaderWrap'] {
@ -7,14 +7,14 @@
} }
.scroll { .scroll {
composes: scroll from '@shared/FormFields/AssetSelection.module.css'; composes: scroll from '@shared/FormFields/AssetSelection/index.module.css';
margin-top: 0; margin-top: 0;
border-top: none; border-top: none;
width: 100%; width: 100%;
} }
.row { .row {
composes: row from '@shared/FormFields/AssetSelection.module.css'; composes: row from '@shared/FormFields/AssetSelection/index.module.css';
} }
.row:last-child { .row:last-child {
@ -35,7 +35,7 @@
} }
.title { .title {
composes: title from '@shared/FormFields/AssetSelection.module.css'; composes: title from '@shared/FormFields/AssetSelection/index.module.css';
} }
.hover:hover { .hover:hover {
@ -43,7 +43,7 @@
} }
.price { .price {
composes: price from '@shared/FormFields/AssetSelection.module.css'; composes: price from '@shared/FormFields/AssetSelection/index.module.css';
} }
.price [class*='symbol'] { .price [class*='symbol'] {
@ -51,9 +51,9 @@
} }
.did { .did {
composes: did from '@shared/FormFields/AssetSelection.module.css'; composes: did from '@shared/FormFields/AssetSelection/index.module.css';
} }
.empty { .empty {
composes: empty from '@shared/FormFields/AssetSelection.module.css'; composes: empty from '@shared/FormFields/AssetSelection/index.module.css';
} }

View File

@ -1,7 +1,7 @@
import AssetTeaser from '@shared/AssetTeaser/AssetTeaser' import AssetTeaser from '@shared/AssetTeaser/AssetTeaser'
import React, { useEffect, useState } from 'react' import React, { useEffect, useState } from 'react'
import Pagination from '@shared/Pagination' import Pagination from '@shared/Pagination'
import styles from './AssetList.module.css' import styles from './index.module.css'
import classNames from 'classnames/bind' import classNames from 'classnames/bind'
import { getAssetsBestPrices, AssetListPrices } from '@utils/subgraph' import { getAssetsBestPrices, AssetListPrices } from '@utils/subgraph'
import Loader from '@shared/atoms/Loader' import Loader from '@shared/atoms/Loader'

View File

@ -6,7 +6,7 @@ import PriceUnit from '@shared/Price/PriceUnit'
import External from '@images/external.svg' import External from '@images/external.svg'
import InputElement from '@shared/FormInput/InputElement' import InputElement from '@shared/FormInput/InputElement'
import Loader from '@shared/atoms/Loader' import Loader from '@shared/atoms/Loader'
import styles from './AssetSelection.module.css' import styles from './index.module.css'
const cx = classNames.bind(styles) const cx = classNames.bind(styles)

View File

@ -1,8 +1,7 @@
import React, { ChangeEvent } from 'react' import React, { ChangeEvent } from 'react'
import classNames from 'classnames/bind' import classNames from 'classnames/bind'
import Loader from '@shared/atoms/Loader' import Loader from '@shared/atoms/Loader'
import styles from './BoxSelection.module.css' import styles from './index.module.css'
import { useField } from 'formik'
const cx = classNames.bind(styles) const cx = classNames.bind(styles)

View File

@ -1,6 +1,6 @@
import React, { ReactElement, useState } from 'react' import React, { ReactElement, useState } from 'react'
import { useField } from 'formik' import { useField } from 'formik'
import UrlInput from './URLInput' import UrlInput from '../URLInput'
import { useOcean } from '@context/Ocean' import { useOcean } from '@context/Ocean'
import { InputProps } from '@shared/FormInput' import { InputProps } from '@shared/FormInput'

View File

@ -3,7 +3,7 @@ import slugify from 'slugify'
import styles from './InputElement.module.css' import styles from './InputElement.module.css'
import { InputProps } from '.' import { InputProps } from '.'
import FilesInput from '../FormFields/FilesInput' import FilesInput from '../FormFields/FilesInput'
import CustomProvider from '../FormFields/CustomProvider' import CustomProvider from '../FormFields/Provider'
import BoxSelection, { BoxSelectionOption } from '../FormFields/BoxSelection' import BoxSelection, { BoxSelectionOption } from '../FormFields/BoxSelection'
import Datatoken from '../FormFields/Datatoken' import Datatoken from '../FormFields/Datatoken'
import classNames from 'classnames/bind' import classNames from 'classnames/bind'

View File

@ -12,6 +12,7 @@ export interface PersistProps {
isSessionStorage?: boolean isSessionStorage?: boolean
} }
// TODO: refactor into functional component
class PersistImpl extends React.Component< class PersistImpl extends React.Component<
PersistProps & { formik: FormikProps<any> }, PersistProps & { formik: FormikProps<any> },
any any

View File

@ -1,5 +1,5 @@
import React, { ReactElement, useEffect, useState } from 'react' import React, { ReactElement, useEffect, useState } from 'react'
import AssetList from '@shared/AssetList/AssetList' import AssetList from '@shared/AssetList'
import Button from '@shared/atoms/Button' import Button from '@shared/atoms/Button'
import Bookmarks from './Bookmarks' import Bookmarks from './Bookmarks'
import { import {

View File

@ -1,6 +1,6 @@
import { Logger } from '@oceanprotocol/lib' import { Logger } from '@oceanprotocol/lib'
import React, { ReactElement, useEffect, useState, useCallback } from 'react' import React, { ReactElement, useEffect, useState, useCallback } from 'react'
import AssetList from '@shared/AssetList/AssetList' import AssetList from '@shared/AssetList'
import { getPublishedAssets } from '@utils/aquarius' import { getPublishedAssets } from '@utils/aquarius'
import { useSiteMetadata } from '@hooks/useSiteMetadata' import { useSiteMetadata } from '@hooks/useSiteMetadata'
import { useUserPreferences } from '@context/UserPreferences' import { useUserPreferences } from '@context/UserPreferences'

View File

@ -1,5 +1,5 @@
import React, { ReactElement, useState, useEffect, useCallback } from 'react' import React, { ReactElement, useState, useEffect, useCallback } from 'react'
import AssetList from '@shared/AssetList/AssetList' import AssetList from '@shared/AssetList'
import queryString from 'query-string' import queryString from 'query-string'
import Filters from './Filters' import Filters from './Filters'
import Sort from './sort' import Sort from './sort'