Skip to content

Commit

Permalink
chore: Code cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
ape-fede committed Dec 22, 2022
1 parent b941cf5 commit cf61525
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 72 deletions.
55 changes: 1 addition & 54 deletions src/widgets/TutorialModal/TutorialModal.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
/** @jsxImportSource theme-ui */
import React, { useState } from "react";
import { Button } from "../../components/Button";
import { Flex } from "../../components/Flex";
import StorybookLayout from "../../components/StorybookLayout/StorybookLayout";
import { Text } from "../../components/Text";
import { Connected } from "../Navbar/index.stories";
import TutorialModal from "./TutorialModal";
import { TutorialModals } from "./types";
import useTutorialModal from "./useTutorialModal";
import { styles } from "./styles";

export default {
title: "Widgets/TutorialModal",
Expand All @@ -24,64 +21,14 @@ export default {

const translate: (key: string) => string = (key) => key;

const Body1 = () => {
const t = translate;
return (
<Flex sx={styles.container}>
<Text sx={styles.step}>{t("Step 1")}</Text>
<Text sx={styles.head}>{t("Connect your wallet")}</Text>

<Text sx={styles.content}>
<Text sx={styles.yellow}>{t("Click here")}</Text>{" "}
<Text sx={styles.content}>{t("to connect your wallet to ApeSwap.")}</Text>
</Text>

<Text sx={{ ...styles.content, fontStyle: "italic" }}>
<Text sx={styles.content}>{t("Don’t have a wallet?")}</Text>{" "}
<Text sx={styles.content}>{t(`A full setup guide for MetaMask on BNB Chain can be found `)}</Text>
<Text sx={styles.yellow}>
<a href="void" target="_blank" rel="noreferrer noopener">
{t("here")}
</a>
</Text>
</Text>
</Flex>
);
};

const Body2 = () => {
const t = translate;
return (
<Flex sx={styles.container}>
<Text sx={styles.step}>{t("Step 2")}</Text>
<Text sx={styles.head}>{t("Select Tokens & Amount")}</Text>

<Text sx={styles.content}>
<Text sx={styles.content}>{t("Select the tokens you want to trade and enter your preferred amount.")}</Text>
</Text>

<Text sx={{ ...styles.content, fontStyle: "italic" }}>
<Text sx={styles.content}>{t(`New to BNB Chain? You might need to`)}</Text>{" "}
<Text sx={styles.yellow}>
<a href="void" target="_blank" rel="noreferrer noopener">
{t("bridge tokens")}
</a>
</Text>{" "}
<Text sx={styles.content}>{t(`first. Always keep spare BNB to account for gas fees.`)}</Text>
</Text>
</Flex>
);
};

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export const WithUseModalNavbar: React.FC = (args: any) => {
const [visible, setVisible] = useState(true);
const { onPresentTutorialModal } = useTutorialModal({
title: "This is the tutorial {title}",
description: "This is the tutorial {description}",
t: translate,
onDismiss: () => setVisible(!visible),
children: [<>this is the slide content</>, <>fede is hot</>],
children: [<>slide content 1</>, <>second slide content</>],
readyText: "I'm Ready",
type: TutorialModals.BNB_DEX,
isConnected: true,
Expand Down
19 changes: 1 addition & 18 deletions src/widgets/TutorialModal/TutorialModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,7 @@ const TutorialModal: React.FC<TModalProps> = ({
const renderChildren = () => {
return children?.map((element, i) => (
<Flex>
{step === i && (
<Flex sx={{ width: "100%", flexWrap: "wrap", mt: ["15px", "15px", "30px"] }}>
<Flex sx={{ width: "100%" }}>
<Text
sx={{
fontSize: "10px",
lineHeight: "14px",
fontWeight: 700,
color: "yellow",
textTransform: "uppercase",
}}
>
{t(`Step ${step + 1}`)}
</Text>
</Flex>
<Flex sx={{ width: "100%" }}>{element}</Flex>
</Flex>
)}
{step === i && <Flex sx={{ width: "100%", flexWrap: "wrap", mt: ["15px", "15px", "30px"] }}>{element}</Flex>}
</Flex>
));
};
Expand Down

0 comments on commit cf61525

Please sign in to comment.