diff --git a/index.html b/index.html
index f828b817..be2d255e 100644
--- a/index.html
+++ b/index.html
@@ -2,9 +2,9 @@
-
+
- Vite + React + TS
+ DLC.Link dlcBTC Website
diff --git a/src/app/components/custom-skeleton/custom-skeleton.tsx b/src/app/components/custom-skeleton/custom-skeleton.tsx
index 92fd9f69..97bbb27e 100644
--- a/src/app/components/custom-skeleton/custom-skeleton.tsx
+++ b/src/app/components/custom-skeleton/custom-skeleton.tsx
@@ -1,24 +1,18 @@
-import { ReactNode } from "react";
-
import { Skeleton } from "@chakra-ui/react";
interface CustomSkeletonProps {
- children: ReactNode;
- isLoaded: boolean;
+ height: string;
}
export function CustomSkeleton({
- children,
- isLoaded,
+ height,
}: CustomSkeletonProps): React.JSX.Element {
return (
- {children}
-
+ h={height}
+ />
);
}
diff --git a/src/app/components/mint-unmint/components/mint/mint.tsx b/src/app/components/mint-unmint/components/mint/mint.tsx
index 34430f81..149c4ec9 100644
--- a/src/app/components/mint-unmint/components/mint/mint.tsx
+++ b/src/app/components/mint-unmint/components/mint/mint.tsx
@@ -1,26 +1,38 @@
import { useState } from "react";
import { HStack } from "@chakra-ui/react";
+import { VaultStatus } from "@models/vault";
-import { mintStepsContent } from "@shared/constants/walkthrough-steps";
+import { exampleVaults } from "@shared/examples/example-vaults";
import { ProgressTimeline } from "../progress-timeline/progress-timeline";
import { TransactionForm } from "../transaction-form/transaction-form";
import { TransactionSummary } from "../transaction-summary/transaction-summary";
import { Walkthrough } from "../walkthrough/walkthrough";
import { MintLayout } from "./components/mint.layout";
-import { StepButton } from "./components/step-button";
+import { StepButton } from "@components/step-button/step-button";
export function Mint(): React.JSX.Element {
const [currentStep, setCurrentStep] = useState(0);
+ const exampleVault = exampleVaults.find(
+ (vault) => vault.state === VaultStatus.FUNDING,
+ );
return (
-
-
- {currentStep === 2 && }
+
+ {[0, 1].includes(currentStep) && (
+
+ )}
+ {[2].includes(currentStep) && (
+
+ )}
setCurrentStep((currentStep + 1) % 3)} />
diff --git a/src/app/components/mint-unmint/components/progress-timeline/components/step.tsx b/src/app/components/mint-unmint/components/progress-timeline/components/progress-timeline-step.tsx
similarity index 100%
rename from src/app/components/mint-unmint/components/progress-timeline/components/step.tsx
rename to src/app/components/mint-unmint/components/progress-timeline/components/progress-timeline-step.tsx
diff --git a/src/app/components/mint-unmint/components/progress-timeline/progress-timeline.tsx b/src/app/components/mint-unmint/components/progress-timeline/progress-timeline.tsx
index 36819626..33c222d9 100644
--- a/src/app/components/mint-unmint/components/progress-timeline/progress-timeline.tsx
+++ b/src/app/components/mint-unmint/components/progress-timeline/progress-timeline.tsx
@@ -1,6 +1,6 @@
import { HStack, VStack } from "@chakra-ui/react";
-import { StepGraphics, StepText } from "./components/step";
+import { StepGraphics, StepText } from "./components/progress-timeline-step";
interface ProgressTimelineProps {
variant: "mint" | "unmint";
diff --git a/src/app/components/mint-unmint/components/setup-information-stack/components/wallet-requirement.tsx b/src/app/components/mint-unmint/components/setup-information-stack/components/setup-information-wallet-requirement.tsx
similarity index 81%
rename from src/app/components/mint-unmint/components/setup-information-stack/components/wallet-requirement.tsx
rename to src/app/components/mint-unmint/components/setup-information-stack/components/setup-information-wallet-requirement.tsx
index 507c8390..414ff2fd 100644
--- a/src/app/components/mint-unmint/components/setup-information-stack/components/wallet-requirement.tsx
+++ b/src/app/components/mint-unmint/components/setup-information-stack/components/setup-information-wallet-requirement.tsx
@@ -1,6 +1,6 @@
import { HStack, Image, Text, VStack } from "@chakra-ui/react";
-interface WalletRequirementProps {
+interface SetupInformationWalletRequirementProps {
logo: string;
color: string;
walletName: string;
@@ -8,13 +8,13 @@ interface WalletRequirementProps {
url: string;
}
-export function WalletRequirement({
+export function SetupInformationWalletRequirement({
logo,
color,
walletName,
requirement,
url,
-}: WalletRequirementProps): React.JSX.Element {
+}: SetupInformationWalletRequirementProps): React.JSX.Element {
return (
diff --git a/src/app/components/mint-unmint/components/setup-information-stack/setup-information-stack.tsx b/src/app/components/mint-unmint/components/setup-information-stack/setup-information-stack.tsx
index 4df4ed5e..1d81d5b9 100644
--- a/src/app/components/mint-unmint/components/setup-information-stack/setup-information-stack.tsx
+++ b/src/app/components/mint-unmint/components/setup-information-stack/setup-information-stack.tsx
@@ -6,7 +6,7 @@ import { Button, HStack, Image, Text, VStack } from "@chakra-ui/react";
import { modalActions } from "@store/slices/modal/modal.actions";
import { SetupInformationStackLayout } from "./components/setup-information-stack.layout";
-import { WalletRequirement } from "./components/wallet-requirement";
+import { SetupInformationWalletRequirement } from "./components/setup-information-wallet-requirement";
export function SetupInformationStack(): React.JSX.Element {
const navigate = useNavigate();
@@ -39,14 +39,14 @@ export function SetupInformationStack(): React.JSX.Element {
What you will need:
-
-
@@ -36,11 +36,11 @@ export function TransactionFee({
Protocol Fee
- {calculateProtocolFee(amount, 0.0001)} BTC
+ {calculateProtocolFee(assetAmount, 0.0001)} BTC
{" "}
- = {calculateProtocolFeeInUSD(amount, 36.142, 0.0001)} $
+ = {calculateProtocolFeeInUSD(assetAmount, 36.142, 0.0001)} $
);
diff --git a/src/app/components/mint-unmint/components/transaction-form/components/transaction-input.tsx b/src/app/components/mint-unmint/components/transaction-form/components/transaction-form-input.tsx
similarity index 57%
rename from src/app/components/mint-unmint/components/transaction-form/components/transaction-input.tsx
rename to src/app/components/mint-unmint/components/transaction-form/components/transaction-form-input.tsx
index 8dcb8031..f6da3a65 100644
--- a/src/app/components/mint-unmint/components/transaction-form/components/transaction-input.tsx
+++ b/src/app/components/mint-unmint/components/transaction-form/components/transaction-form-input.tsx
@@ -1,19 +1,25 @@
import { HStack, Image, Input, Text, VStack } from "@chakra-ui/react";
import { Field } from "formik";
-import {
- TransactionFormValues,
- blockchainFormPropertyMap,
-} from "../transaction-form";
-interface TransactionInputProps {
- blockchain: "ethereum" | "bitcoin";
+import { TransactionFormValues } from "../transaction-form";
+
+function validateTokenAmount(value: number): string | undefined {
+ let error;
+ if (!value) {
+ error = "Please enter an amount of dlcBTC you would like to mint";
+ } else if (value < 0.0001) {
+ error = "You can't mint less than 0.0001 dlcBTC";
+ }
+ return error;
+}
+
+interface TransactionFormInputProps {
values: TransactionFormValues;
}
-export function TransactionInput({
- blockchain,
+export function TransactionFormInput({
values,
-}: TransactionInputProps): React.JSX.Element {
+}: TransactionFormInputProps): React.JSX.Element {
return (
dlcBTC
diff --git a/src/app/components/mint-unmint/components/transaction-form/components/warning.tsx b/src/app/components/mint-unmint/components/transaction-form/components/transaction-form-warning.tsx
similarity index 68%
rename from src/app/components/mint-unmint/components/transaction-form/components/warning.tsx
rename to src/app/components/mint-unmint/components/transaction-form/components/transaction-form-warning.tsx
index 63cb6bfb..46a2f212 100644
--- a/src/app/components/mint-unmint/components/transaction-form/components/warning.tsx
+++ b/src/app/components/mint-unmint/components/transaction-form/components/transaction-form-warning.tsx
@@ -1,18 +1,17 @@
import { HStack, Link, Text } from "@chakra-ui/react";
-interface WarningProps {
- blockchain: "ethereum" | "bitcoin";
+interface TransactionFormWarningProps {
+ assetAmount: number;
}
-export function Warning({
- blockchain,
-}: WarningProps): React.JSX.Element | boolean {
- if (blockchain === "bitcoin") return false;
+export function TransactionFormWarning({
+ assetAmount,
+}: TransactionFormWarningProps): React.JSX.Element {
return (
- Make sure you have 10.00 BTC + (fees){" "}
+ Make sure you have {assetAmount} BTC + (fees){" "}
in your{" "}
>;
}
+ //TODO: Separate the bitcoin and ethereum cases into two separate functions
+
return (
{blockchainFormPropertyMap[blockchain].title}
-
-
+ {blockchain === "ethereum" ? (
+
+ ) : (
+
+ )}
+ {["ethereum"].includes(blockchain) && (
{errors.amount}
-
-
- {blockchain === "bitcoin" && (
-
+ )}
+ {["ethereum"].includes(blockchain) && (
+
+ )}
+ {["bitcoin"].includes(blockchain) && (
+
)}
diff --git a/src/app/components/mint-unmint/components/transaction-summary/transaction-summary.tsx b/src/app/components/mint-unmint/components/transaction-summary/transaction-summary.tsx
index e30adbb6..e35704cf 100644
--- a/src/app/components/mint-unmint/components/transaction-summary/transaction-summary.tsx
+++ b/src/app/components/mint-unmint/components/transaction-summary/transaction-summary.tsx
@@ -1,39 +1,66 @@
import { useNavigate } from "react-router-dom";
-import { HStack, Link, Spinner, Text, VStack } from "@chakra-ui/react";
+import { HStack, Link, Spinner, Stack, Text, VStack } from "@chakra-ui/react";
import { VaultCard } from "@components/vault/vault-card";
-import { VaultStatus } from "@models/vault";
+import { Vault } from "@models/vault";
-import { exampleVaults } from "@shared/examples/example-vaults";
+import { TransactionSummaryPreviewCard } from "./components/transaction-summary-preview-card";
-import { PreviewCard } from "./components/preview-card";
+const flowPropertyMap = {
+ mint: {
+ title: "Locking BTC in progress",
+ subtitle: "Minting dlcBTC",
+ },
+ unmint: {
+ title: "Unmint in progress",
+ subtitle: "Your BTC is being unlocked",
+ },
+};
-export function TransactionSummary(): React.JSX.Element {
+interface TransactionSummaryProps {
+ flow: "mint" | "unmint";
+ blockchain: "ethereum" | "bitcoin";
+ vault?: Vault;
+}
+
+export function TransactionSummary({
+ flow,
+ blockchain,
+ vault,
+}: TransactionSummaryProps): React.JSX.Element {
const navigate = useNavigate();
- const exampleVault = exampleVaults.find(
- (vault) => vault.state === VaultStatus.FUNDING,
- );
return (
- a) Locking BTC in progress:
+ a) {flowPropertyMap[flow].title}:
- {exampleVault && }
- b) Minting dlcBTC:
-
-
- You can follow the status of the mint under{" "}
- navigate("/my-vaults")}
- >
- My Vaults
- {" "}
- tab.
-
+
+ b) {flowPropertyMap[flow].subtitle}:
+
+
+
+ You can follow the status of the {flow} under{" "}
+ navigate("/my-vaults")}
+ >
+ My Vaults
+ {" "}
+ tab.
+
+
);
}
diff --git a/src/app/components/mint-unmint/components/unmint/components/unmint-vault-selector.tsx b/src/app/components/mint-unmint/components/unmint/components/unmint-vault-selector.tsx
new file mode 100644
index 00000000..6b36e25d
--- /dev/null
+++ b/src/app/components/mint-unmint/components/unmint/components/unmint-vault-selector.tsx
@@ -0,0 +1,66 @@
+import { useState } from "react";
+
+import { Button, Text, VStack } from "@chakra-ui/react";
+import { VaultCard } from "@components/vault/vault-card";
+import { VaultsListGroupContainer } from "@components/vaults-list/components/vaults-list-group-container";
+import { VaultsList } from "@components/vaults-list/vaults-list";
+import { useVaults } from "@hooks/use-vaults";
+import { Vault } from "@models/vault";
+
+import { scrollBarCSS } from "../../../../../../styles/css-styles";
+
+export function UnmintVaultSelector(): React.JSX.Element {
+ const [selectedVault, setSelectedVault] = useState(
+ undefined,
+ );
+ const { fundedVaults } = useVaults();
+
+ function handleSelect(uuid: string): void {
+ const vault = fundedVaults.find((vault) => vault.uuid === uuid);
+ if (vault) setSelectedVault(vault);
+ }
+
+ return (
+
+
+ Select vault to unmint dlcBTC:
+
+ {selectedVault ? (
+
+ setSelectedVault(undefined)}
+ />
+
+ ) : (
+
+
+
+ )}
+
+
+ );
+}
diff --git a/src/app/components/mint-unmint/components/unmint/components/unmint.layout.tsx b/src/app/components/mint-unmint/components/unmint/components/unmint.layout.tsx
index 3b7b3834..2619583a 100644
--- a/src/app/components/mint-unmint/components/unmint/components/unmint.layout.tsx
+++ b/src/app/components/mint-unmint/components/unmint/components/unmint.layout.tsx
@@ -5,10 +5,12 @@ export function UnmintLayout({ children }: HasChildren): React.JSX.Element {
return (
{children}
diff --git a/src/app/components/mint-unmint/components/unmint/unmint.tsx b/src/app/components/mint-unmint/components/unmint/unmint.tsx
index 3c178a3e..533699e7 100644
--- a/src/app/components/mint-unmint/components/unmint/unmint.tsx
+++ b/src/app/components/mint-unmint/components/unmint/unmint.tsx
@@ -1,15 +1,42 @@
import { useState } from "react";
-import { StepButton } from "../mint/components/step-button";
+import { HStack } from "@chakra-ui/react";
+import { StepButton } from "@components/step-button/step-button";
+import { VaultStatus } from "@models/vault";
+
+import { exampleVaults } from "@shared/examples/example-vaults";
+
import { ProgressTimeline } from "../progress-timeline/progress-timeline";
+import { TransactionSummary } from "../transaction-summary/transaction-summary";
+import { Walkthrough } from "../walkthrough/walkthrough";
+import { UnmintVaultSelector } from "./components/unmint-vault-selector";
import { UnmintLayout } from "./components/unmint.layout";
export function Unmint(): React.JSX.Element {
- const [currentStep, setCurrentStep] = useState(1);
+ const [currentStep, setCurrentStep] = useState(0);
+ const exampleVault = exampleVaults.find(
+ (vault) => vault.state === VaultStatus.CLOSING,
+ );
+
return (
- setCurrentStep((currentStep + 1) % 3)} />
+
+
+ {[0].includes(currentStep) && }
+ {[1].includes(currentStep) && (
+
+ )}
+
+ setCurrentStep((currentStep + 1) % 2)} />
);
}
diff --git a/src/app/components/mint-unmint/components/walkthrough/components/blockchain-tag.tsx b/src/app/components/mint-unmint/components/walkthrough/components/walkthrough-blockchain-tag.tsx
similarity index 83%
rename from src/app/components/mint-unmint/components/walkthrough/components/blockchain-tag.tsx
rename to src/app/components/mint-unmint/components/walkthrough/components/walkthrough-blockchain-tag.tsx
index 25a9dfd2..a69629f7 100644
--- a/src/app/components/mint-unmint/components/walkthrough/components/blockchain-tag.tsx
+++ b/src/app/components/mint-unmint/components/walkthrough/components/walkthrough-blockchain-tag.tsx
@@ -11,13 +11,13 @@ const blockchainTagPropertyMap = {
},
};
-interface BlockchainTagProps {
+interface WalkthroughBlockchainTagProps {
blockchain: "ethereum" | "bitcoin";
}
-export function BlockchainTag({
+export function WalkthroughBlockchainTag({
blockchain,
-}: BlockchainTagProps): React.JSX.Element {
+}: WalkthroughBlockchainTagProps): React.JSX.Element {
return (
+
+
+ Step {currentStep + 1}
+
+
+
+
+ {title}
+
+
+ );
+}
diff --git a/src/app/components/mint-unmint/components/walkthrough/walkthrough.tsx b/src/app/components/mint-unmint/components/walkthrough/walkthrough.tsx
index 45f8a3aa..6eb734b3 100644
--- a/src/app/components/mint-unmint/components/walkthrough/walkthrough.tsx
+++ b/src/app/components/mint-unmint/components/walkthrough/walkthrough.tsx
@@ -1,44 +1,151 @@
-import { ReactNode } from "react";
+import { Button, HStack, Image, Link, Text } from "@chakra-ui/react";
+import { TutorialVideo } from "@components/tutorial-video/tutorial-video";
-import { HStack, Text } from "@chakra-ui/react";
-
-import { BlockchainTag } from "./components/blockchain-tag";
+import { WalkthroughHeader } from "./components/walkthrough-header";
import { WalkthroughLayout } from "./components/walkthrough.layout";
interface WalkthroughProps {
- step: number;
- title: string;
- blockchain: "ethereum" | "bitcoin";
- primaryBody: ReactNode;
- secondaryBody?: ReactNode;
- button?: ReactNode;
- video?: ReactNode;
+ flow: "mint" | "unmint";
+ currentStep: number;
+ bitcoinAmount?: number;
}
export function Walkthrough({
- step,
- title,
- blockchain,
- primaryBody,
- secondaryBody,
- button,
- video,
+ flow,
+ currentStep,
+ bitcoinAmount,
}: WalkthroughProps): React.JSX.Element {
- return (
-
-
-
- Step {step + 1}
-
-
-
-
- {title}
-
- {primaryBody}
- {secondaryBody}
- {button}
- {video}
-
- );
+ switch (flow) {
+ case "mint":
+ switch (currentStep) {
+ case 0:
+ return (
+
+
+
+ Select an amount of dlcBTC you would like to mint and confirm it
+ in your{" "}
+
+ Ethereum Wallet
+
+ .
+
+
+ 1 BTC = 1 dlcBTC
+
+
+
+ );
+ case 1:
+ return (
+
+
+
+ Confirm the transaction in your{" "}
+
+ Bitcoin Wallet{" "}
+
+ which will lock your Bitcoin on-chain.
+
+
+ );
+ case 2:
+ return (
+
+
+
+ Wait for Bitcoin to get locked on chain{" "}
+
+ (~1 hour)
+
+ . After 6 confirmations, dlcBTC tokens will appear in your
+ Ethereum Wallet.
+
+
+ To ensure your{" "}
+ dlcBTC tokens
+ are visible
+ simply add them
+ to your Ethereum Wallet.
+
+
+
+ );
+ default:
+ return <>>;
+ }
+ case "unmint":
+ switch (currentStep) {
+ case 0:
+ return (
+
+
+
+ Select the dlcBTC vault you would like to unmint. After a
+ successful unmint you will receive BTC in the same amount back
+ to your wallet.
+
+
+ );
+ case 1:
+ return (
+
+
+
+ After a successful unmint (
+ ~1 hour) your
+ will receive{" "}
+ {bitcoinAmount}BTC in
+ your bitcoin wallet.
+
+
+ );
+ default:
+ return <>>;
+ }
+ }
}
diff --git a/src/app/components/modals/select-wallet-modal/components/wallet-button.tsx b/src/app/components/modals/select-wallet-modal/components/select-wallet-menu.tsx
similarity index 83%
rename from src/app/components/modals/select-wallet-modal/components/wallet-button.tsx
rename to src/app/components/modals/select-wallet-modal/components/select-wallet-menu.tsx
index 7cb7de80..00e912d2 100644
--- a/src/app/components/modals/select-wallet-modal/components/wallet-button.tsx
+++ b/src/app/components/modals/select-wallet-modal/components/select-wallet-menu.tsx
@@ -1,15 +1,15 @@
import { Button, HStack, Image, Text } from "@chakra-ui/react";
import { Wallet, WalletType } from "@models/wallet";
-interface WalletMenuProps {
+interface SelectWalletMenuProps {
wallet: Wallet;
handleClick: (address: string, walletType: WalletType) => void;
}
-export function WalletMenu({
+export function SelectWalletMenu({
wallet,
handleClick,
-}: WalletMenuProps): React.JSX.Element {
+}: SelectWalletMenuProps): React.JSX.Element {
const { logo, name } = wallet;
return (
diff --git a/src/app/components/modals/select-wallet-modal/select-wallet-modal.tsx b/src/app/components/modals/select-wallet-modal/select-wallet-modal.tsx
index ba095154..7e4471ff 100644
--- a/src/app/components/modals/select-wallet-modal/select-wallet-modal.tsx
+++ b/src/app/components/modals/select-wallet-modal/select-wallet-modal.tsx
@@ -5,7 +5,7 @@ import { CheckIcon } from "@chakra-ui/icons";
import { HStack, ScaleFade, Text, VStack } from "@chakra-ui/react";
import { ModalComponentProps } from "@components/modals/components/modal-container";
import { ModalLayout } from "@components/modals/components/modal.layout";
-import { WalletMenu } from "@components/modals/select-wallet-modal/components/wallet-button";
+import { SelectWalletMenu } from "@components/modals/select-wallet-modal/components/select-wallet-menu";
import { SelectNetworkButton } from "@components/select-network-button/select-network-button";
import { Network } from "@models/network";
import { WalletType, ethereumWallets } from "@models/wallet";
@@ -66,7 +66,7 @@ export function SelectWalletModal({
Select Wallet
{ethereumWallets.map((wallet) => (
-
-
+
{address ? (
<>
-
-
+
-
-
-
+
+
>
) : (
-
+
)}
);
}
diff --git a/src/app/components/my-vaults-large/components/my-vaults-large-header/my-vaults-large-header.tsx b/src/app/components/my-vaults/components/my-vaults-header/my-vaults-header.tsx
similarity index 83%
rename from src/app/components/my-vaults-large/components/my-vaults-large-header/my-vaults-large-header.tsx
rename to src/app/components/my-vaults/components/my-vaults-header/my-vaults-header.tsx
index d4f60347..8aeaf0b0 100644
--- a/src/app/components/my-vaults-large/components/my-vaults-large-header/my-vaults-large-header.tsx
+++ b/src/app/components/my-vaults/components/my-vaults-header/my-vaults-header.tsx
@@ -1,6 +1,6 @@
import { Divider, HStack, Text, VStack } from "@chakra-ui/react";
-import { BalanceInfo } from "./components/balance-info";
+import { MyVaultsHeaderBalanceInfo } from "./components/my-vaults-header-balance-info";
interface MyVaultsLargeHeaderProps {
address?: string;
@@ -26,19 +26,19 @@ export function MyVaultsLargeHeader({
-
-
diff --git a/src/app/components/my-vaults-large/components/my-vaults-large.layout.tsx b/src/app/components/my-vaults/components/my-vaults-large.layout.tsx
similarity index 100%
rename from src/app/components/my-vaults-large/components/my-vaults-large.layout.tsx
rename to src/app/components/my-vaults/components/my-vaults-large.layout.tsx
diff --git a/src/app/components/my-vaults-large/components/disconnected-info-stack.tsx b/src/app/components/my-vaults/components/my-vaults-setup-information-stack.tsx
similarity index 93%
rename from src/app/components/my-vaults-large/components/disconnected-info-stack.tsx
rename to src/app/components/my-vaults/components/my-vaults-setup-information-stack.tsx
index 4ab52837..7db2eecd 100644
--- a/src/app/components/my-vaults-large/components/disconnected-info-stack.tsx
+++ b/src/app/components/my-vaults/components/my-vaults-setup-information-stack.tsx
@@ -4,7 +4,7 @@ import { useNavigate } from "react-router-dom";
import { Button, Text, VStack } from "@chakra-ui/react";
import { modalActions } from "@store/slices/modal/modal.actions";
-export function DisconnectedInfoStack(): React.JSX.Element {
+export function MyVaultsSetupInformationStack(): React.JSX.Element {
const dispatch = useDispatch();
const navigate = useNavigate();
diff --git a/src/app/components/my-vaults-large/my-vaults-large.tsx b/src/app/components/my-vaults/my-vaults-large.tsx
similarity index 67%
rename from src/app/components/my-vaults-large/my-vaults-large.tsx
rename to src/app/components/my-vaults/my-vaults-large.tsx
index cb6d90ba..5fdcff6a 100644
--- a/src/app/components/my-vaults-large/my-vaults-large.tsx
+++ b/src/app/components/my-vaults/my-vaults-large.tsx
@@ -1,15 +1,15 @@
import { useSelector } from "react-redux";
import { HStack } from "@chakra-ui/react";
-import { VaultGroupBlankContainer } from "@components/vaults-list/components/vault-group-blank-container";
-import { VaultGroupContainer } from "@components/vaults-list/components/vault-group-container";
+import { VaultsListGroupBlankContainer } from "@components/vaults-list/components/vaults-list-group-blank-container";
+import { VaultsListGroupContainer } from "@components/vaults-list/components/vaults-list-group-container";
import { VaultsList } from "@components/vaults-list/vaults-list";
import { useVaults } from "@hooks/use-vaults";
import { RootState } from "@store/index";
-import { DisconnectedInfoStack } from "./components/disconnected-info-stack";
-import { MyVaultsLargeHeader } from "./components/my-vaults-large-header/my-vaults-large-header";
+import { MyVaultsLargeHeader } from "./components/my-vaults-header/my-vaults-header";
import { MyVaultsLargeLayout } from "./components/my-vaults-large.layout";
+import { MyVaultsSetupInformationStack } from "./components/my-vaults-setup-information-stack";
export function MyVaultsLarge(): React.JSX.Element {
const { address, dlcBTCBalance, lockedBTCBalance } = useSelector(
@@ -37,18 +37,18 @@ export function MyVaultsLarge(): React.JSX.Element {
height={"475px"}
isScrollable={!address}
>
-
-
+
-
) : (
-
+
)}
{address ? (
-
+
) : (
-
+
)}
{address ? (
-
+
) : (
-
+
)}
diff --git a/src/app/components/protocol-history/components/protocol-history-item.tsx b/src/app/components/protocol-history/components/protocol-history-item.tsx
index c833268f..75bb72a5 100644
--- a/src/app/components/protocol-history/components/protocol-history-item.tsx
+++ b/src/app/components/protocol-history/components/protocol-history-item.tsx
@@ -1,6 +1,5 @@
import { HStack, Image, Text } from "@chakra-ui/react";
import { CustomSkeleton } from "@components/custom-skeleton/custom-skeleton";
-import { useLoadingDelay } from "@hooks/use-loading-delay";
interface ProtocolHistoryItem {
id: string;
@@ -12,40 +11,36 @@ interface ProtocolHistoryItem {
export function ProtocolHistoryItem(
protocolHistoryItem: ProtocolHistoryItem,
): React.JSX.Element {
- const isLoaded = useLoadingDelay(3000);
+ if (!protocolHistoryItem) return ;
return (
-
-
-
-
-
- {protocolHistoryItem.value}
-
-
- {protocolHistoryItem.uuid}
-
-
+
+
+
+
+ {protocolHistoryItem.value}
+
- {protocolHistoryItem.date}
+ {protocolHistoryItem.uuid}
-
+
+ {protocolHistoryItem.date}
+
+
);
}
diff --git a/src/app/components/mint-unmint/components/mint/components/step-button.tsx b/src/app/components/step-button/step-button.tsx
similarity index 100%
rename from src/app/components/mint-unmint/components/mint/components/step-button.tsx
rename to src/app/components/step-button/step-button.tsx
diff --git a/src/app/components/mint-unmint/components/mint/components/video.tsx b/src/app/components/tutorial-video/tutorial-video.tsx
similarity index 54%
rename from src/app/components/mint-unmint/components/mint/components/video.tsx
rename to src/app/components/tutorial-video/tutorial-video.tsx
index 28a0504f..4747f346 100644
--- a/src/app/components/mint-unmint/components/mint/components/video.tsx
+++ b/src/app/components/tutorial-video/tutorial-video.tsx
@@ -1,19 +1,18 @@
import { useState } from "react";
import YouTube, { YouTubeProps } from "react-youtube";
-import { Stack, Text, VStack } from "@chakra-ui/react";
-import { CustomSkeleton } from "@components/custom-skeleton/custom-skeleton";
+import { Skeleton, Text, VStack } from "@chakra-ui/react";
export function TutorialVideo(): React.JSX.Element {
- const [loading, setLoading] = useState(true);
+ const [isLoading, setIsLoading] = useState(true);
const onPlayerReady: YouTubeProps["onReady"] = (event) => {
event.target.pauseVideo();
- setLoading(false);
+ setIsLoading(false);
};
const opts: YouTubeProps["opts"] = {
height: "150",
- width: "250",
+ width: "245",
playerVars: {
autoplay: 0,
controls: 1,
@@ -25,15 +24,23 @@ export function TutorialVideo(): React.JSX.Element {
Watch explainer video:
-
-
+
-
-
+
+
);
}
diff --git a/src/app/components/vault/components/expanded-information-stack/expanded-information-stack.tsx b/src/app/components/vault/components/expanded-information-stack/expanded-information-stack.tsx
deleted file mode 100644
index 8baf8c5f..00000000
--- a/src/app/components/vault/components/expanded-information-stack/expanded-information-stack.tsx
+++ /dev/null
@@ -1,36 +0,0 @@
-import { Divider, VStack } from "@chakra-ui/react";
-import { easyTruncateAddress } from "@common/utilities";
-
-import { InformationRow } from "./components/asset-row";
-import { TransactionRow } from "./components/transaction-row";
-
-interface ExpandedInformationStackProps {
- uuid: string;
- fundingTX: string;
- closingTX: string;
- isExpanded: boolean;
-}
-
-export function ExpandedInformationStack({
- uuid,
- fundingTX,
- closingTX,
- isExpanded,
-}: ExpandedInformationStackProps): React.JSX.Element | boolean {
- if (!isExpanded) return false;
-
- return (
- <>
-
-
-
- {fundingTX !== "" && (
-
- )}
- {closingTX !== "" && (
-
- )}
-
- >
- );
-}
diff --git a/src/app/components/vault/components/vault-card.layout.tsx b/src/app/components/vault/components/vault-card.layout.tsx
index da0454d4..c1672d2f 100644
--- a/src/app/components/vault/components/vault-card.layout.tsx
+++ b/src/app/components/vault/components/vault-card.layout.tsx
@@ -1,35 +1,34 @@
import { ReactNode } from "react";
import { VStack } from "@chakra-ui/react";
-import { CustomSkeleton } from "@components/custom-skeleton/custom-skeleton";
interface VaultCardLayoutProps {
children: ReactNode;
- isLoaded: boolean;
+ isSelectable?: boolean;
+ handleClick: () => void;
}
export function VaultCardLayout({
children,
- isLoaded,
+ isSelectable = false,
+ handleClick,
}: VaultCardLayoutProps): React.JSX.Element {
return (
-
-
- {children}
-
-
+ {}}
+ >
+ {children}
+
);
}
diff --git a/src/app/components/vault/components/expand-button.tsx b/src/app/components/vault/components/vault-expand-button.tsx
similarity index 82%
rename from src/app/components/vault/components/expand-button.tsx
rename to src/app/components/vault/components/vault-expand-button.tsx
index f5f2f3c9..7b12e68c 100644
--- a/src/app/components/vault/components/expand-button.tsx
+++ b/src/app/components/vault/components/vault-expand-button.tsx
@@ -1,15 +1,15 @@
import { ChevronDownIcon, ChevronUpIcon } from "@chakra-ui/icons";
import { Button, Text } from "@chakra-ui/react";
-interface ExpandButtonProps {
+interface VaultExpandButtonProps {
isExpanded: boolean;
handleClick: () => void;
}
-export function ExpandButton({
+export function VaultExpandButton({
isExpanded,
handleClick,
-}: ExpandButtonProps): React.JSX.Element {
+}: VaultExpandButtonProps): React.JSX.Element {
return (