From 7533b80d0f069c7830a6a6af0c64596a6304e392 Mon Sep 17 00:00:00 2001 From: Jose Date: Fri, 30 Apr 2021 18:50:43 -0500 Subject: [PATCH] Metaplex: Feature/m (#103) * unused components * dont count up, display finished label * clean file names (spaces dont work) * hide auction end time when no auction * style artcard countdown --- .../src/components/ArtCard/index.less | 20 ++++++++++++++----- .../src/components/ArtCard/index.tsx | 18 +++++++++-------- packages/metavinci/src/utils/utils.ts | 4 ++++ .../metavinci/src/views/artCreate/index.tsx | 3 ++- 4 files changed, 31 insertions(+), 14 deletions(-) diff --git a/packages/metavinci/src/components/ArtCard/index.less b/packages/metavinci/src/components/ArtCard/index.less index 36e7613..e8c9a97 100644 --- a/packages/metavinci/src/components/ArtCard/index.less +++ b/packages/metavinci/src/components/ArtCard/index.less @@ -10,7 +10,7 @@ display: flex; flex-direction: row; align-items: flex-start; - padding: 24px; + padding: 0; text-align: left; /* gradients/metal */ @@ -27,8 +27,17 @@ font-family: Inter; font-size: 20px; font-weight: 600; + padding: 24px 24px 0 24px; } + .ant-card-meta { + width: 100%; + } + +} + +.ant-avatar.ant-avatar-circle { + margin-left: 24px; } .small { @@ -38,10 +47,11 @@ } .cd-container { - // background: linear-gradient(270deg, #616774 7.29%, #403F4C 100%); - // box-shadow: inset 0px 4px 20px rgba(0, 0, 0, 0.3); - // border-radius: 0px 0px 8px 8px; - margin-top: 10px; + background: linear-gradient(270deg, #616774 7.29%, #403F4C 100%); + box-shadow: inset 0px 4px 20px rgba(0, 0, 0, 0.3); + border-radius: 0px 0px 8px 8px; + margin-top: 20px; + padding: 24px; } .cd-title { diff --git a/packages/metavinci/src/components/ArtCard/index.tsx b/packages/metavinci/src/components/ArtCard/index.tsx index 2afaf1e..618e570 100644 --- a/packages/metavinci/src/components/ArtCard/index.tsx +++ b/packages/metavinci/src/components/ArtCard/index.tsx @@ -66,14 +66,16 @@ export const ArtCard = (props: ArtCardProps) => { title={`${name}`} description={
{artist} -
- {(hours == 0 && minutes == 0 && seconds == 0) ? -
Finished
- : <> -
Ending in
-
{hours}h {minutes}m {seconds}s
- } -
+ {endAuctionAt && +
+ {(hours == 0 && minutes == 0 && seconds == 0) ? +
Finished
+ : <> +
Ending in
+
{hours}h {minutes}m {seconds}s
+ } +
+ }
} /> diff --git a/packages/metavinci/src/utils/utils.ts b/packages/metavinci/src/utils/utils.ts index 388ce5f..ac6044b 100644 --- a/packages/metavinci/src/utils/utils.ts +++ b/packages/metavinci/src/utils/utils.ts @@ -19,3 +19,7 @@ export const getCountdown = (ts: number) => { return { days, hours, minutes, seconds }; }; + +export const cleanName = (name: string): string => { + return name.replaceAll(' ', '-'); +}; diff --git a/packages/metavinci/src/views/artCreate/index.tsx b/packages/metavinci/src/views/artCreate/index.tsx index 3ed13c0..e4fe649 100644 --- a/packages/metavinci/src/views/artCreate/index.tsx +++ b/packages/metavinci/src/views/artCreate/index.tsx @@ -36,6 +36,7 @@ import { import { Connection, PublicKey } from '@solana/web3.js'; import { MintLayout } from '@solana/spl-token'; import { useHistory, useParams } from 'react-router-dom'; +import { cleanName } from '../../utils/utils'; const { Step } = Steps; const { Option } = Select; @@ -344,7 +345,7 @@ const UploadStep = (props: { onClick={() => { props.setAttributes({ ...props.attributes, - files: [mainFile, coverFile].filter(f => f), + files: [mainFile, coverFile].filter(f => f).map(f => new File([f], cleanName(f.name), { type: f.type })), image, }); props.confirm();