diff --git a/packages/components/FilePreview/SelectedFilesPreview/ItemView.tsx b/packages/components/FilePreview/SelectedFilesPreview/ItemView.tsx index 57ba7f483b..28f7d08ff7 100644 --- a/packages/components/FilePreview/SelectedFilesPreview/ItemView.tsx +++ b/packages/components/FilePreview/SelectedFilesPreview/ItemView.tsx @@ -1,12 +1,13 @@ -import React, { FC } from "react"; +import { FC } from "react"; import { TouchableOpacity, Image, StyleProp, ViewStyle } from "react-native"; -import { neutral77, secondaryColor } from "../../../utils/style/colors"; -import { fontSemibold11, fontSemibold13 } from "../../../utils/style/fonts"; -import { layout } from "../../../utils/style/layout"; import { BrandText } from "../../BrandText"; import { PrimaryBox } from "../../boxes/PrimaryBox"; +import { neutral77, secondaryColor } from "@/utils/style/colors"; +import { fontSemibold11, fontSemibold13 } from "@/utils/style/fonts"; +import { layout } from "@/utils/style/layout"; + export const itemSize = 120; export const ItemView: FC<{ label: string; @@ -47,10 +48,8 @@ export const ItemView: FC<{ void; onPressDeleteItem: (itemIndex: number) => void; diff --git a/packages/components/NetworkSelector/NetworkSelectorWithLabel.tsx b/packages/components/NetworkSelector/NetworkSelectorWithLabel.tsx index 0cef927569..804cbfb1ab 100644 --- a/packages/components/NetworkSelector/NetworkSelectorWithLabel.tsx +++ b/packages/components/NetworkSelector/NetworkSelectorWithLabel.tsx @@ -1,25 +1,25 @@ -import React, { useState } from "react"; +import { FC, useState } from "react"; import { StyleProp, View, ViewStyle } from "react-native"; import { NetworkSelectorMenu } from "./NetworkSelectorMenu"; -import chevronDownSVG from "../../../assets/icons/chevron-down.svg"; -import chevronUpSVG from "../../../assets/icons/chevron-up.svg"; -import { useDropdowns } from "../../hooks/useDropdowns"; -import { useSelectedNetworkInfo } from "../../hooks/useSelectedNetwork"; -import { NetworkFeature, NetworkKind } from "../../networks"; -import { neutral17, neutral77, secondaryColor } from "../../utils/style/colors"; -import { fontSemibold14 } from "../../utils/style/fonts"; -import { layout } from "../../utils/style/layout"; import { BrandText } from "../BrandText"; import { SVG } from "../SVG"; import { TertiaryBox } from "../boxes/TertiaryBox"; import { Label } from "../inputs/TextInputCustom"; +import chevronDownSVG from "@/assets/icons/chevron-down.svg"; +import chevronUpSVG from "@/assets/icons/chevron-up.svg"; import { NetworkIcon } from "@/components/NetworkIcon"; import { CustomPressable } from "@/components/buttons/CustomPressable"; import { SpacerRow } from "@/components/spacer"; +import { useDropdowns } from "@/hooks/useDropdowns"; +import { useSelectedNetworkInfo } from "@/hooks/useSelectedNetwork"; +import { NetworkFeature, NetworkKind } from "@/networks"; +import { neutral17, neutral77, secondaryColor } from "@/utils/style/colors"; +import { fontSemibold14 } from "@/utils/style/fonts"; +import { layout } from "@/utils/style/layout"; -export const NetworkSelectorWithLabel: React.FC<{ +export const NetworkSelectorWithLabel: FC<{ label: string; style?: StyleProp; forceNetworkId?: string; diff --git a/packages/screens/Launchpad/LaunchpadApply/LaunchpadApplyScreen.tsx b/packages/screens/Launchpad/LaunchpadApply/LaunchpadApplyScreen.tsx index af90ec420e..8850c64571 100644 --- a/packages/screens/Launchpad/LaunchpadApply/LaunchpadApplyScreen.tsx +++ b/packages/screens/Launchpad/LaunchpadApply/LaunchpadApplyScreen.tsx @@ -1,17 +1,15 @@ -import React from "react"; import { Linking, TextStyle, View } from "react-native"; -import { - LargeBoxButton, - LargeBoxButtonProps, -} from "../../../components/buttons/LargeBoxButton"; - import LaunchpadBannerImage from "@/assets/banners/launchpad.jpg"; import { BrandText } from "@/components/BrandText"; import { ImageBackgroundLogoText } from "@/components/ImageBackgroundLogoText"; import { OmniLink } from "@/components/OmniLink"; import { ScreenContainer } from "@/components/ScreenContainer"; import { CustomPressable } from "@/components/buttons/CustomPressable"; +import { + LargeBoxButton, + LargeBoxButtonProps, +} from "@/components/buttons/LargeBoxButton"; import { SpacerColumn } from "@/components/spacer"; import { useMaxResolution } from "@/hooks/useMaxResolution"; import { ScreenFC } from "@/utils/navigation"; diff --git a/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/LaunchpadCreateScreen.tsx b/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/LaunchpadCreateScreen.tsx index d796752076..abc4788118 100644 --- a/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/LaunchpadCreateScreen.tsx +++ b/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/LaunchpadCreateScreen.tsx @@ -1,5 +1,5 @@ import { zodResolver } from "@hookform/resolvers/zod"; -import React, { useMemo, useState } from "react"; +import { useMemo, useState } from "react"; import { FormProvider, useForm } from "react-hook-form"; import { View } from "react-native"; import { useSelector } from "react-redux"; @@ -80,9 +80,6 @@ export const LaunchpadCreateScreen: ScreenFC<"LaunchpadCreate"> = () => { }, [selectedStepKey]); const onValid = async () => { - // TODO: Remove console.log when ready to merge - console.log("==== collectionForm.getValues()", collectionForm.getValues()); - setLoading(true); setLoadingFullScreen(true); try { @@ -100,10 +97,6 @@ export const LaunchpadCreateScreen: ScreenFC<"LaunchpadCreate"> = () => { }; const onInvalid = () => { - // TODO: Remove console.log when ready to merge - console.log("==== collectionForm.getValues()", collectionForm.getValues()); - console.log("xxxxx collectionForm.formState", collectionForm.formState); - setToast({ mode: "normal", type: "error", @@ -174,12 +167,7 @@ export const LaunchpadCreateScreen: ScreenFC<"LaunchpadCreate"> = () => { text="Submit Collection" loader isLoading={isLoading} - disabled={ - isLoading || - // TODO: Remove this condition when useCompleteCollection and MyCollections frontend are merged - !collectionForm.getValues().assetsMetadatas?.assetsMetadatas - ?.length - } + disabled={isLoading} onPress={onPressSubmit} /> ) : ( diff --git a/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/LaunchpadStepper.tsx b/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/LaunchpadStepper.tsx index 5b3e31d907..4a0cc1ddf3 100644 --- a/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/LaunchpadStepper.tsx +++ b/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/LaunchpadStepper.tsx @@ -1,4 +1,4 @@ -import React, { Dispatch, FC, useRef } from "react"; +import { Dispatch, FC, SetStateAction, useRef } from "react"; import { useFormContext } from "react-hook-form"; import { LayoutChangeEvent, @@ -28,7 +28,7 @@ export type LaunchpadCreateStepKey = number; interface LaunchpadStepperProps { selectedStepKey: LaunchpadCreateStepKey; - setSelectedStepKey: Dispatch>; + setSelectedStepKey: Dispatch>; } interface LaunchpadCreateStep { @@ -175,15 +175,13 @@ export const LaunchpadStepper: FC = ({ if (isSelected) onSelectedItemLayout(e); }} onPress={() => setSelectedStepKey(step.key)} - style={[ - { - flexDirection: "row", - alignItems: "center", - justifyContent: "center", - paddingHorizontal: layout.spacing_x2, - paddingVertical: layout.spacing_x1, - }, - ]} + style={{ + flexDirection: "row", + alignItems: "center", + justifyContent: "center", + paddingHorizontal: layout.spacing_x2, + paddingVertical: layout.spacing_x1, + }} > void; isVisible: boolean; elem: CollectionAssetsMetadataFormValues; diff --git a/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/steps/LaunchpadAssetsAndMetadata/AssetsTab.tsx b/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/steps/LaunchpadAssetsAndMetadata/AssetsTab.tsx index 71bf37765d..b21d850c55 100644 --- a/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/steps/LaunchpadAssetsAndMetadata/AssetsTab.tsx +++ b/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/steps/LaunchpadAssetsAndMetadata/AssetsTab.tsx @@ -1,6 +1,6 @@ import { parse } from "papaparse"; import pluralize from "pluralize"; -import React, { FC, useEffect, useRef, useState } from "react"; +import { FC, useEffect, useRef, useState } from "react"; import { useFieldArray, useFormContext } from "react-hook-form"; import { SafeAreaView, TouchableOpacity, View } from "react-native"; @@ -136,13 +136,13 @@ export const AssetsTab: React.FC = () => { }, [fields.length]); // On upload attributes CSV mapping file - const onUploadAttributesMapingFile = async (files: LocalFileData[]) => { + const onUploadAttributesMapingFile = (files: LocalFileData[]) => { resetAllIssues(); setAssetsMappingDataRows([]); assetsMetadatasForm.setValue("assetsMetadatas", []); try { - await parse(files[0].file, { + parse(files[0].file, { complete: (parseResults) => { const attributesDataRows = parseResults.data; @@ -176,7 +176,7 @@ export const AssetsTab: React.FC = () => { const wrongIdRows: string[][] = []; const rowsIndexesToRemove: number[] = []; - // Controling attributes + // Controlling attributes cleanDataRows(attributesDataRows).forEach((dataRow, dataRowIndex) => { const hasNoId = !dataRow[idColIndex]?.trim(); const hasNoValue = !dataRow[valueColIndex]?.trim(); @@ -329,7 +329,7 @@ export const AssetsTab: React.FC = () => { const wrongUrlsRowsInAssets: string[][] = []; const rowsIndexesToRemove: number[] = []; - // Controling assets and attributes + // Controlling assets and attributes cleanDataRows(assetsDataRows).forEach( (assetDataRow, assetDataRowIndex) => { const hasNoName = !assetDataRow[nameColIndex]?.trim(); diff --git a/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/steps/LaunchpadAssetsAndMetadata/LaunchpadAssetsAndMetadata.tsx b/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/steps/LaunchpadAssetsAndMetadata/LaunchpadAssetsAndMetadata.tsx index f3fa04d8b0..bb176fbb8d 100644 --- a/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/steps/LaunchpadAssetsAndMetadata/LaunchpadAssetsAndMetadata.tsx +++ b/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/steps/LaunchpadAssetsAndMetadata/LaunchpadAssetsAndMetadata.tsx @@ -1,5 +1,5 @@ import { zodResolver } from "@hookform/resolvers/zod"; -import React, { FC, useEffect, useState } from "react"; +import { FC, useEffect, useState } from "react"; import { FormProvider, useForm, useFormContext } from "react-hook-form"; import { View } from "react-native"; @@ -36,7 +36,7 @@ export const LaunchpadAssetsAndMetadata: FC = () => { const collectionAssetsMetadatas = watch("assetsMetadatas"); const assetsMetadatasForm = useForm({ mode: "all", - defaultValues: collectionAssetsMetadatas, // Retreive assetsMetadatas from collectionForm + defaultValues: collectionAssetsMetadatas, // Retrieve assetsMetadatas from collectionForm resolver: zodResolver(ZodCollectionAssetsMetadatasFormValues), }); const assetsMetadatas = assetsMetadatasForm.watch("assetsMetadatas"); diff --git a/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/steps/LaunchpadAssetsAndMetadata/UriTab.tsx b/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/steps/LaunchpadAssetsAndMetadata/UriTab.tsx index ac97003a46..c7af4a0d00 100644 --- a/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/steps/LaunchpadAssetsAndMetadata/UriTab.tsx +++ b/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/steps/LaunchpadAssetsAndMetadata/UriTab.tsx @@ -1,4 +1,4 @@ -import React from "react"; +import { FC } from "react"; import { useFormContext } from "react-hook-form"; import { View } from "react-native"; @@ -10,7 +10,7 @@ import { fontSemibold14 } from "@/utils/style/fonts"; import { layout } from "@/utils/style/layout"; import { CollectionFormValues } from "@/utils/types/launchpad"; -export const UriTab: React.FC = () => { +export const UriTab: FC = () => { const collectionForm = useFormContext(); return ( diff --git a/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/steps/LaunchpadBasic.tsx b/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/steps/LaunchpadBasic.tsx index 77f928d6d3..2461810e18 100644 --- a/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/steps/LaunchpadBasic.tsx +++ b/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/steps/LaunchpadBasic.tsx @@ -1,4 +1,4 @@ -import React, { FC } from "react"; +import { FC } from "react"; import { Controller, useFormContext } from "react-hook-form"; import { View } from "react-native"; diff --git a/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/steps/LaunchpadDetails.tsx b/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/steps/LaunchpadDetails.tsx index 8254ef351e..46fadde159 100644 --- a/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/steps/LaunchpadDetails.tsx +++ b/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/steps/LaunchpadDetails.tsx @@ -1,4 +1,4 @@ -import React, { FC } from "react"; +import { FC } from "react"; import { Controller, useFormContext } from "react-hook-form"; import { View } from "react-native"; diff --git a/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/steps/LaunchpadMinting/ConfigureRoyaltyDetails.tsx b/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/steps/LaunchpadMinting/ConfigureRoyaltyDetails.tsx index 55c28bf557..2ce7561d20 100644 --- a/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/steps/LaunchpadMinting/ConfigureRoyaltyDetails.tsx +++ b/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/steps/LaunchpadMinting/ConfigureRoyaltyDetails.tsx @@ -1,4 +1,4 @@ -import React from "react"; +import { FC } from "react"; import { useFormContext } from "react-hook-form"; import { View } from "react-native"; @@ -13,7 +13,7 @@ import { } from "@/utils/style/fonts"; import { CollectionFormValues } from "@/utils/types/launchpad"; -export const ConfigureRoyaltyDetails: React.FC = () => { +export const ConfigureRoyaltyDetails: FC = () => { const collectionForm = useFormContext(); return ( diff --git a/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/steps/LaunchpadMinting/LaunchpadMintPeriodAccordion.tsx b/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/steps/LaunchpadMinting/LaunchpadMintPeriodAccordion.tsx index 331f5bd336..43c6f9736b 100644 --- a/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/steps/LaunchpadMinting/LaunchpadMintPeriodAccordion.tsx +++ b/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/steps/LaunchpadMinting/LaunchpadMintPeriodAccordion.tsx @@ -1,4 +1,4 @@ -import React, { FC } from "react"; +import { FC } from "react"; import { UseFieldArrayRemove, UseFieldArrayUpdate } from "react-hook-form"; import { LaunchpadMintPeriodAccordionBottom } from "./LaunchpadMintPeriodAccordionBottom"; diff --git a/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/steps/LaunchpadMinting/LaunchpadMintPeriodAccordionBottom.tsx b/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/steps/LaunchpadMinting/LaunchpadMintPeriodAccordionBottom.tsx index 3496fd0394..352429ce67 100644 --- a/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/steps/LaunchpadMinting/LaunchpadMintPeriodAccordionBottom.tsx +++ b/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/steps/LaunchpadMinting/LaunchpadMintPeriodAccordionBottom.tsx @@ -1,4 +1,4 @@ -import React, { FC } from "react"; +import { FC } from "react"; import { Controller, UseFieldArrayRemove, @@ -55,7 +55,7 @@ export const LaunchpadMintPeriodAccordionBottom: FC<{ return ( - + Remove Mint Period diff --git a/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/steps/LaunchpadMinting/LaunchpadMintPeriodAccordionTop.tsx b/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/steps/LaunchpadMinting/LaunchpadMintPeriodAccordionTop.tsx index 91ef8392c1..e0ec55e36e 100644 --- a/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/steps/LaunchpadMinting/LaunchpadMintPeriodAccordionTop.tsx +++ b/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/steps/LaunchpadMinting/LaunchpadMintPeriodAccordionTop.tsx @@ -1,4 +1,4 @@ -import React, { FC } from "react"; +import { FC } from "react"; import { UseFieldArrayUpdate } from "react-hook-form"; import { TouchableOpacity, View } from "react-native"; diff --git a/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/steps/LaunchpadMinting/LaunchpadMintPeriods.tsx b/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/steps/LaunchpadMinting/LaunchpadMintPeriods.tsx index e3637f0272..7879fa7d15 100644 --- a/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/steps/LaunchpadMinting/LaunchpadMintPeriods.tsx +++ b/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/steps/LaunchpadMinting/LaunchpadMintPeriods.tsx @@ -1,4 +1,4 @@ -import React, { FC, Fragment, useCallback } from "react"; +import { FC, Fragment, useCallback } from "react"; import { useFieldArray, useFormContext } from "react-hook-form"; import { TouchableOpacity, View } from "react-native"; diff --git a/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/steps/LaunchpadMinting/LaunchpadMinting.tsx b/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/steps/LaunchpadMinting/LaunchpadMinting.tsx index 3b8220c2bf..048c004a3b 100644 --- a/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/steps/LaunchpadMinting/LaunchpadMinting.tsx +++ b/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/steps/LaunchpadMinting/LaunchpadMinting.tsx @@ -1,4 +1,4 @@ -import React, { FC } from "react"; +import { FC } from "react"; import { Controller, useFormContext } from "react-hook-form"; import { View } from "react-native"; diff --git a/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/steps/LaunchpadTeamAndInvestment.tsx b/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/steps/LaunchpadTeamAndInvestment.tsx index 229f8301d0..61458ad3ea 100644 --- a/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/steps/LaunchpadTeamAndInvestment.tsx +++ b/packages/screens/Launchpad/LaunchpadApply/LaunchpadCreate/components/steps/LaunchpadTeamAndInvestment.tsx @@ -1,4 +1,4 @@ -import React, { FC } from "react"; +import { FC } from "react"; import { useFormContext } from "react-hook-form"; import { View } from "react-native"; @@ -53,21 +53,6 @@ export const LaunchpadTeamAndInvestment: FC = () => { form={collectionForm} /> - {/**/} - {/* label="Team links and attachments "*/} - {/* sublabel={*/} - {/* */} - {/* */} - {/* Please provide any relevant links regarding your team. You can*/} - {/* also post a google drive link.*/} - {/* */} - {/* */} - {/* }*/} - {/* placeHolder="Type here..."*/} - {/* name="teamLink"*/} - {/* form={collectionForm}*/} - {/*/>*/} - label="Do you have any partners on the project? " sublabel={ @@ -119,21 +104,6 @@ export const LaunchpadTeamAndInvestment: FC = () => { name="investLink" form={collectionForm} /> - - {/**/} - {/* label="Whitepaper and roadmap: "*/} - {/* sublabel={*/} - {/* */} - {/* */} - {/* Please provide any relevant link regarding your white paper and*/} - {/* roadmap. You can also post a google drive link.*/} - {/* */} - {/* */} - {/* }*/} - {/* placeHolder="Type here..."*/} - {/* name="roadmapLink"*/} - {/* form={collectionForm}*/} - {/*/>*/} ); diff --git a/packages/screens/Launchpad/LaunchpadApply/components/inputs/CurrencyInputLaunchpad/CurrencyInputLaunchpad.tsx b/packages/screens/Launchpad/LaunchpadApply/components/inputs/CurrencyInputLaunchpad/CurrencyInputLaunchpad.tsx index 91e2059e9f..c5e9a406ed 100644 --- a/packages/screens/Launchpad/LaunchpadApply/components/inputs/CurrencyInputLaunchpad/CurrencyInputLaunchpad.tsx +++ b/packages/screens/Launchpad/LaunchpadApply/components/inputs/CurrencyInputLaunchpad/CurrencyInputLaunchpad.tsx @@ -1,5 +1,5 @@ import { Decimal } from "@cosmjs/math"; -import React, { FC, Fragment, useRef, useState } from "react"; +import { FC, Fragment, ReactElement, useRef, useState } from "react"; import { StyleProp, TextInput, View } from "react-native"; import { BrandText } from "@/components/BrandText"; @@ -32,8 +32,8 @@ import { layout } from "@/utils/style/layout"; export const CurrencyInputLaunchpad: FC<{ label?: string; placeHolder?: string; - subtitle?: React.ReactElement; - sublabel?: React.ReactElement; + subtitle?: ReactElement; + sublabel?: ReactElement; required?: boolean; error?: string; networkId: string; diff --git a/packages/screens/Launchpad/LaunchpadApply/components/inputs/CurrencyInputLaunchpad/SelectableCurrencySmall.tsx b/packages/screens/Launchpad/LaunchpadApply/components/inputs/CurrencyInputLaunchpad/SelectableCurrencySmall.tsx index 95afecc580..fecac28491 100644 --- a/packages/screens/Launchpad/LaunchpadApply/components/inputs/CurrencyInputLaunchpad/SelectableCurrencySmall.tsx +++ b/packages/screens/Launchpad/LaunchpadApply/components/inputs/CurrencyInputLaunchpad/SelectableCurrencySmall.tsx @@ -1,4 +1,4 @@ -import React from "react"; +import { FC } from "react"; import { TouchableOpacity, View } from "react-native"; import { BrandText } from "@/components/BrandText"; @@ -7,7 +7,7 @@ import { CurrencyInfo, getNativeCurrency } from "@/networks"; import { fontSemibold14 } from "@/utils/style/fonts"; import { layout } from "@/utils/style/layout"; -export const SelectableCurrencySmall: React.FC<{ +export const SelectableCurrencySmall: FC<{ onPressItem: () => void; currency: CurrencyInfo; networkId: string; diff --git a/packages/screens/Launchpad/LaunchpadApply/components/inputs/CurrencyInputLaunchpad/SelectedCurrencySmall.tsx b/packages/screens/Launchpad/LaunchpadApply/components/inputs/CurrencyInputLaunchpad/SelectedCurrencySmall.tsx index 0aaedf28a4..0d655e1dbb 100644 --- a/packages/screens/Launchpad/LaunchpadApply/components/inputs/CurrencyInputLaunchpad/SelectedCurrencySmall.tsx +++ b/packages/screens/Launchpad/LaunchpadApply/components/inputs/CurrencyInputLaunchpad/SelectedCurrencySmall.tsx @@ -1,4 +1,4 @@ -import React, { forwardRef } from "react"; +import { forwardRef } from "react"; import { TouchableOpacity, View } from "react-native"; import chevronDownSVG from "@/assets/icons/chevron-down.svg"; diff --git a/packages/screens/Launchpad/LaunchpadApply/components/inputs/TextInputLaunchpad.tsx b/packages/screens/Launchpad/LaunchpadApply/components/inputs/TextInputLaunchpad.tsx index f4b0c5245c..2a15418c34 100644 --- a/packages/screens/Launchpad/LaunchpadApply/components/inputs/TextInputLaunchpad.tsx +++ b/packages/screens/Launchpad/LaunchpadApply/components/inputs/TextInputLaunchpad.tsx @@ -1,4 +1,4 @@ -import React, { useRef, useState } from "react"; +import { ReactElement, useRef, useState } from "react"; import { FieldValues, Path, @@ -22,7 +22,7 @@ interface TextInputLaunchpadProps placeHolder: string; form: UseFormReturn; name: Path; - sublabel?: React.ReactElement; + sublabel?: ReactElement; valueModifier?: (value: string) => string; required?: boolean; disabled?: boolean; diff --git a/packages/screens/Launchpad/LaunchpadApply/components/inputs/selectInputs/MultipleSelectInput.tsx b/packages/screens/Launchpad/LaunchpadApply/components/inputs/selectInputs/MultipleSelectInput.tsx index 96df99b239..7059171bb3 100644 --- a/packages/screens/Launchpad/LaunchpadApply/components/inputs/selectInputs/MultipleSelectInput.tsx +++ b/packages/screens/Launchpad/LaunchpadApply/components/inputs/selectInputs/MultipleSelectInput.tsx @@ -1,4 +1,4 @@ -import React, { FC, useState } from "react"; +import { FC, ReactElement, useState } from "react"; import { TouchableOpacity, View, ViewStyle } from "react-native"; import chevronDownSVG from "@/assets/icons/chevron-down.svg"; @@ -31,7 +31,7 @@ interface Props { onPressItem: (item: string) => void; items: string[]; label: string; - sublabel?: React.ReactElement; + sublabel?: ReactElement; required?: boolean; } diff --git a/packages/screens/Launchpad/LaunchpadApply/components/inputs/selectInputs/SelectInputLaunchpad.tsx b/packages/screens/Launchpad/LaunchpadApply/components/inputs/selectInputs/SelectInputLaunchpad.tsx index 2553de2a9f..addeb120f2 100644 --- a/packages/screens/Launchpad/LaunchpadApply/components/inputs/selectInputs/SelectInputLaunchpad.tsx +++ b/packages/screens/Launchpad/LaunchpadApply/components/inputs/selectInputs/SelectInputLaunchpad.tsx @@ -1,4 +1,4 @@ -import React, { FC, useState } from "react"; +import { FC, useState } from "react"; import { TouchableOpacity, View, ViewStyle } from "react-native"; import chevronDownSVG from "@/assets/icons/chevron-down.svg"; diff --git a/packages/screens/Launchpad/LaunchpadHome/LaunchpadScreen.tsx b/packages/screens/Launchpad/LaunchpadHome/LaunchpadScreen.tsx index 9870376656..09c1048c09 100644 --- a/packages/screens/Launchpad/LaunchpadHome/LaunchpadScreen.tsx +++ b/packages/screens/Launchpad/LaunchpadHome/LaunchpadScreen.tsx @@ -1,4 +1,3 @@ -import React from "react"; import { View } from "react-native"; import { diff --git a/packages/screens/Launchpad/LaunchpadHome/MintCollectionScreen.tsx b/packages/screens/Launchpad/LaunchpadHome/MintCollectionScreen.tsx index 36e4283539..41210436da 100644 --- a/packages/screens/Launchpad/LaunchpadHome/MintCollectionScreen.tsx +++ b/packages/screens/Launchpad/LaunchpadHome/MintCollectionScreen.tsx @@ -2,7 +2,7 @@ import { toUtf8 } from "@cosmjs/encoding"; import { EncodeObject } from "@cosmjs/proto-signing"; import { isDeliverTxFailure } from "@cosmjs/stargate"; import Long from "long"; -import React, { useCallback, useMemo, useState } from "react"; +import { FC, useCallback, useMemo, useState } from "react"; import { ActivityIndicator, StyleProp, @@ -10,15 +10,10 @@ import { TouchableOpacity, useWindowDimensions, View, - ViewStyle, } from "react-native"; import ConfettiCannon from "react-native-confetti-cannon"; import CountDown from "react-native-countdown-component"; -import FlexRow from "../../../components/FlexRow"; -import useSelectedWallet from "../../../hooks/useSelectedWallet"; -import { NUMBERS_REGEXP } from "../../../utils/regex"; - import { Coin } from "@/api/teritori-chain/cosmos/base/v1beta1/coin"; import balanceSVG from "@/assets/icons/balance.svg"; import minusSVG from "@/assets/icons/minus.svg"; @@ -26,11 +21,13 @@ import plusSVG from "@/assets/icons/plus.svg"; import sigmaSVG from "@/assets/icons/sigma.svg"; import { BrandText } from "@/components/BrandText"; import { ExternalLink } from "@/components/ExternalLink"; +import FlexRow from "@/components/FlexRow"; import { OptimizedImage } from "@/components/OptimizedImage"; import { SVG } from "@/components/SVG"; import { ScreenContainer } from "@/components/ScreenContainer"; import { TertiaryBadge } from "@/components/badges/TertiaryBadge"; -import { LegacyTertiaryBox } from "@/components/boxes/LegacyTertiaryBox"; +import { Box, BoxStyle } from "@/components/boxes/Box"; +import { TertiaryBox } from "@/components/boxes/TertiaryBox"; import { PrimaryButton } from "@/components/buttons/PrimaryButton"; import { SecondaryButton } from "@/components/buttons/SecondaryButton"; import { ProgressionCard } from "@/components/cards/ProgressionCard"; @@ -38,13 +35,14 @@ import { CollectionSocialButtons } from "@/components/collections/CollectionSoci import { GradientText } from "@/components/gradientText"; import { DepositWithdrawModal } from "@/components/modals/DepositWithdrawModal"; import { SpacerRow } from "@/components/spacer"; -import { initialToastError, useFeedbacks } from "@/context/FeedbacksProvider"; +import { initialToast, useFeedbacks } from "@/context/FeedbacksProvider"; import { useWalletControl } from "@/context/WalletControlProvider"; import { Wallet } from "@/context/WalletsProvider"; import { TeritoriMinter__factory } from "@/evm-contracts-clients/teritori-bunker-minter/TeritoriMinter__factory"; import { useBalances } from "@/hooks/useBalances"; import { useCanPay } from "@/hooks/useCanPay"; import { useCollectionInfo } from "@/hooks/useCollectionInfo"; +import useSelectedWallet from "@/hooks/useSelectedWallet"; import { CosmosNetworkInfo, EthereumNetworkInfo, @@ -61,6 +59,7 @@ import { prettyPrice } from "@/utils/coins"; import { MintPhase } from "@/utils/collection"; import { getMetaMaskEthereumSigner } from "@/utils/ethereum"; import { ScreenFC } from "@/utils/navigation"; +import { NUMBERS_REGEXP } from "@/utils/regex"; import { neutral17, neutral22, @@ -104,7 +103,7 @@ export const MintCollectionScreen: ScreenFC<"MintCollection"> = ({ notFound, refetch: refetchCollectionInfo, } = useCollectionInfo(id); - const { setToastError } = useFeedbacks(); + const { setToast } = useFeedbacks(); const { showConnectWalletModal, showNotEnoughFundsModal } = useWalletControl(); const [viewWidth, setViewWidth] = useState(0); @@ -283,11 +282,13 @@ export const MintCollectionScreen: ScreenFC<"MintCollection"> = ({ }); return; } - setToastError(initialToastError); + setToast(initialToast); if (!wallet) { - setToastError({ + setToast({ title: "Error", - message: `no wallet`, + message: "no wallet", + type: "error", + mode: "normal", }); return; } @@ -299,9 +300,11 @@ export const MintCollectionScreen: ScreenFC<"MintCollection"> = ({ await ethereumMint(network, wallet); break; default: - setToastError({ + setToast({ title: "Error", message: `unsupported network ${network?.id}`, + type: "error", + mode: "normal", }); return; } @@ -311,9 +314,11 @@ export const MintCollectionScreen: ScreenFC<"MintCollection"> = ({ setMinted(false); } catch (e) { if (e instanceof Error) { - return setToastError({ + return setToast({ title: "Mint failed", message: prettyError(e), + type: "error", + mode: "normal", }); } console.error(e); @@ -326,7 +331,7 @@ export const MintCollectionScreen: ScreenFC<"MintCollection"> = ({ cosmosMint, ethereumMint, network, - setToastError, + setToast, wallet, showNotEnoughFundsModal, ]); @@ -441,7 +446,7 @@ export const MintCollectionScreen: ScreenFC<"MintCollection"> = ({ }} /> - + {/* Upper section */} = ({ )} - + {mintTermsConditionsURL && ( = ({ margin: layout.spacing_x2, }} > - + {info.image ? ( = ({ /> )} - + = ({ {info.mintStarted ? ( <> {info.mintPhases.map((phase, index) => { - return ; + return ; })} = ({ ); }; -const AttributesCard: React.FC<{ - style?: StyleProp; +const AttributesCard: FC<{ + style?: StyleProp; label: string; value: string; }> = ({ style, label, value }) => { return ( - {value} - + ); }; -const PresaleActivy: React.FC<{ +const PresaleActivity: FC<{ info: MintPhase; }> = ({ info }) => { const now = Long.fromNumber(Date.now() / 1000); @@ -902,7 +908,7 @@ const PresaleActivy: React.FC<{ ); }; -const PhaseCountdown: React.FC<{ +const PhaseCountdown: FC<{ onCountdownEnd?: () => void; startsAt?: number; }> = ({ onCountdownEnd, startsAt }) => { @@ -939,7 +945,7 @@ const PhaseCountdown: React.FC<{ ); }; -const PublicSaleActivity: React.FC<{ +const PublicSaleActivity: FC<{ started?: boolean; startsAt?: number; ended: boolean; @@ -970,7 +976,7 @@ const PublicSaleActivity: React.FC<{ ); }; -const MintNotStartedActivity: React.FC = () => { +const MintNotStartedActivity: FC = () => { return (