diff --git a/README.md b/README.md index 331a58ad4..8010bb868 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ - [🛳 Production](#-production) - [⬆️ Deployment](#️-deployment) - [💖 Contributing](#-contributing) +- [🍴 Forking](#-forking) - [🏛 License](#-license) ## 🏄 Get Started @@ -358,6 +359,18 @@ We welcome contributions in form of bug reports, feature requests, code changes, - [Code of Conduct →](https://docs.oceanprotocol.com/concepts/code-of-conduct/) - [Reporting Vulnerabilities →](https://docs.oceanprotocol.com/concepts/vulnerabilities/) +## 🍴 Forking + +We encourage you to fork this repository and create your own data marketplace. When you publish your forked version of this market there are a few elements that you are required to change for copyright reasons: + +- The typeface is copyright protected and needs to be changed unless you purchase a license for it. +- The Ocean Protocol logo is a trademark of the Ocean Protocol Foundation and must be removed from forked versions of the market. +- The name "Ocean Market" is also copyright protected and should be changed to the name of your market. + +Additionally, we would also advise that your retain the text saying "Powered by Ocean Protocol" on your forked version of the marketplace in order to give credit for the development work done by the Ocean Protocol team. + +Everything else is made open according to the apache2 license. We look forward to seeing your data marketplace! + ## 🏛 License ```text diff --git a/content/pages/publish/form-algorithm.json b/content/pages/publish/form-algorithm.json index 0a91c3b04..d5839527f 100644 --- a/content/pages/publish/form-algorithm.json +++ b/content/pages/publish/form-algorithm.json @@ -28,8 +28,8 @@ "label": "Docker Image", "placeholder": "e.g. python3.7", "help": "Please select an image to run your algorithm.", - "type": "select", - "options": ["node:latest", "python:latest", "custom image"], + "type": "boxSelection", + "options": [], "required": true }, { diff --git a/content/pages/publish/form-dataset.json b/content/pages/publish/form-dataset.json index 3b3a67b58..847ee53ef 100644 --- a/content/pages/publish/form-dataset.json +++ b/content/pages/publish/form-dataset.json @@ -34,7 +34,7 @@ "name": "access", "label": "Access Type", "help": "Choose how you want your files to be accessible for the specified price.", - "type": "select", + "type": "boxSelection", "options": ["Download", "Compute"], "required": true }, diff --git a/package-lock.json b/package-lock.json index 0c85be268..48e50fa5c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18101,7 +18101,7 @@ } }, "ethereumjs-abi": { - "version": "git+https://github.com/ethereumjs/ethereumjs-abi.git#1a27c59c15ab1e95ee8e5c4ed6ad814c49cc439e", + "version": "git+https://github.com/ethereumjs/ethereumjs-abi.git#1ce6a1d64235fabe2aaf827fd606def55693508f", "from": "git+https://github.com/ethereumjs/ethereumjs-abi.git", "requires": { "bn.js": "^4.11.8", diff --git a/src/components/atoms/AddToken.module.css b/src/components/atoms/AddToken.module.css new file mode 100644 index 000000000..a7fcdc78f --- /dev/null +++ b/src/components/atoms/AddToken.module.css @@ -0,0 +1,71 @@ +.button { + display: inline-block; + position: relative; + min-width: auto; +} + +.button:hover, +.button:focus { + transform: none; +} + +.logoWrap { + position: relative; + display: inline-block; + z-index: 1; +} + +.logoWrap::before { + content: '+'; + color: var(--color-secondary); + font-family: var(--font-family-base); + font-weight: var(--font-weight-base); + font-size: 1.25em; + position: absolute; + right: 0.05em; + top: 0.05em; + line-height: 0; +} + +.logo { + width: 1.6em; + height: 1.6em; + display: inline-block; + margin-bottom: -0.35em; + border-radius: 50%; + border: 0.065rem solid var(--color-secondary); + margin-right: calc(var(--spacer) / 10); + transition: 0.2s ease-out; +} + +.button:hover .logo, +.button:focus .logo { + border-color: var(--color-primary); +} + +.button:hover .logoWrap::before, +.button:focus .logoWrap::before { + color: var(--color-primary); +} + +.text { + display: inline-block; + position: relative; +} + +.minimal .text { + opacity: 0; + transform: translate3d(-1rem, 0, 0); + transition: 0.2s ease-out; + z-index: 0; + white-space: pre; + position: absolute; + left: 100%; + top: 0.15rem; +} + +.minimal:hover .text, +.minimal:focus .text { + opacity: 1; + transform: translate3d(0, 0, 0); +} diff --git a/src/components/atoms/AddToken.tsx b/src/components/atoms/AddToken.tsx new file mode 100644 index 000000000..e940a5838 --- /dev/null +++ b/src/components/atoms/AddToken.tsx @@ -0,0 +1,53 @@ +import React, { ReactElement } from 'react' +import classNames from 'classnames/bind' +import { addTokenToWallet } from '../../utils/web3' +import { useWeb3 } from '../../providers/Web3' +import Button from './Button' +import styles from './AddToken.module.css' + +const cx = classNames.bind(styles) + +export default function AddToken({ + address, + symbol, + logo, + text, + className, + minimal +}: { + address: string + symbol: string + logo: string // needs to be a remote image + text?: string + className?: string + minimal?: boolean +}): ReactElement { + const { web3Provider } = useWeb3() + + const styleClasses = cx({ + button: true, + minimal: minimal, + [className]: className + }) + + async function handleAddToken() { + if (!web3Provider) return + + await addTokenToWallet(web3Provider, address, symbol, logo) + } + + return ( + + ) +} diff --git a/src/components/atoms/ExplorerLink.tsx b/src/components/atoms/ExplorerLink.tsx index b1cb4f732..4104e4e86 100644 --- a/src/components/atoms/ExplorerLink.tsx +++ b/src/components/atoms/ExplorerLink.tsx @@ -1,20 +1,30 @@ import React, { ReactElement, ReactNode, useEffect, useState } from 'react' import { ReactComponent as External } from '../../images/external.svg' -import styles from './ExplorerLink.module.css' +import classNames from 'classnames/bind' import { ConfigHelperConfig } from '@oceanprotocol/lib' import { useOcean } from '../../providers/Ocean' +import styles from './ExplorerLink.module.css' + +const cx = classNames.bind(styles) export default function ExplorerLink({ path, - children + children, + className }: { networkId: number path: string children: ReactNode + className?: string }): ReactElement { const { config } = useOcean() const [url, setUrl] = useState() + const styleClasses = cx({ + link: true, + [className]: className + }) + useEffect(() => { setUrl((config as ConfigHelperConfig).explorerUri) }, [config]) @@ -25,7 +35,7 @@ export default function ExplorerLink({ title={`View on ${(config as ConfigHelperConfig).explorerUri}`} target="_blank" rel="noreferrer" - className={styles.link} + className={styleClasses} > {children} diff --git a/src/components/atoms/Input/InputElement.tsx b/src/components/atoms/Input/InputElement.tsx index 89a67a658..8e0e83c8a 100644 --- a/src/components/atoms/Input/InputElement.tsx +++ b/src/components/atoms/Input/InputElement.tsx @@ -4,6 +4,9 @@ import styles from './InputElement.module.css' import { InputProps } from '.' import FilesInput from '../../molecules/FormFields/FilesInput' import Terms from '../../molecules/FormFields/Terms' +import BoxSelection, { + BoxSelectionOption +} from '../../molecules/FormFields/BoxSelection' import Datatoken from '../../molecules/FormFields/Datatoken' import classNames from 'classnames/bind' import AssetSelection, { @@ -91,7 +94,7 @@ export default function InputElement({ id={slugify(option)} type={type} name={name} - checked={props.defaultChecked} + defaultChecked={props.defaultChecked} {...props} />