import { Center, HStack, Text, VStack } from "native-base";
import React, { useCallback, useState } from "react";
import { useEthers } from "@usedapp/core";
import moment from "moment";
import { ethers } from "ethers";
import { G$Amount, GoodIdContextProvider, NewsFeedProvider, SupportedChains } from "@gooddollar/web3sdk-v2";
import { Provider } from "react-native-paper";
import { ClaimProvider, ClaimWizard, PostClaim, TransactionCard } from "../../../apps/ubi";
import { NativeBaseProvider, theme } from "../../../theme";
import { GoodIdProvider } from "../../../apps/goodid";
import { useGoodUILanguage } from "../../../theme";
import { W3Wrapper } from "../../W3Wrapper";
import { TxDetailsModal } from "../../../core/web3";
import { GoodButton } from "../../../core";
const explorerEndPoints = {
CELO: "https://celo.blockscout.com/api?",
FUSE: "https://explorer.fuse.io/api?",
MAINNET: ""
};
export default {
title: "Apps/Claim-Flow",
component: ClaimWizard,
decorators: [
(Story: any) => (
)
]
};
export const ClaimFlow = {
render: (args: any) => {
const { setLanguage } = useGoodUILanguage();
const { account = "", chainId } = useEthers();
return (
// {/* For testing purposes we have to be on qa env */}
setLanguage("en")} backgroundColor="gdPrimary" color="white">
English
setLanguage("es-419")} backgroundColor="gdPrimary" color="white">
spanish
);
},
args: {
onNews: () => {
alert("Should go to news page");
},
onUpgrade: () => {
alert("Should go to goodid upgrade page");
},
onExit: () => {
alert("If wallet > should go to dashboard");
},
isDev: true
}
};
export const TransactionCardStory = {
render: (args: any) => {
const tokenValue = G$Amount("G$", ethers.BigNumber.from("1000000"), 122, "fuse");
args.transaction.tokenValue = tokenValue;
const [openTxDetails, setOpenTxDetails] = useState(false);
const onTxDetailsPress = useCallback(() => {
setOpenTxDetails(prev => !prev);
}, [openTxDetails]);
return (
setOpenTxDetails(prev => !prev)} tx={args.transaction} />
);
},
args: {
transaction: {
address: "0x123",
network: "CELO",
contractAddress: "0x123",
token: "G$",
status: "not-started",
type: "claim-confirmed",
date: moment.utc(),
displayName: "GoodDollar (0x123)",
tokenValue: undefined,
transactionHash: "0xTransactionHash"
}
}
};
export const PreClaimStoryUI = {
render: (args: any) => (
)
};
export const PostClaimUI = {
render: (args: any) => (
This is a demo, if timer is 0, make sure you do the PreClaim story-example first.
)
};