diff --git a/app/components/ActiveSubscription/index.tsx b/app/components/ActiveSubscription/index.tsx index 0cd080d..0ffa892 100644 --- a/app/components/ActiveSubscription/index.tsx +++ b/app/components/ActiveSubscription/index.tsx @@ -2,8 +2,6 @@ import React from 'react'; import BigNumber from 'bignumber.js'; import { fromBaseToken } from '~/helpers/formatters'; -import Modal from '../Modal'; -import { PrimaryButton } from '~/components/common/Button'; import EmptyState from '~/components/common/EmptyState'; import { SubscriptionInfoProps } from './types'; import { TOKEN, DEV_SHARE, Subscription } from '~/configs'; @@ -52,25 +50,6 @@ const ActiveSubscription = ({ data }: { data: Subscription | null }) => { return (
- -
-
- Letter icon -
-
-

- Spread the word of Muzikie -
- let others enjoy free music too -

-
- Share link -
-
); }; diff --git a/app/components/CreateAudio/index.tsx b/app/components/CreateAudio/index.tsx index 2616f4b..a172529 100644 --- a/app/components/CreateAudio/index.tsx +++ b/app/components/CreateAudio/index.tsx @@ -12,6 +12,7 @@ import { Link } from '~/components/common/Link'; import Feedback from '~/components/Feedback'; import { ROUTES } from '~/routes/routes'; import { VALID_GENRES } from '~/configs'; +import { getFormErrorMessage } from '~/helpers/helpers'; import { CollectionInfo } from './types'; const CreateAudio = ({ CollectionInfo, creatorAddress }: CollectionInfo) => { @@ -24,7 +25,7 @@ const CreateAudio = ({ CollectionInfo, creatorAddress }: CollectionInfo) => { name: '', releaseYear: '', collectionID: '', - genre: 0, + genre: '', files: null, owners: [{ address: creatorAddress, @@ -48,14 +49,14 @@ const CreateAudio = ({ CollectionInfo, creatorAddress }: CollectionInfo) => { await signAndBroadcast(data); }; - const errorMessage = formState.errors && (Object.values(formState.errors)[0]?.message as string); + const errorMessage = getFormErrorMessage(formState); const formError = errorMessage ? { message: errorMessage, error: true, } : broadcastStatus; - + return (
@@ -63,13 +64,15 @@ const CreateAudio = ({ CollectionInfo, creatorAddress }: CollectionInfo) => { {...register('name', { required: true })} placeholder="Enter name" type="text" + className={formState.errors.name ? 'error' : ''} /> -
+
a.label.localeCompare(b.label))} + className={formState.errors.releaseYear ? 'error' : ''} />
@@ -99,13 +103,13 @@ const CreateAudio = ({ CollectionInfo, creatorAddress }: CollectionInfo) => { fields.map(({ address }, index: number) => (
{ accept=".mp3,.wav" multiple={false} placeholder="Upload MP3" + className={formState.errors.files ? 'error' : ''} />
- + {broadcastStatus.loading ? 'loading...' : 'Create'} diff --git a/app/components/CreateCollection/index.tsx b/app/components/CreateCollection/index.tsx index c352828..2da7e2a 100644 --- a/app/components/CreateCollection/index.tsx +++ b/app/components/CreateCollection/index.tsx @@ -29,7 +29,7 @@ const CreateCollection = () => { const onSubmit = async (data: Record) => { await signAndBroadcast(data); }; - const errorMessage = formState.errors && (Object.values(formState.errors)[0]?.message as string); + const errorMessage = (Object.values(formState.errors)[0]?.message as string); const formError = errorMessage ? { message: errorMessage, @@ -44,16 +44,19 @@ const CreateCollection = () => { {...register('name', { required: true })} placeholder="Enter name" type="text" + className={formState.errors.name ? 'error' : ''} />