From fdec20798e1cbfc925d7c9a38c04d2fd6b654242 Mon Sep 17 00:00:00 2001 From: Serkan Reis Date: Wed, 2 Nov 2022 10:53:17 +0300 Subject: [PATCH] Remove maxWidth for error messages --- components/AirdropUpload.tsx | 2 +- components/collections/creation/CollectionDetails.tsx | 2 +- components/collections/creation/UploadDetails.tsx | 2 +- components/collections/queries/Queries.tsx | 2 +- contexts/wallet.tsx | 4 ++-- pages/collections/create.tsx | 6 +++--- pages/collections/queries.tsx | 2 +- pages/contracts/minter/execute.tsx | 2 +- pages/contracts/minter/instantiate.tsx | 2 +- pages/contracts/minter/query.tsx | 2 +- pages/contracts/sg721/execute.tsx | 2 +- pages/contracts/sg721/query.tsx | 2 +- pages/contracts/whitelist/execute.tsx | 2 +- pages/contracts/whitelist/instantiate.tsx | 2 +- pages/contracts/whitelist/query.tsx | 2 +- utils/clipboard.ts | 2 +- 16 files changed, 19 insertions(+), 19 deletions(-) diff --git a/components/AirdropUpload.tsx b/components/AirdropUpload.tsx index 06f2a34..336d411 100644 --- a/components/AirdropUpload.tsx +++ b/components/AirdropUpload.tsx @@ -29,7 +29,7 @@ export const AirdropUpload = ({ onChange }: AirdropUploadProps) => { } return onChange(accountsData) } catch (error: any) { - toast.error(error.message) + toast.error(error.message, { style: { maxWidth: 'none' } }) } } reader.readAsText(event.target.files[0]) diff --git a/components/collections/creation/CollectionDetails.tsx b/components/collections/creation/CollectionDetails.tsx index cf0caf2..a5fd1f6 100644 --- a/components/collections/creation/CollectionDetails.tsx +++ b/components/collections/creation/CollectionDetails.tsx @@ -78,7 +78,7 @@ export const CollectionDetails = ({ onChange, uploadMethod, coverImageUrl }: Col onChange(data) // eslint-disable-next-line @typescript-eslint/no-explicit-any } catch (error: any) { - toast.error(error.message) + toast.error(error.message, { style: { maxWidth: 'none' } }) } // eslint-disable-next-line react-hooks/exhaustive-deps }, [ diff --git a/components/collections/creation/UploadDetails.tsx b/components/collections/creation/UploadDetails.tsx index c6515b1..d8425e4 100644 --- a/components/collections/creation/UploadDetails.tsx +++ b/components/collections/creation/UploadDetails.tsx @@ -183,7 +183,7 @@ export const UploadDetails = ({ onChange }: UploadDetailsProps) => { } onChange(data) } catch (error: any) { - toast.error(error.message) + toast.error(error.message, { style: { maxWidth: 'none' } }) } }, [ assetFilesArray, diff --git a/components/collections/queries/Queries.tsx b/components/collections/queries/Queries.tsx index d5f6e5b..e9138e3 100644 --- a/components/collections/queries/Queries.tsx +++ b/components/collections/queries/Queries.tsx @@ -61,7 +61,7 @@ export const CollectionQueries = ({ { placeholderData: null, onError: (error: any) => { - toast.error(error.message) + toast.error(error.message, { style: { maxWidth: 'none' } }) }, enabled: Boolean(sg721ContractAddress && minterContractAddress && type), retry: false, diff --git a/contexts/wallet.tsx b/contexts/wallet.tsx index e97f9fe..641765d 100644 --- a/contexts/wallet.tsx +++ b/contexts/wallet.tsx @@ -83,7 +83,7 @@ export const useWalletStore = create( init(signer) if (walletChange) set({ initializing: false }) } catch (err: any) { - toast.error(err?.message) + toast.error(err?.message, { style: { maxWidth: 'none' } }) set({ initializing: false }) } }, @@ -113,7 +113,7 @@ export const useWalletStore = create( const client = (await createQueryClient()) as SigningCosmWasmClient set({ client }) } catch (err: any) { - toast.error(err?.message) + toast.error(err?.message, { style: { maxWidth: 'none' } }) set({ initializing: false }) } }, diff --git a/pages/collections/create.tsx b/pages/collections/create.tsx index 643b6ed..3b710e1 100644 --- a/pages/collections/create.tsx +++ b/pages/collections/create.tsx @@ -88,11 +88,11 @@ const CollectionCreationPage: NextPage = () => { setReadyToCreate(true) }) .catch((err) => { - toast.error(`Error in Whitelist Configuration: ${err.message}`) + toast.error(`Error in Whitelist Configuration: ${err.message}`, { style: { maxWidth: 'none' } }) setReadyToCreate(false) }) } catch (error: any) { - toast.error(error.message) + toast.error(error.message, { style: { maxWidth: 'none' } }) setUploading(false) } } @@ -145,7 +145,7 @@ const CollectionCreationPage: NextPage = () => { setCreatingCollection(false) // eslint-disable-next-line @typescript-eslint/no-explicit-any } catch (error: any) { - toast.error(error.message) + toast.error(error.message, { style: { maxWidth: 'none' } }) setCreatingCollection(false) setUploading(false) } diff --git a/pages/collections/queries.tsx b/pages/collections/queries.tsx index 39be983..ea9f5b0 100644 --- a/pages/collections/queries.tsx +++ b/pages/collections/queries.tsx @@ -79,7 +79,7 @@ const CollectionQueriesPage: NextPage = () => { { placeholderData: null, onError: (error: any) => { - toast.error(error.message) + toast.error(error.message, { style: { maxWidth: 'none' } }) }, enabled: Boolean(sg721ContractAddress && minterContractAddress && type), retry: false, diff --git a/pages/contracts/minter/execute.tsx b/pages/contracts/minter/execute.tsx index f2dce66..1cca98f 100644 --- a/pages/contracts/minter/execute.tsx +++ b/pages/contracts/minter/execute.tsx @@ -119,7 +119,7 @@ const MinterExecutePage: NextPage = () => { }, { onError: (error) => { - toast.error(String(error)) + toast.error(String(error), { style: { maxWidth: 'none' } }) }, }, ) diff --git a/pages/contracts/minter/instantiate.tsx b/pages/contracts/minter/instantiate.tsx index c5a675d..56d6b16 100644 --- a/pages/contracts/minter/instantiate.tsx +++ b/pages/contracts/minter/instantiate.tsx @@ -216,7 +216,7 @@ const MinterInstantiatePage: NextPage = () => { }, { onError: (error) => { - toast.error(String(error)) + toast.error(String(error), { style: { maxWidth: 'none' } }) }, }, ) diff --git a/pages/contracts/minter/query.tsx b/pages/contracts/minter/query.tsx index b347148..4f57350 100644 --- a/pages/contracts/minter/query.tsx +++ b/pages/contracts/minter/query.tsx @@ -57,7 +57,7 @@ const MinterQueryPage: NextPage = () => { { placeholderData: null, onError: (error: any) => { - toast.error(error.message) + toast.error(error.message, { style: { maxWidth: 'none' } }) }, enabled: Boolean(contractAddress && contract && wallet), }, diff --git a/pages/contracts/sg721/execute.tsx b/pages/contracts/sg721/execute.tsx index 6477532..b5b4569 100644 --- a/pages/contracts/sg721/execute.tsx +++ b/pages/contracts/sg721/execute.tsx @@ -119,7 +119,7 @@ const Sg721ExecutePage: NextPage = () => { }, { onError: (error) => { - toast.error(String(error)) + toast.error(String(error), { style: { maxWidth: 'none' } }) }, }, ) diff --git a/pages/contracts/sg721/query.tsx b/pages/contracts/sg721/query.tsx index 22c93d0..672aab8 100644 --- a/pages/contracts/sg721/query.tsx +++ b/pages/contracts/sg721/query.tsx @@ -69,7 +69,7 @@ const Sg721QueryPage: NextPage = () => { { placeholderData: null, onError: (error: any) => { - toast.error(error.message) + toast.error(error.message, { style: { maxWidth: 'none' } }) }, enabled: Boolean(contractAddress && contract && wallet), }, diff --git a/pages/contracts/whitelist/execute.tsx b/pages/contracts/whitelist/execute.tsx index d1d8476..7e1b3ed 100644 --- a/pages/contracts/whitelist/execute.tsx +++ b/pages/contracts/whitelist/execute.tsx @@ -90,7 +90,7 @@ const WhitelistExecutePage: NextPage = () => { }, { onError: (error) => { - toast.error(String(error)) + toast.error(String(error), { style: { maxWidth: 'none' } }) }, }, ) diff --git a/pages/contracts/whitelist/instantiate.tsx b/pages/contracts/whitelist/instantiate.tsx index 440f1d4..3e237eb 100644 --- a/pages/contracts/whitelist/instantiate.tsx +++ b/pages/contracts/whitelist/instantiate.tsx @@ -91,7 +91,7 @@ const Sg721InstantiatePage: NextPage = () => { }, { onError: (error) => { - toast.error(String(error)) + toast.error(String(error), { style: { maxWidth: 'none' } }) }, }, ) diff --git a/pages/contracts/whitelist/query.tsx b/pages/contracts/whitelist/query.tsx index c4afc55..f1be51a 100644 --- a/pages/contracts/whitelist/query.tsx +++ b/pages/contracts/whitelist/query.tsx @@ -59,7 +59,7 @@ const WhitelistQueryPage: NextPage = () => { { placeholderData: null, onError: (error: any) => { - toast.error(error.message) + toast.error(error.message, { style: { maxWidth: 'none' } }) }, enabled: Boolean(contractAddress && contract && wallet), }, diff --git a/utils/clipboard.ts b/utils/clipboard.ts index b9688b4..d5487b1 100644 --- a/utils/clipboard.ts +++ b/utils/clipboard.ts @@ -6,6 +6,6 @@ export async function copy(text: string, message: Renderable = 'Copied to clipbo await navigator.clipboard.writeText(text) return toast.success(message) } catch (err: unknown) { - return toast.error(String(err)) + return toast.error(String(err), { style: { maxWidth: 'none' } }) } }