diff --git a/content/pages/publish.json b/content/pages/publish.json
index 8cd3fb93d..af3d784a8 100644
--- a/content/pages/publish.json
+++ b/content/pages/publish.json
@@ -11,6 +11,13 @@
"help": "Enter a concise title.",
"required": true
},
+ {
+ "name": "description",
+ "label": "Description",
+ "help": "Add a thorough description with as much detail as possible. You can use [Markdown](https://daringfireball.net/projects/markdown/basics).",
+ "type": "textarea",
+ "required": true
+ },
{
"name": "files",
"label": "Files",
@@ -19,13 +26,6 @@
"type": "files",
"required": true
},
- {
- "name": "description",
- "label": "Description",
- "help": "Add a thorough description with as much detail as possible.",
- "type": "textarea",
- "required": true
- },
{
"name": "access",
"label": "Access Type",
diff --git a/src/components/atoms/File.module.css b/src/components/atoms/File.module.css
index 733b8fd6f..fb9bef081 100644
--- a/src/components/atoms/File.module.css
+++ b/src/components/atoms/File.module.css
@@ -1,4 +1,5 @@
.file {
+ font-size: var(--font-size-small);
background: var(--color-secondary);
background-size: 100%;
padding: var(--spacer) calc(var(--spacer) / 2);
@@ -10,7 +11,6 @@
}
.file li {
- font-size: var(--font-size-small);
color: var(--brand-white);
}
@@ -18,3 +18,9 @@
font-size: var(--font-size-mini);
opacity: 0.75;
}
+
+.file.small {
+ font-size: var(--font-size-mini);
+ height: 5.75rem;
+ width: 4.5rem;
+}
diff --git a/src/components/atoms/File.tsx b/src/components/atoms/File.tsx
index 444059422..65a40893e 100644
--- a/src/components/atoms/File.tsx
+++ b/src/components/atoms/File.tsx
@@ -1,14 +1,31 @@
import React, { ReactElement } from 'react'
import { File as FileMetadata } from '@oceanprotocol/lib/dist/node/ddo/interfaces/File'
import filesize from 'filesize'
+import classNames from 'classnames/bind'
import cleanupContentType from '../../utils/cleanupContentType'
import styles from './File.module.css'
-export default function File({ file }: { file: FileMetadata }): ReactElement {
+const cx = classNames.bind(styles)
+
+export default function File({
+ file,
+ className,
+ small
+}: {
+ file: FileMetadata
+ className?: string
+ small?: boolean
+}): ReactElement {
if (!file) return null
+ const styleClasses = cx({
+ file: true,
+ small: small,
+ [className]: className
+ })
+
return (
-
+
{file.contentType || file.contentLength ? (
<>
- {cleanupContentType(file.contentType)}
diff --git a/src/components/atoms/Input/Help.tsx b/src/components/atoms/Input/Help.tsx
index aefbaca54..99d98ea90 100644
--- a/src/components/atoms/Input/Help.tsx
+++ b/src/components/atoms/Input/Help.tsx
@@ -1,8 +1,9 @@
-import React from 'react'
+import React, { ReactElement } from 'react'
import styles from './Help.module.css'
+import Markdown from '../Markdown'
-const FormHelp = ({ children }: { children: string }) => (
- {children}
+const FormHelp = ({ children }: { children: string }): ReactElement => (
+
)
export default FormHelp
diff --git a/src/components/molecules/FormFields/FilesInput/Info.tsx b/src/components/molecules/FormFields/FilesInput/Info.tsx
index 00dc68427..86fd3b912 100644
--- a/src/components/molecules/FormFields/FilesInput/Info.tsx
+++ b/src/components/molecules/FormFields/FilesInput/Info.tsx
@@ -9,7 +9,7 @@ export default function FileInfo({
removeItem
}: {
file: FileMetadata
- removeItem(): void
+ removeItem?(): void
}): ReactElement {
return (
@@ -19,9 +19,11 @@ export default function FileInfo({
{file.contentLength &&
- {prettySize(+file.contentLength)}
}
{file.contentType && - {cleanupContentType(file.contentType)}
}
-
+ {removeItem && (
+
+ )}
)
}
diff --git a/src/components/pages/Publish/index.module.css b/src/components/pages/Publish/index.module.css
index cec302f54..518794f2b 100644
--- a/src/components/pages/Publish/index.module.css
+++ b/src/components/pages/Publish/index.module.css
@@ -12,6 +12,37 @@
.sticky {
position: sticky;
- top: var(--spacer);
+ top: calc(var(--spacer) / 2);
}
}
+
+.preview {
+ font-size: var(--font-size-small);
+ margin-bottom: var(--spacer);
+}
+
+.preview header {
+ margin-bottom: var(--spacer);
+}
+
+.metaFull {
+ display: grid;
+ gap: var(--spacer);
+ grid-template-columns: 1fr 1fr;
+}
+
+.preview h2 {
+ margin-bottom: calc(var(--spacer) / 2);
+}
+
+.preview h3 {
+ margin-bottom: calc(var(--spacer) / 12);
+}
+
+.preview [class*='MetaItem-module--metaItem'] {
+ margin-bottom: calc(var(--spacer) / 2);
+}
+
+.file {
+ margin-bottom: calc(var(--spacer) / 2);
+}
diff --git a/src/components/pages/Publish/index.tsx b/src/components/pages/Publish/index.tsx
index 4c039b0d8..02a568b8b 100644
--- a/src/components/pages/Publish/index.tsx
+++ b/src/components/pages/Publish/index.tsx
@@ -1,6 +1,7 @@
import React, { ReactElement } from 'react'
import { useNavigate } from '@reach/router'
import PublishForm from './PublishForm'
+import { File as FileMetadata } from '@oceanprotocol/lib/dist/node/ddo/interfaces/File'
import styles from './index.module.css'
import Web3Feedback from '../../molecules/Wallet/Feedback'
import { FormContent } from '../../../@types/Form'
@@ -11,6 +12,11 @@ import { useSiteMetadata } from '../../../hooks/useSiteMetadata'
import { MetadataPublishForm } from '../../../@types/Metadata'
import { transformPublishFormToMetadata } from './utils'
import { toast } from 'react-toastify'
+import Markdown from '../../atoms/Markdown'
+import Tags from '../../atoms/Tags'
+import MetaItem from '../../organisms/AssetContent/MetaItem'
+import FileInfo from '../../molecules/FormFields/FilesInput/Info'
+import File from '../../atoms/File'
export default function PublishPage({
content
@@ -78,10 +84,40 @@ export default function PublishPage({
>