-
{t("AppName")}
-
+
+
+
+
-
+ {address ? (
+
+
+ {shortenString(address, 6, 4)}
+ {
+ disconnect(config);
+ }}
+ name="tuichu"
+ className={classes.userinfo_top_right_wallet_disconnect}
+ color={"#fff"}
+ />
+
+
+
+
+ {t("普通非活跃")}
+
+
{
+ navigate("/levelup");
+ }}
+ >
+ {t("升级")}
+
+
+
+
+ ) : (
+ <>
+
{
+ open();
+ }}
+ >
+ {t("链接钱包")}
+
+ >
+ )}
+
+
+ -
+ 20
+ {t("邀请铸造")}
+
+ -
+ 20
+ {t("团队社长")}
+
+ -
+ 3
+ {t("邀请空投")}
+
+
+
+
+
+
+ - setTabIndex(0)}
+ >
+ NFT
+
+ - setTabIndex(1)}
+ >
+ {t("代币")}
+
+
+
+
+ {tabIndex == 0 && (
+ <>
+ {address ? (
+ <>
+ {true ? (
+
+
+ # 737389
+ {
+ navigate("/mint");
+ }}
+ >
+ {t("铸造 NFT")}
+
+
+
+
+
+ {t("Min结束后按照规则进行空投。")}
+
+
+ ) : (
+
+
{
+ navigate("/mint");
+ }}
+ >
+ {t("铸造 NFT")}
+
+
+
{t("铸造 NFT 获得代币空投")}
+
+ )}
+ >
+ ) : (
+ <>
+
+ {t("钱包未链接,无法向您显示 NFT")}
+
+ >
+ )}
+ >
+ )}
+ {tabIndex == 1 && (
+
+
+ {t("资产金额 = 已领取 + 待处理")}
+
+
+
+ {
+ navigate("/assetrecord");
+ }}
+ />
+ {
+ navigate("/airdroprecord");
+ }}
+ />
+
+
+ )}
+
+
+
+
+
+ {t("邀请")}
+ {
+ navigate("/invitationlist");
+ }}
+ >
+ {t("邀请列表")}{" "}
+
+
+
+
+
+ {t("邀请链接")}
+
+ https://www.rmob_nft.com/regster=id?1{" "}
+ {
+ copyText("https://www.rmob_nft.com/regster=id?1");
+ }}
+ className={classes.invite_content_icon}
+ name="fuzhi"
+ color={"#fff"}
+ />{" "}
+
+
+
+ {t(
+ "普通会员每邀请铸造一个NFT可获得一份空投福利;推荐铸造20个NFT的可升级为会长;团队中拥有20位会长可升级为基金会社长;邀请越多级别越高福利越多。"
+ )}
+
+
+
+
+
+
{t("数据披露")}
+
+ -
+ {t("资金池")}
+ 10000
+
+ -
+ {t("社长席位")}
+ 499
+
+ -
+ {t("基金会社长席位")}
+ 19
+
+
+
>
);
}
+
+function ReceiveCom({
+ tokenName,
+ tokenNum,
+ toReceive,
+ onAssetRec,
+}: {
+ tokenName: string;
+ tokenNum: number;
+ toReceive: number;
+ onAssetRec: () => void;
+}) {
+ const { t } = useTranslation();
+ return (
+
+
+
+
+ {tokenName}
+
+
+ {tokenNum}
+
+ {
+ onAssetRec();
+ }}
+ >
+ {t("资产记录")}{" "}
+
+
+
+
+
+
+ {t("待领取")}
+ {toReceive}
+
+
{
+ Toast.show({
+ content: t("领取成功,前往钱包查看"),
+ icon: "success",
+ });
+ }}
+ >
+ {t("领取")}
+
+
+
+ );
+}
diff --git a/src/pages/InvitationList.tsx b/src/pages/InvitationList.tsx
new file mode 100644
index 0000000..cf86e5c
--- /dev/null
+++ b/src/pages/InvitationList.tsx
@@ -0,0 +1,77 @@
+/*
+ * @LastEditors: John
+ * @Date: 2024-06-19 11:03:01
+ * @LastEditTime: 2024-06-19 17:33:25
+ * @Author: John
+ */
+import { shortenString } from "@/utils";
+import Ellipsis from "antd-mobile/es/components/ellipsis";
+import DataTable, { TableColumn } from "react-data-table-component";
+import { useTranslation } from "react-i18next";
+import { useAccount } from "wagmi";
+
+interface DataRow {
+ id: number;
+ address: string;
+ level: string;
+ nft: number;
+}
+export default function () {
+ const { address } = useAccount();
+ const { t } = useTranslation();
+ const columns: TableColumn
[] = [
+ {
+ name: t("地址"),
+ selector: (row) => row.address,
+ grow: 4,
+ // cell(row, rowIndex, column, id) {
+ // return ;
+ // },
+ },
+ {
+ name: t("级别"),
+ selector: (row) => row.level,
+ grow: 4,
+ },
+ {
+ name: t("直推NFT"),
+ selector: (row) => row.nft,
+ // @ts-ignore
+ right: "true",
+ grow: 2,
+ },
+ ];
+
+ const data: DataRow[] = [
+ {
+ id: 1,
+ address: "0x1000.....2223",
+ level: t("非活跃普通"),
+ nft: 0,
+ },
+ {
+ id: 2,
+ address: "0x1000.....2223",
+ level: t("活跃普通"),
+ nft: 2,
+ },
+ {
+ id: 3,
+ address: "0x1000.....2223",
+ level: t("社长"),
+ nft: 23,
+ },
+ {
+ id: 4,
+ address: "0x1000.....2223",
+ level: t("基金会社长"),
+ nft: 50,
+ },
+ ];
+
+ return (
+ <>
+
+ >
+ );
+}
diff --git a/src/pages/LevelUp.module.css b/src/pages/LevelUp.module.css
new file mode 100644
index 0000000..db828a5
--- /dev/null
+++ b/src/pages/LevelUp.module.css
@@ -0,0 +1,302 @@
+.container {
+ padding: 0 14px;
+}
+
+.LevelUp {
+ padding-bottom: 32px;
+ .content {
+ margin-top: 16px;
+ .content_box {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+
+ .box_item {
+ /* 自动布局子元素 */
+ width: 153px;
+ height: 90px;
+ border-radius: 12px;
+ opacity: 1;
+
+ /* 自动布局 */
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ gap: 7px;
+ padding: 26px 23px;
+
+ background: #171719;
+
+ box-shadow: 0px 4px 10px 0px rgba(138, 29, 19, 0.3),
+ inset 0px 0px 6px 0px #8a1d13;
+
+ z-index: 0;
+
+ box-sizing: border-box;
+ span {
+ &:nth-of-type(1) {
+ /* 自动布局子元素 */
+ opacity: 1;
+
+ font-family: DM Sans;
+ font-size: 10px;
+ font-weight: 500;
+ line-height: normal;
+ letter-spacing: 0em;
+
+ font-variation-settings: "opsz" auto;
+ font-feature-settings: "kern" on;
+ color: #4d4d4d;
+
+ z-index: 0;
+ }
+ &:nth-of-type(2) {
+ /* 自动布局子元素 */
+ opacity: 1;
+
+ font-family: DM Sans;
+ font-size: 14px;
+ font-weight: bold;
+ line-height: normal;
+ letter-spacing: 0em;
+
+ font-variation-settings: "opsz" auto;
+ font-feature-settings: "kern" on;
+ color: #ffffff;
+
+ z-index: 1;
+ }
+ }
+ }
+
+ .box_arrow {
+ width: 24px;
+ height: 24px;
+ }
+ }
+
+ .content_price {
+ display: flex;
+ align-items: center;
+ gap: 4px;
+ margin-top: 16px;
+ padding: 0 10px;
+ span {
+ &:nth-of-type(1) {
+ /* 自动布局子元素 */
+ opacity: 1;
+
+ font-family: DM Sans;
+ font-size: 10px;
+ font-weight: 500;
+ line-height: normal;
+ letter-spacing: 0em;
+
+ font-variation-settings: "opsz" auto;
+ font-feature-settings: "kern" on;
+ color: #ffffff;
+
+ z-index: 0;
+ }
+ &:nth-of-type(2) {
+ /* 自动布局子元素 */
+ opacity: 1;
+
+ font-family: DM Sans;
+ font-size: 10px;
+ font-weight: bold;
+ line-height: normal;
+ letter-spacing: 0em;
+
+ font-variation-settings: "opsz" auto;
+ font-feature-settings: "kern" on;
+ color: #fc872b;
+
+ z-index: 1;
+ }
+ }
+ }
+
+ .content_price_des {
+ display: flex;
+ flex-direction: column;
+ gap: 4px;
+ margin-top: 10px;
+ padding: 0 10px;
+ span {
+ /* 自动布局子元素 */
+ opacity: 1;
+
+ font-family: DM Sans;
+ font-size: 10px;
+ font-weight: 500;
+ line-height: normal;
+ letter-spacing: 0em;
+
+ font-variation-settings: "opsz" auto;
+ font-feature-settings: "kern" on;
+ color: #4d4d4d;
+
+ z-index: 1;
+ }
+ }
+
+ .content_btn {
+ /* 自动布局子元素 */
+ width: 331px;
+ height: 40px;
+ border-radius: 10px;
+ opacity: 1;
+
+ /* 自动布局 */
+ display: flex;
+ flex-direction: row;
+ justify-content: center;
+ align-items: center;
+ padding: 11px 40px;
+ gap: 10px;
+
+ background: #fc872b;
+
+ z-index: 3;
+
+ box-sizing: border-box;
+
+ margin: 0 auto;
+
+ margin-top: 14px;
+
+ span {
+ /* 自动布局子元素 */
+ opacity: 1;
+
+ font-family: DM Sans;
+ font-size: 14px;
+ font-weight: 500;
+ line-height: normal;
+ text-align: center;
+ letter-spacing: 0em;
+
+ font-variation-settings: "opsz" auto;
+ font-feature-settings: "kern" on;
+ color: #ffffff;
+
+ z-index: 0;
+ }
+
+ .icon {
+ width: 16px;
+ height: 16px;
+ }
+
+ &[disabled] {
+ /* 自动布局子元素 */
+ background: #666666;
+ }
+ }
+ }
+
+ .upgrade_conditions {
+ margin-top: 26px;
+ > span {
+ /* 自动布局子元素 */
+ opacity: 1;
+
+ font-family: DM Sans;
+ font-size: 14px;
+ font-weight: bold;
+ line-height: normal;
+ letter-spacing: 0em;
+
+ font-variation-settings: "opsz" auto;
+ font-feature-settings: "kern" on;
+ color: #ffffff;
+
+ z-index: 0;
+ }
+ > ul {
+ display: flex;
+ flex-direction: column;
+ gap: 14px;
+
+ margin-top: 16px;
+ > li {
+ /* 自动布局子元素 */
+ width: 344px;
+ border-radius: 16px;
+ opacity: 1;
+
+ /* 自动布局 */
+ display: flex;
+ flex-direction: column;
+ padding: 15px 10px;
+
+ background: #171719;
+
+ z-index: 0;
+
+ gap: 10px;
+ box-sizing: border-box;
+ div {
+ display: flex;
+ align-items: center;
+ gap: 6px;
+ span {
+ &:nth-of-type(1) {
+ /* 自动布局子元素 */
+ opacity: 1;
+
+ font-family: DM Sans;
+ font-size: 12px;
+ font-weight: bold;
+ line-height: normal;
+ letter-spacing: 0em;
+
+ font-variation-settings: "opsz" auto;
+ color: #fc872b;
+
+ z-index: 0;
+ }
+ &:nth-of-type(2) {
+ /* 自动布局子元素 */
+ opacity: 1;
+
+ font-family: DM Sans;
+ font-size: 12px;
+ font-weight: 500;
+ line-height: normal;
+ letter-spacing: 0em;
+
+ font-variation-settings: "opsz" auto;
+ color: #ffffff;
+
+ z-index: 1;
+ }
+ }
+ }
+
+ > ul {
+ display: flex;
+ flex-direction: column;
+ gap: 4px;
+ li {
+ /* 自动布局子元素 */
+ opacity: 1;
+
+ font-family: DM Sans;
+ font-size: 12px;
+ font-weight: 500;
+ line-height: normal;
+ letter-spacing: 0em;
+
+ font-variation-settings: "opsz" auto;
+ font-feature-settings: "kern" on;
+ color: #eaeaea;
+
+ z-index: 0;
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/src/pages/LevelUp.tsx b/src/pages/LevelUp.tsx
new file mode 100644
index 0000000..3d2558b
--- /dev/null
+++ b/src/pages/LevelUp.tsx
@@ -0,0 +1,117 @@
+import IconFont from "@/components/iconfont";
+import classes from "./LevelUp.module.css";
+import { cn } from "@/utils";
+import Button from "antd-mobile/es/components/button";
+import Space from "antd-mobile/es/components/space";
+import { PropsWithChildren } from "react";
+import { useTranslation } from "react-i18next";
+export default function () {
+ const { t } = useTranslation();
+ return (
+ <>
+
+
+
+
+ {t("当前级别")}
+ {t("普通活跃")}
+
+
+
+ {t("提升级别")}
+ {t("社长")}
+
+
+
+
+ {t("当前升级价格:")}
+ 110 USDT
+
+
+
+ {t("价格说明:")}
+
+ {t(
+ "升级费用100USDT起,其中gas费2USDT,剩余部分50%进入资金池,另外50%平均分给所有升级成功的社长和基金会社长。自第二个社长升级开始,每升级一名社长所需铸造费用增加10%,既第二位社长升级铸造费用为100u+100*10%=110USDT,以此类推。"
+ )}
+
+
+
+
+
+
+
+
+ >
+ );
+}
+
+function ConItem({
+ memberName,
+ limitText,
+ conList,
+}: PropsWithChildren<{
+ memberName: string;
+ limitText: string;
+ conList: string[];
+}>) {
+ return (
+
+
+ {memberName}
+ {limitText}
+
+
+ {conList.map((v, i) => (
+ - {v}
+ ))}
+
+
+ );
+}
diff --git a/src/pages/Mint.module.css b/src/pages/Mint.module.css
new file mode 100644
index 0000000..55660bb
--- /dev/null
+++ b/src/pages/Mint.module.css
@@ -0,0 +1,172 @@
+.container {
+ padding: 0 14px;
+}
+.Mint {
+ display: flex;
+ flex-direction: column;
+ gap: 18px;
+ .nftImg {
+ width: 345px;
+ height: 190px;
+ border-radius: 10px;
+ opacity: 1;
+ background: #171719;
+ box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.16),
+ 0px 3px 6px 0px rgba(0, 0, 0, 0.23);
+ padding: 8px;
+ box-sizing: border-box;
+
+ margin-top: 17px;
+ img {
+ width: 100%;
+ height: 100%;
+ border-radius: 10px;
+ opacity: 1;
+ object-fit: cover;
+ }
+ }
+
+ > ul {
+ display: flex;
+ flex-direction: column;
+ gap: 10px;
+
+ padding: 0 7px;
+
+ li {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ span {
+ &:nth-of-type(1) {
+ /* 自动布局子元素 */
+ opacity: 1;
+
+ font-family: DM Sans;
+ font-size: 14px;
+ font-weight: 500;
+ line-height: normal;
+ letter-spacing: 0em;
+
+ font-variation-settings: "opsz" auto;
+ font-feature-settings: "kern" on;
+ color: #ffffff;
+
+ z-index: 0;
+ }
+
+ &:nth-of-type(2) {
+ /* 自动布局子元素 */
+ opacity: 1;
+
+ font-family: DM Sans;
+ font-size: 16px;
+ font-weight: bold;
+ line-height: normal;
+ letter-spacing: 0em;
+
+ font-variation-settings: "opsz" auto;
+ font-feature-settings: "kern" on;
+ color: #ffffff;
+
+ z-index: 1;
+ }
+ }
+ }
+ }
+
+ .des {
+ display: flex;
+ flex-direction: column;
+ gap: 6px;
+
+ padding: 0 7px;
+ span {
+ &:nth-of-type(1) {
+ /* 自动布局子元素 */
+ opacity: 1;
+
+ font-family: DM Sans;
+ font-size: 14px;
+ font-weight: 500;
+ line-height: normal;
+ letter-spacing: 0em;
+
+ font-variation-settings: "opsz" auto;
+ font-feature-settings: "kern" on;
+ color: #ffffff;
+
+ z-index: 0;
+ }
+
+ &:nth-of-type(2) {
+ /* 自动布局子元素 */
+ opacity: 1;
+
+ font-family: DM Sans;
+ font-size: 14px;
+ font-weight: 500;
+ line-height: normal;
+ letter-spacing: 0em;
+
+ font-variation-settings: "opsz" auto;
+ font-feature-settings: "kern" on;
+ color: #eaeaea;
+
+ z-index: 1;
+ }
+ }
+ }
+
+ .btn {
+ /* 自动布局子元素 */
+ width: 331px;
+ height: 40px;
+ border-radius: 10px;
+ opacity: 1;
+
+ /* 自动布局 */
+ display: flex;
+ flex-direction: row;
+ justify-content: center;
+ align-items: center;
+ padding: 11px 40px;
+ gap: 10px;
+
+ background: #fc872b;
+
+ z-index: 3;
+
+ box-sizing: border-box;
+
+ margin: 0 auto;
+
+ span {
+ /* 自动布局子元素 */
+ opacity: 1;
+
+ font-family: DM Sans;
+ font-size: 14px;
+ font-weight: 500;
+ line-height: normal;
+ text-align: center;
+ letter-spacing: 0em;
+
+ font-variation-settings: "opsz" auto;
+ font-feature-settings: "kern" on;
+ color: #ffffff;
+
+ z-index: 0;
+ }
+
+ .icon {
+ width: 16px;
+ height: 16px;
+ }
+
+ &[disabled] {
+ /* 自动布局子元素 */
+ background: #666666;
+ }
+ }
+}
diff --git a/src/pages/Mint.tsx b/src/pages/Mint.tsx
new file mode 100644
index 0000000..f7e735d
--- /dev/null
+++ b/src/pages/Mint.tsx
@@ -0,0 +1,58 @@
+/*
+ * @LastEditors: John
+ * @Date: 2024-06-18 15:28:03
+ * @LastEditTime: 2024-06-19 14:06:59
+ * @Author: John
+ */
+import { cn } from "@/utils";
+import classes from "./Mint.module.css";
+import nft_bg from "@/assets/nft_bg.svg";
+import Button from "antd-mobile/es/components/button";
+import Space from "antd-mobile/es/components/space";
+import { useTranslation } from "react-i18next";
+export default function () {
+ const { t } = useTranslation();
+ return (
+ <>
+
+
+
+
+
+
+ -
+ {t("NFT总量:")}
+ 20000
+
+
+ -
+ {t("MINT余量:")}
+ 15000
+
+
+ -
+ {t("当前MINT价格:")}
+ 110 USDT
+
+
+
+
+ {t("价格说明:")}
+
+ {t(
+ "100USDT起,每增加100名普通会员,NFT价格上涨1%,既:前100名价格为100USDT/枚,101-200名价格为100u+100u*1%=101USDT/枚,以此类推。"
+ )}
+
+
+
+
+
+ >
+ );
+}
diff --git a/src/store/User.ts b/src/store/User.ts
index 6556e92..66031db 100644
--- a/src/store/User.ts
+++ b/src/store/User.ts
@@ -1,16 +1,19 @@
/*
* @LastEditors: John
* @Date: 2024-06-17 17:45:43
- * @LastEditTime: 2024-06-17 17:57:42
+ * @LastEditTime: 2024-06-19 16:26:24
* @Author: John
*/
-import { ASYNC_STORAGE_KEY } from "@/constants";
+import { ASYNC_STORAGE_KEY, Lang } from "@/constants";
import { create } from "zustand";
import { createJSONStorage, persist } from "zustand/middleware";
interface UserState {
Token: string;
UpdateToken: (t: string) => void;
+
+ Lang: Lang;
+ UpdateLang: (l: Lang) => void;
}
export const useUserStore = create()(
@@ -18,9 +21,12 @@ export const useUserStore = create()(
(set, _get) => ({
Token: "",
UpdateToken: (t) => set({ Token: t }),
+
+ Lang: Lang.en,
+ UpdateLang: (l) => set({ Lang: l }),
}),
{
- name: ASYNC_STORAGE_KEY.Token, // name of item in the storage (must be unique)
+ name: ASYNC_STORAGE_KEY.Store, // name of item in the storage (must be unique)
storage: createJSONStorage(() => localStorage), // (optional) by default the 'localStorage' is used
}
)
diff --git a/src/style/ant-cover-m.css b/src/style/ant-cover-m.css
new file mode 100644
index 0000000..03be39d
--- /dev/null
+++ b/src/style/ant-cover-m.css
@@ -0,0 +1,258 @@
+.adm-tabs {
+ .adm-tabs-header {
+ border-bottom: 0.25px solid #333333;
+
+ .adm-tabs-tab-line {
+ background-color: #fc872b;
+ }
+
+ .adm-tabs-tab {
+ opacity: 1;
+
+ font-family: DM Sans;
+ font-size: 14px;
+ font-weight: 500;
+ line-height: normal;
+ letter-spacing: 0em;
+
+ font-variation-settings: "opsz" auto;
+ font-feature-settings: "kern" on;
+ color: #666666;
+ padding-bottom: 4px;
+ &.adm-tabs-tab-active {
+ color: #ffffff;
+ }
+ }
+ }
+ .adm-tabs-content {
+ padding: 0;
+ }
+}
+
+.adm-capsule-tabs {
+ .adm-capsule-tabs-header {
+ padding: 0px 15px;
+ border-bottom: none;
+ margin-top: 20px;
+
+ .adm-scroll-mask {
+ opacity: 0 !important;
+ }
+
+ .adm-capsule-tabs-tab-list {
+ gap: 8px;
+ .adm-capsule-tabs-tab-wrapper {
+ padding: 0;
+
+ .adm-capsule-tabs-tab {
+ /* 自动布局子元素 */
+ height: 25px;
+ border-radius: 8px;
+ opacity: 1;
+
+ box-sizing: border-box;
+ border: 1px solid #fc872b;
+
+ z-index: 1;
+ background-color: transparent;
+
+ /* 自动布局子元素 */
+ opacity: 1;
+
+ font-family: DM Sans;
+ font-size: 10px;
+ font-weight: 500;
+ line-height: 25px;
+ letter-spacing: 0em;
+
+ font-variation-settings: "opsz" auto;
+ font-feature-settings: "kern" on;
+ color: #ffffff;
+
+ z-index: 0;
+
+ padding: 0 14px;
+ }
+
+ .adm-capsule-tabs-tab-active {
+ /* 自动布局子元素 */
+ height: 25px;
+ border-radius: 8px;
+ opacity: 1;
+
+ background: #fc872b;
+
+ z-index: 0;
+
+ /* 自动布局子元素 */
+ opacity: 1;
+
+ font-family: DM Sans;
+ font-size: 10px;
+ font-weight: 500;
+ line-height: 25px;
+ letter-spacing: 0em;
+
+ font-variation-settings: "opsz" auto;
+ font-feature-settings: "kern" on;
+ color: #ffffff;
+
+ z-index: 0;
+ }
+ }
+ }
+ }
+}
+
+/* picker */
+.adm-picker-popup {
+ .adm-picker-header {
+ border-bottom: 1px solid #404040;
+ .adm-picker-header-title {
+ opacity: 1;
+
+ font-family: DM Sans;
+ font-size: 17px;
+ font-weight: bold;
+ line-height: 24px;
+ letter-spacing: 0px;
+
+ font-variation-settings: "opsz" auto;
+ font-feature-settings: "kern" on;
+ color: #ffffff;
+ }
+ .adm-picker-header-button {
+ opacity: 1;
+
+ font-family: DM Sans;
+ font-size: 17px;
+ font-weight: 500;
+ line-height: 24px;
+ letter-spacing: 0px;
+
+ font-variation-settings: "opsz" auto;
+ font-feature-settings: "kern" on;
+ color: #1890ff;
+ }
+ }
+ .adm-popup-body {
+ background-color: #000000;
+ .adm-picker {
+ /* height: 280px; */
+ .adm-picker-body {
+ .adm-picker-view {
+ background-color: #000000;
+ .adm-picker-view-column {
+ .adm-picker-view-column-wheel {
+ .adm-picker-view-column-item {
+ /* height: 34px; */
+ .adm-picker-view-column-item-label {
+ /* font-family: DM Sans;
+ font-size: 16px;
+ font-weight: 500;
+ line-height: 34px;
+ text-align: center;
+ letter-spacing: 0px;
+
+ font-variation-settings: "opsz" auto; */
+ color: #ffffff;
+ }
+ }
+ }
+ }
+ .adm-picker-view-mask {
+ .adm-picker-view-mask-top,
+ .adm-picker-view-mask-bottom {
+ background-color: #000000;
+ }
+ .adm-picker-view-mask-middle {
+ /* height: 34px; */
+ border-top: 1px solid #404040;
+ border-bottom: 1px solid #404040;
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+/* toast */
+.adm-toast-main {
+ min-width: 170px !important;
+ min-height: 40px !important;
+ max-width: 320px !important;
+ max-height: max-content !important;
+ border-radius: 10px !important;
+ opacity: 1;
+
+ /* 自动布局 */
+ padding: 11px 20px !important;
+
+ /* background: rgba(252, 135, 43, 0.5) !important; */
+
+ box-sizing: border-box !important;
+ border: 1px solid #fc872b !important;
+
+ /* backdrop-filter: blur(10px); */
+
+ .adm-auto-center-content {
+ /* 自动布局子元素 */
+ opacity: 1;
+
+ font-family: DM Sans;
+ font-size: 14px;
+ font-weight: 500;
+ line-height: normal;
+ letter-spacing: 0px;
+
+ font-variation-settings: "opsz" auto;
+ color: #ffffff;
+
+ z-index: 0;
+ }
+}
+
+.adm-popover-menu {
+ .adm-popover-arrow {
+ color: rgba(42, 42, 42, 0.6) !important;
+ }
+ .adm-popover-inner {
+ background: rgba(42, 42, 42, 0.6);
+
+ box-sizing: border-box;
+ border-image: radial-gradient(
+ 103% 103% at 50% 50%,
+ #a41914 0%,
+ rgba(164, 25, 20, 0) 100%
+ );
+
+ backdrop-filter: blur(10px);
+
+ .adm-popover-menu-item {
+ padding: 0 10px;
+ background-color: transparent !important;
+ &::after {
+ display: none !important;
+ }
+
+ .adm-popover-menu-item-text {
+ /* 自动布局子元素 */
+ opacity: 1;
+
+ font-family: DM Sans;
+ font-size: 14px;
+ font-weight: normal;
+ line-height: normal;
+ text-transform: capitalize;
+ letter-spacing: 0em;
+
+ color: #ffffff;
+
+ z-index: 0;
+ padding: 10px 0;
+ border-top: 1px solid #3d3d3d;
+ }
+ }
+ }
+}
diff --git a/src/style/react-data-table-component-cover-m.css b/src/style/react-data-table-component-cover-m.css
new file mode 100644
index 0000000..12f3c9f
--- /dev/null
+++ b/src/style/react-data-table-component-cover-m.css
@@ -0,0 +1,54 @@
+.rdt_Table {
+ width: 100vw !important;
+ background-color: transparent !important;
+ padding: 0 14px;
+
+ .rdt_TableHead {
+ .rdt_TableHeadRow {
+ height: 16px !important;
+ min-height: 16px !important;
+ background-color: transparent !important;
+
+ .rdt_TableCol {
+ div {
+ opacity: 1;
+
+ font-family: DM Sans;
+ font-size: 12px;
+ font-weight: 500;
+ line-height: normal;
+ letter-spacing: 0em;
+
+ font-variation-settings: "opsz" auto;
+ font-feature-settings: "kern" on;
+ color: #eaeaea;
+ }
+ }
+ }
+ }
+
+ .rdt_TableBody {
+ gap: 10px;
+ margin-top: 14px;
+ .rdt_TableRow {
+ height: 18px !important;
+ min-height: 18px !important;
+ background-color: transparent !important;
+ .rdt_TableCell {
+ div {
+ opacity: 1;
+
+ font-family: DM Sans;
+ font-size: 14px;
+ font-weight: bold;
+ line-height: normal;
+ letter-spacing: 0em;
+
+ font-variation-settings: "opsz" auto;
+ font-feature-settings: "kern" on;
+ color: #ffffff;
+ }
+ }
+ }
+ }
+}
diff --git a/src/utils/index.ts b/src/utils/index.ts
index 78b2b27..c08f2dc 100644
--- a/src/utils/index.ts
+++ b/src/utils/index.ts
@@ -1,11 +1,13 @@
/*
* @LastEditors: John
* @Date: 2024-06-17 18:19:27
- * @LastEditTime: 2024-06-18 10:48:05
+ * @LastEditTime: 2024-06-19 17:07:43
* @Author: John
*/
-
+import { type ClassValue, clsx } from "clsx";
+import { twMerge } from "tailwind-merge";
import Toast from "antd-mobile/es/components/toast";
+import i18next from "i18next";
export const ua = navigator.userAgent;
export const isIOS = /iphone|ipad|ipod|ios/i.test(ua);
@@ -72,8 +74,12 @@ export function copyText(text: string) {
isCopySuccess &&
Toast.show({
icon: "success",
- content: "Copy successful",
+ content: i18next.t("复制成功"),
});
// 8、 销毁DOM
document.body.removeChild(input);
}
+
+export function cn(...inputs: ClassValue[]) {
+ return twMerge(clsx(inputs));
+}
diff --git a/src/utils/wallet.ts b/src/utils/wallet.ts
new file mode 100644
index 0000000..e3c3774
--- /dev/null
+++ b/src/utils/wallet.ts
@@ -0,0 +1,57 @@
+/*
+ * @LastEditors: John
+ * @Date: 2024-06-19 15:55:07
+ * @LastEditTime: 2024-06-19 15:56:45
+ * @Author: John
+ */
+import { config } from "@/components/WalletProvider";
+import {
+ writeContract,
+ readContract,
+ estimateGas,
+ waitForTransactionReceipt,
+ getConnectorClient,
+ getChains,
+ switchChain,
+ getChainId,
+} from "@wagmi/core";
+
+/**
+ * @description: 检测网络并切换
+ * @return {*}
+ */
+export function checkNetWork(): Promise {
+ return new Promise(async (reslove, reject) => {
+ // TODO 切换网络✔
+ const chains = getChains(config);
+ let chainId = getChainId(config);
+ // console.log("all chains:", chains);
+ console.log("current chain id:", chainId);
+ let netWork = chains.find(
+ (v) => v.id == import.meta.env.VITE_PARTICIPATE_CHAIN_ID
+ );
+ console.log("participate network:", netWork);
+ if (chainId != netWork?.id && netWork) {
+ try {
+ await switchChain(config, {
+ chainId: netWork.id,
+ });
+
+ const timer = setInterval(() => {
+ chainId = getChainId(config);
+ console.log("current chain id:", chainId);
+ if (chainId == netWork?.id) {
+ console.log("switch chain success!");
+ reslove();
+ clearInterval(timer);
+ }
+ }, 1000);
+ } catch (error) {
+ // TODO 切换网络失败,自动添加网络✔
+ console.error("switch chain error:", error);
+ }
+ } else {
+ reslove();
+ }
+ });
+}
diff --git a/src/vite-env.d.ts b/src/vite-env.d.ts
index e4a2a41..171ee5d 100644
--- a/src/vite-env.d.ts
+++ b/src/vite-env.d.ts
@@ -2,6 +2,9 @@
interface ImportMetaEnv {
readonly VITE_BASE_API_URL: string;
+ readonly VITE_PARTICIPATE_CHAIN_ID: number;
+ readonly VITE_NETWORK_USDT_ADDRESS: `0x${string}`;
+ readonly VITE_CHECK_TRANSACTION_DETAILS_URL: string;
// 更多环境变量...
readonly MODE: "development" | "production" | "test";
}
diff --git a/vite.config.ts b/vite.config.ts
index 85f39b3..c3f9fea 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -1,3 +1,9 @@
+/*
+ * @LastEditors: John
+ * @Date: 2024-06-17 17:20:03
+ * @LastEditTime: 2024-06-19 17:41:43
+ * @Author: John
+ */
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import path from "path";
@@ -6,6 +12,9 @@ import { nodePolyfills } from "vite-plugin-node-polyfills";
// https://vitejs.dev/config/
export default defineConfig({
+ server: {
+ host: "192.168.10.167",
+ },
plugins: [
react(),
viteCompression({ deleteOriginFile: false }),
diff --git a/yarn.lock b/yarn.lock
index 673e775..744bc21 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -240,7 +240,7 @@ __metadata:
languageName: node
linkType: hard
-"@babel/runtime@npm:^7.18.0, @babel/runtime@npm:^7.18.3, @babel/runtime@npm:^7.19.4, @babel/runtime@npm:^7.20.6, @babel/runtime@npm:^7.21.0, @babel/runtime@npm:^7.23.2, @babel/runtime@npm:^7.23.9":
+"@babel/runtime@npm:^7.17.2, @babel/runtime@npm:^7.18.0, @babel/runtime@npm:^7.18.3, @babel/runtime@npm:^7.19.4, @babel/runtime@npm:^7.20.6, @babel/runtime@npm:^7.21.0, @babel/runtime@npm:^7.23.2, @babel/runtime@npm:^7.23.9, @babel/runtime@npm:^7.24.1":
version: 7.24.7
resolution: "@babel/runtime@npm:7.24.7"
dependencies:
@@ -321,6 +321,29 @@ __metadata:
languageName: node
linkType: hard
+"@emotion/is-prop-valid@npm:1.2.2":
+ version: 1.2.2
+ resolution: "@emotion/is-prop-valid@npm:1.2.2"
+ dependencies:
+ "@emotion/memoize": "npm:^0.8.1"
+ checksum: 10c0/bb1530dcb4e0e5a4fabb219279f2d0bc35796baf66f6241f98b0d03db1985c890a8cafbea268e0edefd5eeda143dbd5c09a54b5fba74cee8c69b98b13194af50
+ languageName: node
+ linkType: hard
+
+"@emotion/memoize@npm:^0.8.1":
+ version: 0.8.1
+ resolution: "@emotion/memoize@npm:0.8.1"
+ checksum: 10c0/dffed372fc3b9fa2ba411e76af22b6bb686fb0cb07694fdfaa6dd2baeb0d5e4968c1a7caa472bfcf06a5997d5e7c7d16b90e993f9a6ffae79a2c3dbdc76dfe78
+ languageName: node
+ linkType: hard
+
+"@emotion/unitless@npm:0.8.1":
+ version: 0.8.1
+ resolution: "@emotion/unitless@npm:0.8.1"
+ checksum: 10c0/a1ed508628288f40bfe6dd17d431ed899c067a899fa293a13afe3aed1d70fac0412b8a215fafab0b42829360db687fecd763e5f01a64ddc4a4b58ec3112ff548
+ languageName: node
+ linkType: hard
+
"@esbuild/aix-ppc64@npm:0.21.5":
version: 0.21.5
resolution: "@esbuild/aix-ppc64@npm:0.21.5"
@@ -1884,6 +1907,13 @@ __metadata:
languageName: node
linkType: hard
+"@types/stylis@npm:4.2.5":
+ version: 4.2.5
+ resolution: "@types/stylis@npm:4.2.5"
+ checksum: 10c0/23f5b35a3a04f6bb31a29d404fa1bc8e0035fcaff2356b4047743a057e0c37b2eba7efe14d57dd2b95b398cea3bac294d9c6cd93ed307d8c0b7f5d282224b469
+ languageName: node
+ linkType: hard
+
"@types/trusted-types@npm:^2.0.2":
version: 2.0.7
resolution: "@types/trusted-types@npm:2.0.7"
@@ -3190,6 +3220,13 @@ __metadata:
languageName: node
linkType: hard
+"camelize@npm:^1.0.0":
+ version: 1.0.1
+ resolution: "camelize@npm:1.0.1"
+ checksum: 10c0/4c9ac55efd356d37ac483bad3093758236ab686192751d1c9daa43188cc5a07b09bd431eb7458a4efd9ca22424bba23253e7b353feb35d7c749ba040de2385fb
+ languageName: node
+ linkType: hard
+
"caniuse-lite@npm:^1.0.30001599, caniuse-lite@npm:^1.0.30001629":
version: 1.0.30001636
resolution: "caniuse-lite@npm:1.0.30001636"
@@ -3334,6 +3371,13 @@ __metadata:
languageName: node
linkType: hard
+"clsx@npm:^2.1.1":
+ version: 2.1.1
+ resolution: "clsx@npm:2.1.1"
+ checksum: 10c0/c4c8eb865f8c82baab07e71bfa8897c73454881c4f99d6bc81585aecd7c441746c1399d08363dc096c550cceaf97bd4ce1e8854e1771e9998d9f94c4fe075839
+ languageName: node
+ linkType: hard
+
"color-convert@npm:^1.9.0":
version: 1.9.3
resolution: "color-convert@npm:1.9.3"
@@ -3422,6 +3466,20 @@ __metadata:
languageName: node
linkType: hard
+"copy-text-to-clipboard@npm:^3.0.1":
+ version: 3.2.0
+ resolution: "copy-text-to-clipboard@npm:3.2.0"
+ checksum: 10c0/d60fdadc59d526e19d56ad23cec2b292d33c771a5091621bd322d138804edd3c10eb2367d46ec71b39f5f7f7116a2910b332281aeb36a5b679199d746a8a5381
+ languageName: node
+ linkType: hard
+
+"core-js@npm:^3.11.0":
+ version: 3.37.1
+ resolution: "core-js@npm:3.37.1"
+ checksum: 10c0/440eb51a7a39128a320225fe349f870a3641b96c9ecd26470227db730ef8c161ea298eaea621db66ec0ff622a85299efb4e23afebf889c0a1748616102307675
+ languageName: node
+ linkType: hard
+
"core-util-is@npm:~1.0.0":
version: 1.0.3
resolution: "core-util-is@npm:1.0.3"
@@ -3542,7 +3600,25 @@ __metadata:
languageName: node
linkType: hard
-"csstype@npm:^3.0.2":
+"css-color-keywords@npm:^1.0.0":
+ version: 1.0.0
+ resolution: "css-color-keywords@npm:1.0.0"
+ checksum: 10c0/af205a86c68e0051846ed91eb3e30b4517e1904aac040013ff1d742019b3f9369ba5658ba40901dbbc121186fc4bf0e75a814321cc3e3182fbb2feb81c6d9cb7
+ languageName: node
+ linkType: hard
+
+"css-to-react-native@npm:3.2.0":
+ version: 3.2.0
+ resolution: "css-to-react-native@npm:3.2.0"
+ dependencies:
+ camelize: "npm:^1.0.0"
+ css-color-keywords: "npm:^1.0.0"
+ postcss-value-parser: "npm:^4.0.2"
+ checksum: 10c0/fde850a511d5d3d7c55a1e9b8ed26b69a8ad4868b3487e36ebfbfc0b96fc34bc977d9cd1d61a289d0c74d3f9a662d8cee297da53d4433bf2e27d6acdff8e1003
+ languageName: node
+ linkType: hard
+
+"csstype@npm:3.1.3, csstype@npm:^3.0.2":
version: 3.1.3
resolution: "csstype@npm:3.1.3"
checksum: 10c0/80c089d6f7e0c5b2bd83cf0539ab41474198579584fa10d86d0cafe0642202343cbc119e076a0b1aece191989477081415d66c9fefbf3c957fc2fc4b7009f248
@@ -5793,6 +5869,13 @@ __metadata:
languageName: node
linkType: hard
+"mutation-observer@npm:^1.0.3":
+ version: 1.0.3
+ resolution: "mutation-observer@npm:1.0.3"
+ checksum: 10c0/2f010fdec4b860a6576558013bcaa691c4912e287ea1dc99ea3b9360b52586267b291e7a2a88c0f2a9b399b4ef1e116ce8c0f839f88d2d7c9b4323fb0badc321
+ languageName: node
+ linkType: hard
+
"nano-memoize@npm:^3.0.16":
version: 3.0.16
resolution: "nano-memoize@npm:3.0.16"
@@ -6405,13 +6488,24 @@ __metadata:
languageName: node
linkType: hard
-"postcss-value-parser@npm:^4.2.0":
+"postcss-value-parser@npm:^4.0.2, postcss-value-parser@npm:^4.2.0":
version: 4.2.0
resolution: "postcss-value-parser@npm:4.2.0"
checksum: 10c0/f4142a4f56565f77c1831168e04e3effd9ffcc5aebaf0f538eee4b2d465adfd4b85a44257bb48418202a63806a7da7fe9f56c330aebb3cac898e46b4cbf49161
languageName: node
linkType: hard
+"postcss@npm:8.4.38, postcss@npm:^8.2.6, postcss@npm:^8.4.38":
+ version: 8.4.38
+ resolution: "postcss@npm:8.4.38"
+ dependencies:
+ nanoid: "npm:^3.3.7"
+ picocolors: "npm:^1.0.0"
+ source-map-js: "npm:^1.2.0"
+ checksum: 10c0/955407b8f70cf0c14acf35dab3615899a2a60a26718a63c848cf3c29f2467b0533991b985a2b994430d890bd7ec2b1963e36352b0774a19143b5f591540f7c06
+ languageName: node
+ linkType: hard
+
"postcss@npm:^7.0.27":
version: 7.0.39
resolution: "postcss@npm:7.0.39"
@@ -6422,17 +6516,6 @@ __metadata:
languageName: node
linkType: hard
-"postcss@npm:^8.2.6, postcss@npm:^8.4.38":
- version: 8.4.38
- resolution: "postcss@npm:8.4.38"
- dependencies:
- nanoid: "npm:^3.3.7"
- picocolors: "npm:^1.0.0"
- source-map-js: "npm:^1.2.0"
- checksum: 10c0/955407b8f70cf0c14acf35dab3615899a2a60a26718a63c848cf3c29f2467b0533991b985a2b994430d890bd7ec2b1963e36352b0774a19143b5f591540f7c06
- languageName: node
- linkType: hard
-
"preact@npm:^10.16.0":
version: 10.22.0
resolution: "preact@npm:10.22.0"
@@ -6671,6 +6754,21 @@ __metadata:
languageName: node
linkType: hard
+"react-data-table-component@npm:^7.6.2":
+ version: 7.6.2
+ resolution: "react-data-table-component@npm:7.6.2"
+ dependencies:
+ deepmerge: "npm:^4.3.1"
+ peerDependencies:
+ react: ">= 16.8.3"
+ styled-components: ">= 5.0.0"
+ peerDependenciesMeta:
+ styled-components:
+ optional: false
+ checksum: 10c0/870ac972362c8144efea9e1841f01276a5a5af59334a7bc955fc4a07a244ba2933fd67026ec253e2ece29bb57f69edcfdab573d524b89cb56aa780a6a4e4540f
+ languageName: node
+ linkType: hard
+
"react-dom@npm:^18.2.0":
version: 18.3.1
resolution: "react-dom@npm:18.3.1"
@@ -6861,6 +6959,7 @@ __metadata:
"@web3modal/wagmi": "npm:^5.0.2"
antd-mobile: "npm:^5.36.1"
autoprefixer: "npm:^10.4.19"
+ clsx: "npm:^2.1.1"
eslint: "npm:^8.57.0"
eslint-plugin-react-hooks: "npm:^4.6.0"
eslint-plugin-react-refresh: "npm:^0.4.6"
@@ -6869,11 +6968,15 @@ __metadata:
postcss: "npm:^8.4.38"
postcss-pxtorem: "npm:5.1.1"
react: "npm:^18.2.0"
+ react-data-table-component: "npm:^7.6.2"
react-dom: "npm:^18.2.0"
react-i18next: "npm:^14.1.2"
react-iconfont-cli: "npm:^2.0.2"
react-router-dom: "npm:^6.23.1"
+ styled-components: "npm:^6.1.11"
+ tailwind-merge: "npm:^2.3.0"
typescript: "npm:^5.2.2"
+ vconsole: "npm:^3.15.1"
viem: "npm:^2.14.2"
vite: "npm:^5.2.0"
vite-plugin-compression: "npm:^0.5.1"
@@ -7198,6 +7301,13 @@ __metadata:
languageName: node
linkType: hard
+"shallowequal@npm:1.1.0":
+ version: 1.1.0
+ resolution: "shallowequal@npm:1.1.0"
+ checksum: 10c0/b926efb51cd0f47aa9bc061add788a4a650550bbe50647962113a4579b60af2abe7b62f9b02314acc6f97151d4cf87033a2b15fc20852fae306d1a095215396c
+ languageName: node
+ linkType: hard
+
"shebang-command@npm:^2.0.0":
version: 2.0.0
resolution: "shebang-command@npm:2.0.0"
@@ -7474,6 +7584,33 @@ __metadata:
languageName: node
linkType: hard
+"styled-components@npm:^6.1.11":
+ version: 6.1.11
+ resolution: "styled-components@npm:6.1.11"
+ dependencies:
+ "@emotion/is-prop-valid": "npm:1.2.2"
+ "@emotion/unitless": "npm:0.8.1"
+ "@types/stylis": "npm:4.2.5"
+ css-to-react-native: "npm:3.2.0"
+ csstype: "npm:3.1.3"
+ postcss: "npm:8.4.38"
+ shallowequal: "npm:1.1.0"
+ stylis: "npm:4.3.2"
+ tslib: "npm:2.6.2"
+ peerDependencies:
+ react: ">= 16.8.0"
+ react-dom: ">= 16.8.0"
+ checksum: 10c0/1d149a51d24f779bba700c8c23ec0538b2d2b57745ccd49d1cfdc2dfce8bcea21e8ff81fed1143d1b35d127cc591717a398da72ea6671abbf705432b13e59e56
+ languageName: node
+ linkType: hard
+
+"stylis@npm:4.3.2":
+ version: 4.3.2
+ resolution: "stylis@npm:4.3.2"
+ checksum: 10c0/0410e1404cbeee3388a9e17587875211ce2f014c8379af0d1e24ca55878867c9f1ccc7b0ce9a156ca53f5d6e301391a82b0645522a604674a378b3189a4a1994
+ languageName: node
+ linkType: hard
+
"superstruct@npm:^1.0.3":
version: 1.0.4
resolution: "superstruct@npm:1.0.4"
@@ -7513,6 +7650,15 @@ __metadata:
languageName: node
linkType: hard
+"tailwind-merge@npm:^2.3.0":
+ version: 2.3.0
+ resolution: "tailwind-merge@npm:2.3.0"
+ dependencies:
+ "@babel/runtime": "npm:^7.24.1"
+ checksum: 10c0/5ea308e23c3ab1cf4c3f35f0a471753f4d3ed232d63dd7c09151a74428737321902203d90e9f0cb76ea5c3978e71b0adbc503dc455e56cda967a7674ae4b94b5
+ languageName: node
+ linkType: hard
+
"tar@npm:^6.1.11, tar@npm:^6.1.2":
version: 6.2.1
resolution: "tar@npm:6.2.1"
@@ -7591,6 +7737,13 @@ __metadata:
languageName: node
linkType: hard
+"tslib@npm:2.6.2":
+ version: 2.6.2
+ resolution: "tslib@npm:2.6.2"
+ checksum: 10c0/e03a8a4271152c8b26604ed45535954c0a45296e32445b4b87f8a5abdb2421f40b59b4ca437c4346af0f28179780d604094eb64546bee2019d903d01c6c19bdb
+ languageName: node
+ linkType: hard
+
"tslib@npm:^2.0.0, tslib@npm:^2.3.1, tslib@npm:^2.4.1, tslib@npm:^2.5.0":
version: 2.6.3
resolution: "tslib@npm:2.6.3"
@@ -7921,6 +8074,18 @@ __metadata:
languageName: node
linkType: hard
+"vconsole@npm:^3.15.1":
+ version: 3.15.1
+ resolution: "vconsole@npm:3.15.1"
+ dependencies:
+ "@babel/runtime": "npm:^7.17.2"
+ copy-text-to-clipboard: "npm:^3.0.1"
+ core-js: "npm:^3.11.0"
+ mutation-observer: "npm:^1.0.3"
+ checksum: 10c0/1e62132b719e324eb7d533c94f38e9db288a9d0c9e85c8752ba742adee4e5925df10d4b43d05ba0cd264d99c32817f9f9c8f24fe391a7d8837469bd318d1b2ac
+ languageName: node
+ linkType: hard
+
"viem@npm:^1.0.0, viem@npm:^1.1.4":
version: 1.21.4
resolution: "viem@npm:1.21.4"