create-dubhe 0.1.6 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +1 -1
- package/package.json +11 -3
- package/template/101/aptos-template/.prettierignore +1 -0
- package/template/101/aptos-template/.prettierrc +7 -7
- package/template/101/aptos-template/.prettierrc.json +8 -0
- package/template/101/aptos-template/README.md +3 -2
- package/template/101/aptos-template/jest.config.ts +3 -3
- package/template/101/aptos-template/next-i18next.config.js +4 -4
- package/template/101/aptos-template/next.config.js +11 -12
- package/template/101/aptos-template/package.json +10 -5
- package/template/101/aptos-template/postcss.config.js +1 -1
- package/template/101/aptos-template/public/locales/de/common.json +1 -1
- package/template/101/aptos-template/public/locales/de/footer.json +1 -1
- package/template/101/aptos-template/public/locales/de/second-page.json +1 -1
- package/template/101/aptos-template/public/locales/en/footer.json +1 -1
- package/template/101/aptos-template/public/locales/en/second-page.json +1 -1
- package/template/101/aptos-template/public/locales/zn/common.json +1 -1
- package/template/101/aptos-template/public/locales/zn/footer.json +1 -1
- package/template/101/aptos-template/public/locales/zn/second-page.json +1 -1
- package/template/101/aptos-template/scripts/checkBalance.ts +1 -1
- package/template/101/aptos-template/src/css/font-awesome.css +692 -687
- package/template/101/aptos-template/src/css/font-awesome.min.css +2333 -1
- package/template/101/aptos-template/tailwind.config.js +40 -52
- package/template/101/initia-template/.prettierignore +1 -0
- package/template/101/initia-template/.prettierrc +7 -7
- package/template/101/initia-template/.prettierrc.json +8 -0
- package/template/101/initia-template/README.md +3 -2
- package/template/101/initia-template/jest.config.ts +3 -3
- package/template/101/initia-template/next-i18next.config.js +4 -4
- package/template/101/initia-template/next.config.js +11 -12
- package/template/101/initia-template/package.json +8 -3
- package/template/101/initia-template/postcss.config.js +1 -1
- package/template/101/initia-template/public/locales/de/common.json +1 -1
- package/template/101/initia-template/public/locales/de/footer.json +1 -1
- package/template/101/initia-template/public/locales/de/second-page.json +1 -1
- package/template/101/initia-template/public/locales/en/footer.json +1 -1
- package/template/101/initia-template/public/locales/en/second-page.json +1 -1
- package/template/101/initia-template/public/locales/zn/common.json +1 -1
- package/template/101/initia-template/public/locales/zn/footer.json +1 -1
- package/template/101/initia-template/public/locales/zn/second-page.json +1 -1
- package/template/101/initia-template/src/chain/config.ts +1 -1
- package/template/101/initia-template/src/css/font-awesome.css +692 -687
- package/template/101/initia-template/src/css/font-awesome.min.css +2333 -1
- package/template/101/initia-template/src/pages/index.tsx +7 -9
- package/template/101/initia-template/tailwind.config.js +40 -52
- package/template/101/movement-template/.prettierignore +1 -0
- package/template/101/movement-template/.prettierrc +7 -7
- package/template/101/movement-template/.prettierrc.json +8 -0
- package/template/101/movement-template/README.md +3 -2
- package/template/101/movement-template/jest.config.ts +3 -3
- package/template/101/movement-template/next-i18next.config.js +4 -4
- package/template/101/movement-template/next.config.js +11 -12
- package/template/101/movement-template/package.json +10 -5
- package/template/101/movement-template/postcss.config.js +1 -1
- package/template/101/movement-template/public/locales/de/common.json +1 -1
- package/template/101/movement-template/public/locales/de/footer.json +1 -1
- package/template/101/movement-template/public/locales/de/second-page.json +1 -1
- package/template/101/movement-template/public/locales/en/footer.json +1 -1
- package/template/101/movement-template/public/locales/en/second-page.json +1 -1
- package/template/101/movement-template/public/locales/zn/common.json +1 -1
- package/template/101/movement-template/public/locales/zn/footer.json +1 -1
- package/template/101/movement-template/public/locales/zn/second-page.json +1 -1
- package/template/101/movement-template/src/css/font-awesome.css +692 -687
- package/template/101/movement-template/src/css/font-awesome.min.css +2333 -1
- package/template/101/movement-template/tailwind.config.js +40 -52
- package/template/101/rooch-template/.prettierignore +1 -0
- package/template/101/rooch-template/.prettierrc +7 -7
- package/template/101/rooch-template/.prettierrc.json +8 -0
- package/template/101/rooch-template/README.md +3 -2
- package/template/101/rooch-template/jest.config.ts +3 -3
- package/template/101/rooch-template/next-i18next.config.js +4 -4
- package/template/101/rooch-template/next.config.js +11 -12
- package/template/101/rooch-template/package.json +8 -3
- package/template/101/rooch-template/postcss.config.js +1 -1
- package/template/101/rooch-template/public/locales/de/common.json +1 -1
- package/template/101/rooch-template/public/locales/de/footer.json +1 -1
- package/template/101/rooch-template/public/locales/de/second-page.json +1 -1
- package/template/101/rooch-template/public/locales/en/footer.json +1 -1
- package/template/101/rooch-template/public/locales/en/second-page.json +1 -1
- package/template/101/rooch-template/public/locales/zn/common.json +1 -1
- package/template/101/rooch-template/public/locales/zn/footer.json +1 -1
- package/template/101/rooch-template/public/locales/zn/second-page.json +1 -1
- package/template/101/rooch-template/src/chain/config.ts +1 -1
- package/template/101/rooch-template/src/css/font-awesome.css +692 -687
- package/template/101/rooch-template/src/css/font-awesome.min.css +2333 -1
- package/template/101/rooch-template/src/pages/index.tsx +7 -9
- package/template/101/rooch-template/tailwind.config.js +40 -52
- package/template/101/sui-template/.prettierignore +1 -0
- package/template/101/sui-template/.prettierrc.json +8 -0
- package/template/101/sui-template/README.md +4 -2
- package/template/101/sui-template/contracts/counter/sources/codegen/dapp/metadata.move +1 -1
- package/template/101/sui-template/contracts/counter/sources/codegen/dapp/schema.move +2 -2
- package/template/101/sui-template/contracts/counter/sources/codegen/dapp/system.move +7 -7
- package/template/101/sui-template/contracts/counter/sources/codegen/data/increment_event.move +1 -1
- package/template/101/sui-template/contracts/counter/sources/codegen/errors.move +3 -3
- package/template/101/sui-template/contracts/counter/sources/codegen/events.move +4 -4
- package/template/101/sui-template/contracts/counter/sources/codegen/genesis.move +5 -5
- package/template/101/sui-template/contracts/counter/sources/codegen/schema.move +9 -1
- package/template/101/sui-template/contracts/counter/sources/scripts/deploy_hook.move +2 -2
- package/template/101/sui-template/contracts/counter/sources/scripts/migrate.move +1 -1
- package/template/101/sui-template/contracts/counter/sources/systems/counter.move +3 -3
- package/template/101/sui-template/contracts/counter/sources/tests/counter.move +3 -3
- package/template/101/sui-template/contracts/counter/sources/tests/init.move +3 -3
- package/template/101/sui-template/dubhe.config.ts +4 -4
- package/template/101/sui-template/package.json +8 -7
- package/template/cocos/aptos-template/README.md +2 -1
- package/template/cocos/aptos-template/assets/Scripts/aptos.ts +15 -15
- package/template/cocos/aptos-template/assets/Scripts/chain/config.ts +5 -5
- package/template/cocos/aptos-template/assets/Scripts/dubhe.config.ts +8 -8
- package/template/cocos/aptos-template/assets/lib/obelisk.js +23107 -19762
- package/template/cocos/aptos-template/package.json +37 -37
- package/template/cocos/aptos-template/scripts/formatAccount.ts +18 -18
- package/template/cocos/aptos-template/scripts/generateAccount.ts +2 -2
- package/template/cocos/aptos-template/scripts/storeConfig.ts +37 -37
- package/template/cocos/aptos-template/tsconfig.json +2 -2
- package/template/cocos/sui-template/README.md +2 -1
- package/template/cocos/sui-template/assets/Scripts/chain/config.ts +3 -7
- package/template/cocos/sui-template/assets/Scripts/dubhe.config.ts +9 -9
- package/template/cocos/sui-template/assets/Scripts/sui.ts +87 -103
- package/template/cocos/sui-template/docker-compose.yaml +10 -4
- package/template/cocos/sui-template/package.json +25 -25
- package/template/cocos/sui-template/scripts/generateAccount.ts +38 -38
- package/template/cocos/sui-template/scripts/storeConfig.ts +36 -41
- package/template/cocos/sui-template/tsconfig.json +3 -10
- package/template/contract/sui-template/dubhe.config.ts +3 -3
- package/template/contract/sui-template/package.json +28 -28
- package/template/contract/sui-template/tsconfig.json +3 -13
- package/template/nextjs/aptos-template/.prettierignore +1 -0
- package/template/nextjs/aptos-template/.prettierrc +7 -7
- package/template/nextjs/aptos-template/.prettierrc.json +8 -0
- package/template/nextjs/aptos-template/README.md +2 -1
- package/template/nextjs/aptos-template/jest.config.ts +3 -3
- package/template/nextjs/aptos-template/next-i18next.config.js +4 -4
- package/template/nextjs/aptos-template/next.config.js +11 -12
- package/template/nextjs/aptos-template/package.json +11 -8
- package/template/nextjs/aptos-template/postcss.config.js +1 -1
- package/template/nextjs/aptos-template/public/locales/de/common.json +1 -1
- package/template/nextjs/aptos-template/public/locales/de/footer.json +1 -1
- package/template/nextjs/aptos-template/public/locales/de/second-page.json +1 -1
- package/template/nextjs/aptos-template/public/locales/en/footer.json +1 -1
- package/template/nextjs/aptos-template/public/locales/en/second-page.json +1 -1
- package/template/nextjs/aptos-template/public/locales/zn/common.json +1 -1
- package/template/nextjs/aptos-template/public/locales/zn/footer.json +1 -1
- package/template/nextjs/aptos-template/public/locales/zn/second-page.json +1 -1
- package/template/nextjs/aptos-template/src/components/Animation.tsx +60 -70
- package/template/nextjs/aptos-template/src/components/Container.tsx +2 -8
- package/template/nextjs/aptos-template/src/components/footer/index.tsx +124 -135
- package/template/nextjs/aptos-template/src/components/head/index.tsx +14 -14
- package/template/nextjs/aptos-template/src/components/header/index.tsx +143 -157
- package/template/nextjs/aptos-template/src/components/pop_up_box/index.tsx +150 -138
- package/template/nextjs/aptos-template/src/css/font-awesome.css +692 -687
- package/template/nextjs/aptos-template/src/css/font-awesome.min.css +2333 -1
- package/template/nextjs/aptos-template/src/jotai/index.tsx +9 -10
- package/template/nextjs/aptos-template/src/pages/_app.tsx +16 -16
- package/template/nextjs/aptos-template/src/pages/index.tsx +7 -10
- package/template/nextjs/aptos-template/tailwind.config.js +44 -55
- package/template/nextjs/aptos-template/tsconfig.json +3 -13
- package/template/nextjs/sui-template/.prettierignore +1 -0
- package/template/nextjs/sui-template/.prettierrc.json +8 -0
- package/template/nextjs/sui-template/README.md +4 -2
- package/template/nextjs/sui-template/contracts/counter/sources/codegen/dapp/metadata.move +1 -1
- package/template/nextjs/sui-template/contracts/counter/sources/codegen/dapp/schema.move +2 -2
- package/template/nextjs/sui-template/contracts/counter/sources/codegen/dapp/system.move +7 -7
- package/template/nextjs/sui-template/contracts/counter/sources/codegen/data/increment_event.move +1 -1
- package/template/nextjs/sui-template/contracts/counter/sources/codegen/errors.move +3 -3
- package/template/nextjs/sui-template/contracts/counter/sources/codegen/events.move +4 -4
- package/template/nextjs/sui-template/contracts/counter/sources/codegen/genesis.move +5 -5
- package/template/nextjs/sui-template/contracts/counter/sources/codegen/schema.move +9 -1
- package/template/nextjs/sui-template/contracts/counter/sources/scripts/deploy_hook.move +2 -2
- package/template/nextjs/sui-template/contracts/counter/sources/scripts/migrate.move +1 -1
- package/template/nextjs/sui-template/contracts/counter/sources/systems/counter.move +3 -3
- package/template/nextjs/sui-template/contracts/counter/sources/tests/counter.move +3 -3
- package/template/nextjs/sui-template/contracts/counter/sources/tests/init.move +3 -3
- package/template/nextjs/sui-template/dubhe.config.ts +4 -4
- package/template/nextjs/sui-template/next.config.mjs +1 -2
- package/template/nextjs/sui-template/package.json +9 -8
- package/template/nextjs/sui-template/src/chain/config.ts +2 -2
|
@@ -1,173 +1,159 @@
|
|
|
1
|
-
import Link from
|
|
2
|
-
import {useState} from
|
|
3
|
-
import { Popover } from '@headlessui/react'
|
|
4
|
-
import { AnimatePresence, motion } from 'framer-motion'
|
|
5
|
-
import * as React from
|
|
1
|
+
import Link from 'next/link';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { Popover } from '@headlessui/react';
|
|
4
|
+
import { AnimatePresence, motion } from 'framer-motion';
|
|
5
|
+
import * as React from 'react';
|
|
6
6
|
|
|
7
7
|
function classNames(...classes) {
|
|
8
|
-
|
|
8
|
+
return classes.filter(Boolean).join(' ');
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
function MenuIcon(props) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
strokeLinecap="round"
|
|
18
|
-
strokeLinejoin="round"
|
|
19
|
-
/>
|
|
20
|
-
</svg>
|
|
21
|
-
)
|
|
12
|
+
return (
|
|
13
|
+
<svg viewBox="0 0 24 24" fill="none" aria-hidden="true" {...props}>
|
|
14
|
+
<path d="M5 6h14M5 18h14M5 12h14" strokeWidth={2} strokeLinecap="round" strokeLinejoin="round" />
|
|
15
|
+
</svg>
|
|
16
|
+
);
|
|
22
17
|
}
|
|
23
18
|
|
|
24
19
|
function ChevronUpIcon(props) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
strokeLinecap="round"
|
|
31
|
-
strokeLinejoin="round"
|
|
32
|
-
/>
|
|
33
|
-
</svg>
|
|
34
|
-
)
|
|
20
|
+
return (
|
|
21
|
+
<svg viewBox="0 0 24 24" fill="none" aria-hidden="true" {...props}>
|
|
22
|
+
<path d="M17 14l-5-5-5 5" strokeWidth={2} strokeLinecap="round" strokeLinejoin="round" />
|
|
23
|
+
</svg>
|
|
24
|
+
);
|
|
35
25
|
}
|
|
36
26
|
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function myFunction() {
|
|
52
|
-
if (document.body.scrollTop > 50 || document.documentElement.scrollTop > 50) {
|
|
53
|
-
setScroll(true)
|
|
54
|
-
} else {
|
|
55
|
-
setScroll(false)
|
|
56
|
-
}
|
|
27
|
+
const Header = () => {
|
|
28
|
+
const [scroll, setScroll] = useState(false);
|
|
29
|
+
const navigation = [
|
|
30
|
+
{ name: 'Test1', href: '#test1' },
|
|
31
|
+
{ name: 'Test2', href: '#test2' },
|
|
32
|
+
{ name: 'Test3', href: '#test3' },
|
|
33
|
+
// {name:"TEAM", href:"#team"},
|
|
34
|
+
];
|
|
35
|
+
|
|
36
|
+
if (typeof window !== 'undefined') {
|
|
37
|
+
window.onscroll = function () {
|
|
38
|
+
myFunction();
|
|
57
39
|
};
|
|
58
|
-
|
|
59
|
-
let bridge=document.querySelector(toEl);
|
|
60
|
-
let body =document.body;
|
|
61
|
-
let height =0;
|
|
62
|
-
do{
|
|
63
|
-
height+=bridge.offsetTop;
|
|
64
|
-
bridge=bridge.offsetParent;
|
|
65
|
-
}while(bridge!==body)
|
|
40
|
+
}
|
|
66
41
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
42
|
+
function myFunction() {
|
|
43
|
+
if (document.body.scrollTop > 50 || document.documentElement.scrollTop > 50) {
|
|
44
|
+
setScroll(true);
|
|
45
|
+
} else {
|
|
46
|
+
setScroll(false);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
const to = toEl => {
|
|
50
|
+
let bridge = document.querySelector(toEl);
|
|
51
|
+
let body = document.body;
|
|
52
|
+
let height = 0;
|
|
53
|
+
do {
|
|
54
|
+
height += bridge.offsetTop;
|
|
55
|
+
bridge = bridge.offsetParent;
|
|
56
|
+
} while (bridge !== body);
|
|
57
|
+
|
|
58
|
+
window.scrollTo({
|
|
59
|
+
top: height,
|
|
60
|
+
behavior: 'smooth',
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
return (
|
|
64
|
+
<div
|
|
65
|
+
className={classNames(
|
|
66
|
+
scroll ? 'p-3 backdrop-blur-sm bg-[#2E2E2E]/80' : 'py-4 ',
|
|
67
|
+
'flex fixed mx-auto z-40 inset-x-0 px-4 sm:px-6 lg:px-8 xl:px-24 2xl:px-56 w-full justify-between transition-all duration-700 ease-in-out items-center',
|
|
68
|
+
)}
|
|
69
|
+
>
|
|
70
|
+
<div className={'relative z-10 items-center flex '}>
|
|
71
|
+
<Link href="/" legacyBehavior>
|
|
72
|
+
<a>
|
|
73
|
+
<img className="w-10 h-10 rounded-full flex lg:mr-5" src="/logo.svg" alt="" />
|
|
74
|
+
</a>
|
|
75
|
+
</Link>
|
|
76
|
+
<div className="hidden lg:flex lg:gap-10">
|
|
77
|
+
{navigation.map(item => (
|
|
78
|
+
<button
|
|
79
|
+
key={item.name}
|
|
80
|
+
onClick={() => {
|
|
81
|
+
to(item.href);
|
|
82
|
+
}}
|
|
83
|
+
className="text-sm lg:text-base font-medium text-white transition duration-700 "
|
|
84
|
+
>
|
|
85
|
+
{item.name}
|
|
86
|
+
</button>
|
|
87
|
+
))}
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
<div className="flex items-center gap-6">
|
|
91
|
+
<Popover className="lg:hidden">
|
|
92
|
+
{({ open }) => (
|
|
93
|
+
<>
|
|
94
|
+
<Popover.Button
|
|
95
|
+
className="relative z-10 -m-2 inline-flex items-center rounded-lg stroke-gray-500 p-2 outline-none"
|
|
96
|
+
aria-label="Toggle site navigation"
|
|
97
|
+
>
|
|
98
|
+
{({ open }) => (open ? <ChevronUpIcon className="h-10 w-10" /> : <MenuIcon className="h-10 w-10" />)}
|
|
99
|
+
</Popover.Button>
|
|
100
|
+
<AnimatePresence initial={false}>
|
|
101
|
+
{open && (
|
|
102
|
+
<>
|
|
103
|
+
<Popover.Overlay
|
|
104
|
+
static
|
|
105
|
+
as={motion.div}
|
|
106
|
+
initial={{ opacity: 0 }}
|
|
107
|
+
animate={{ opacity: 1 }}
|
|
108
|
+
exit={{ opacity: 0 }}
|
|
109
|
+
className="fixed inset-0 z-0 bg-gray-300/60 backdrop-blur"
|
|
82
110
|
/>
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
111
|
+
<Popover.Panel
|
|
112
|
+
static
|
|
113
|
+
as={motion.div}
|
|
114
|
+
initial={{ opacity: 0, y: -32 }}
|
|
115
|
+
animate={{ opacity: 1, y: 0 }}
|
|
116
|
+
exit={{
|
|
117
|
+
opacity: 0,
|
|
118
|
+
y: -32,
|
|
119
|
+
transition: { duration: 0.2 },
|
|
120
|
+
}}
|
|
121
|
+
className="absolute inset-x-0 top-0 z-0 origin-top rounded-b-2xl bg-[#2E2E2E] px-6 pb-6 pt-24 shadow-2xl shadow-gray-900/20"
|
|
122
|
+
>
|
|
123
|
+
<div className="space-y-4 ">
|
|
124
|
+
{navigation.map(item => (
|
|
125
|
+
<button
|
|
126
|
+
key={item.name}
|
|
127
|
+
onClick={() => to(item.href)}
|
|
128
|
+
className="block text-base leading-7 tracking-tight text-white"
|
|
129
|
+
>
|
|
89
130
|
{item.name}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
</Popover.Button>
|
|
113
|
-
<AnimatePresence initial={false}>
|
|
114
|
-
{open && (
|
|
115
|
-
<>
|
|
116
|
-
<Popover.Overlay
|
|
117
|
-
static
|
|
118
|
-
as={motion.div}
|
|
119
|
-
initial={{ opacity: 0 }}
|
|
120
|
-
animate={{ opacity: 1 }}
|
|
121
|
-
exit={{ opacity: 0 }}
|
|
122
|
-
className="fixed inset-0 z-0 bg-gray-300/60 backdrop-blur"
|
|
123
|
-
/>
|
|
124
|
-
<Popover.Panel
|
|
125
|
-
static
|
|
126
|
-
as={motion.div}
|
|
127
|
-
initial={{ opacity: 0, y: -32 }}
|
|
128
|
-
animate={{ opacity: 1, y: 0 }}
|
|
129
|
-
exit={{
|
|
130
|
-
opacity: 0,
|
|
131
|
-
y: -32,
|
|
132
|
-
transition: { duration: 0.2 },
|
|
133
|
-
}}
|
|
134
|
-
className="absolute inset-x-0 top-0 z-0 origin-top rounded-b-2xl bg-[#2E2E2E] px-6 pb-6 pt-24 shadow-2xl shadow-gray-900/20"
|
|
135
|
-
>
|
|
136
|
-
|
|
137
|
-
<div className="space-y-4 ">
|
|
138
|
-
{navigation.map((item) => (
|
|
139
|
-
<button key={item.name} onClick={()=>to(item.href)}
|
|
140
|
-
className="block text-base leading-7 tracking-tight text-white">
|
|
141
|
-
{item.name}
|
|
142
|
-
</button>
|
|
143
|
-
))}
|
|
144
|
-
</div>
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
</Popover.Panel>
|
|
148
|
-
</>
|
|
149
|
-
)}
|
|
150
|
-
</AnimatePresence>
|
|
151
|
-
</>
|
|
152
|
-
)}
|
|
153
|
-
</Popover>
|
|
154
|
-
|
|
155
|
-
<div className="hidden lg:flex gap-4 items-center ">
|
|
156
|
-
<Link href="https://discord.gg/ceETxS2eTa" legacyBehavior>
|
|
157
|
-
<a target="_blank">
|
|
158
|
-
<img className="w-6 " src="discord.svg" alt=""/>
|
|
159
|
-
</a>
|
|
160
|
-
</Link>
|
|
161
|
-
<Link href="https://twitter.com/suirobots" legacyBehavior>
|
|
162
|
-
<a target="_blank">
|
|
163
|
-
<img className="w-6" src="twitter.svg" alt=""/>
|
|
164
|
-
</a>
|
|
165
|
-
</Link>
|
|
166
|
-
</div>
|
|
167
|
-
</div>
|
|
131
|
+
</button>
|
|
132
|
+
))}
|
|
133
|
+
</div>
|
|
134
|
+
</Popover.Panel>
|
|
135
|
+
</>
|
|
136
|
+
)}
|
|
137
|
+
</AnimatePresence>
|
|
138
|
+
</>
|
|
139
|
+
)}
|
|
140
|
+
</Popover>
|
|
141
|
+
|
|
142
|
+
<div className="hidden lg:flex gap-4 items-center ">
|
|
143
|
+
<Link href="https://discord.gg/ceETxS2eTa" legacyBehavior>
|
|
144
|
+
<a target="_blank">
|
|
145
|
+
<img className="w-6 " src="discord.svg" alt="" />
|
|
146
|
+
</a>
|
|
147
|
+
</Link>
|
|
148
|
+
<Link href="https://twitter.com/suirobots" legacyBehavior>
|
|
149
|
+
<a target="_blank">
|
|
150
|
+
<img className="w-6" src="twitter.svg" alt="" />
|
|
151
|
+
</a>
|
|
152
|
+
</Link>
|
|
168
153
|
</div>
|
|
154
|
+
</div>
|
|
155
|
+
</div>
|
|
156
|
+
);
|
|
157
|
+
};
|
|
169
158
|
|
|
170
|
-
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
export default Header
|
|
159
|
+
export default Header;
|
|
@@ -1,149 +1,161 @@
|
|
|
1
|
-
import {useAtom} from
|
|
2
|
-
import React, {Fragment, useEffect} from
|
|
3
|
-
import Link from
|
|
4
|
-
import {Dialog,Transition} from
|
|
5
|
-
import {OpenBoxState, SellPopUpBoxState, SellState} from
|
|
1
|
+
import { useAtom } from 'jotai';
|
|
2
|
+
import React, { Fragment, useEffect } from 'react';
|
|
3
|
+
import Link from 'next/link';
|
|
4
|
+
import { Dialog, Transition } from '@headlessui/react';
|
|
5
|
+
import { OpenBoxState, SellPopUpBoxState, SellState } from '../../jotai';
|
|
6
6
|
|
|
7
7
|
function classNames(...classes) {
|
|
8
|
-
|
|
8
|
+
return classes.filter(Boolean).join(' ');
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
//右侧弹出框
|
|
12
|
-
const PopUpBox = () =>{
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
12
|
+
const PopUpBox = () => {
|
|
13
|
+
const [pop_up_boxState, setSop_up_boxState] = useAtom(SellPopUpBoxState);
|
|
14
|
+
const [pop_up_boxData] = useAtom(SellState);
|
|
15
|
+
let time;
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
clearTimeout(time);
|
|
18
|
+
if (pop_up_boxState) {
|
|
19
|
+
time = setTimeout(() => {
|
|
20
|
+
setSop_up_boxState(false);
|
|
21
|
+
}, 6000);
|
|
22
|
+
}
|
|
23
|
+
const Pop_up_box = document.getElementById('Pop_up_box');
|
|
24
|
+
Pop_up_box.onmouseover = function () {
|
|
25
|
+
clearInterval(time);
|
|
26
|
+
};
|
|
27
|
+
Pop_up_box.onmouseout = function () {
|
|
28
|
+
time = setTimeout(() => {
|
|
29
|
+
setSop_up_boxState(false);
|
|
30
|
+
}, 3000);
|
|
31
|
+
};
|
|
32
|
+
}, [pop_up_boxState]);
|
|
33
|
+
return (
|
|
34
|
+
<div
|
|
35
|
+
id="Pop_up_box"
|
|
36
|
+
aria-live="assertive"
|
|
37
|
+
className="pointer-events-none z-50 fixed inset-0 top-12 flex items-end px-4 py-6 sm:items-start sm:p-6 "
|
|
38
|
+
>
|
|
39
|
+
<div className="flex w-full flex-col items-center space-y-4 sm:items-end">
|
|
40
|
+
{/* Notification panel, dynamically insert this into the live region when it needs to be displayed */}
|
|
41
|
+
<Transition
|
|
42
|
+
show={pop_up_boxState}
|
|
43
|
+
as={Fragment}
|
|
44
|
+
enter="transform ease-out duration-300 transition"
|
|
45
|
+
enterFrom="translate-y-2 opacity-0 sm:translate-y-0 sm:translate-x-2"
|
|
46
|
+
enterTo="translate-y-0 opacity-100 sm:translate-x-0"
|
|
47
|
+
leave="transition ease-in duration-100"
|
|
48
|
+
leaveFrom="opacity-100"
|
|
49
|
+
leaveTo="opacity-0"
|
|
39
50
|
>
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
51
|
+
<div
|
|
52
|
+
className={classNames(
|
|
53
|
+
pop_up_boxData.state ? 'bg-green-50' : 'bg-red-50',
|
|
54
|
+
'pointer-events-auto w-full max-w-xs overflow-hidden rounded-lg ',
|
|
55
|
+
)}
|
|
56
|
+
>
|
|
57
|
+
<div className="p-4">
|
|
58
|
+
<div className="flex items-center">
|
|
59
|
+
<img className={pop_up_boxData.state ? 'w-10 mt-1' : 'hidden'} src="/successful.svg" alt="" />
|
|
60
|
+
<img className={pop_up_boxData.state ? 'hidden' : 'w-10 mt-1'} src="/fail.svg" alt="" />
|
|
61
|
+
<div className="ml-3 w-0 flex-1 pt-0.5 text-white text-sm">
|
|
62
|
+
<p
|
|
63
|
+
className={classNames(
|
|
64
|
+
pop_up_boxData.state ? 'text-green-800' : 'text-red-800',
|
|
65
|
+
'text-sm font-medium ',
|
|
66
|
+
)}
|
|
67
|
+
>
|
|
68
|
+
{pop_up_boxData.type} {classNames(pop_up_boxData.state ? 'success' : 'fail')}
|
|
69
|
+
</p>
|
|
70
|
+
<p className={pop_up_boxData.state ? 'hidden' : 'mt-1 text-red-800 font-black'}>Please try again</p>
|
|
71
|
+
<div className={pop_up_boxData.hash == '' ? 'hidden' : ''}>
|
|
72
|
+
<Link
|
|
73
|
+
legacyBehavior
|
|
74
|
+
href={`https://explorer.sui.io/transaction/${pop_up_boxData.hash}?network=https%3A%2F%2Fwallet-rpc.devnet.sui.io%2F`}
|
|
75
|
+
target="_Blank"
|
|
76
|
+
>
|
|
77
|
+
<a
|
|
78
|
+
className={classNames(
|
|
79
|
+
pop_up_boxData.state
|
|
80
|
+
? 'bg-green-50 text-green-500 hover:bg-green-100'
|
|
81
|
+
: 'bg-red-50 text-red-500 hover:bg-red-100',
|
|
82
|
+
'mt-1 underline font-semibold ',
|
|
83
|
+
)}
|
|
84
|
+
target="_Blank"
|
|
85
|
+
>
|
|
86
|
+
View on Explorer
|
|
87
|
+
</a>
|
|
88
|
+
</Link>
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
77
91
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
</div>
|
|
97
|
-
</Transition>
|
|
92
|
+
<div className="-mt-4 flex flex-shrink-0">
|
|
93
|
+
<button
|
|
94
|
+
type="button"
|
|
95
|
+
className={classNames(
|
|
96
|
+
pop_up_boxData.state
|
|
97
|
+
? 'bg-green-50 text-green-500 hover:bg-green-100'
|
|
98
|
+
: 'bg-red-50 text-red-500 hover:bg-red-100',
|
|
99
|
+
'inline-flex rounded-md p-1.5',
|
|
100
|
+
)}
|
|
101
|
+
onClick={() => {
|
|
102
|
+
setSop_up_boxState(false);
|
|
103
|
+
}}
|
|
104
|
+
>
|
|
105
|
+
<i className="fa fa-times" aria-hidden="true"></i>
|
|
106
|
+
<span className="sr-only">Close</span>
|
|
107
|
+
</button>
|
|
108
|
+
</div>
|
|
109
|
+
</div>
|
|
98
110
|
</div>
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
111
|
+
</div>
|
|
112
|
+
</Transition>
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
);
|
|
116
|
+
};
|
|
102
117
|
|
|
103
118
|
//加载弹出框
|
|
104
|
-
const Loading = () =>{
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
<div className="fixed inset-0 z-10 overflow-y-auto">
|
|
123
|
-
<div className="flex min-h-full items-center justify-center p-4 text-center sm:items-center sm:p-0">
|
|
124
|
-
<Transition.Child
|
|
125
|
-
as={Fragment}
|
|
126
|
-
enter="ease-out duration-300"
|
|
127
|
-
enterFrom="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
|
|
128
|
-
enterTo="opacity-100 translate-y-0 sm:scale-100"
|
|
129
|
-
leave="ease-in duration-200"
|
|
130
|
-
leaveFrom="opacity-100 translate-y-0 sm:scale-100"
|
|
131
|
-
leaveTo="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
|
|
132
|
-
>
|
|
133
|
-
<Dialog.Panel className="">
|
|
134
|
-
|
|
135
|
-
<div className="animate-spin text-white">
|
|
136
|
-
<i className="fa fa-spinner f-spin fa-2x fa-fw"></i>
|
|
137
|
-
</div>
|
|
138
|
-
</Dialog.Panel>
|
|
139
|
-
</Transition.Child>
|
|
140
|
-
</div>
|
|
141
|
-
</div>
|
|
142
|
-
</Dialog>
|
|
143
|
-
</Transition.Root>
|
|
144
|
-
</>
|
|
145
|
-
)
|
|
146
|
-
}
|
|
147
|
-
export {PopUpBox,Loading}
|
|
148
|
-
|
|
119
|
+
const Loading = () => {
|
|
120
|
+
const [openLoading, setOpenLoading] = useAtom(OpenBoxState);
|
|
121
|
+
return (
|
|
122
|
+
<>
|
|
123
|
+
<Transition.Root show={openLoading} as={Fragment}>
|
|
124
|
+
<Dialog as="div" className="relative z-50" onClose={() => false}>
|
|
125
|
+
<Transition.Child
|
|
126
|
+
as={Fragment}
|
|
127
|
+
enter="ease-out duration-300"
|
|
128
|
+
enterFrom="opacity-0"
|
|
129
|
+
enterTo="opacity-100"
|
|
130
|
+
leave="ease-in duration-200"
|
|
131
|
+
leaveFrom="opacity-100"
|
|
132
|
+
leaveTo="opacity-0"
|
|
133
|
+
>
|
|
134
|
+
<div className="fixed inset-0 bg-gray-400 bg-opacity-50 transition-opacity" />
|
|
135
|
+
</Transition.Child>
|
|
149
136
|
|
|
137
|
+
<div className="fixed inset-0 z-10 overflow-y-auto">
|
|
138
|
+
<div className="flex min-h-full items-center justify-center p-4 text-center sm:items-center sm:p-0">
|
|
139
|
+
<Transition.Child
|
|
140
|
+
as={Fragment}
|
|
141
|
+
enter="ease-out duration-300"
|
|
142
|
+
enterFrom="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
|
|
143
|
+
enterTo="opacity-100 translate-y-0 sm:scale-100"
|
|
144
|
+
leave="ease-in duration-200"
|
|
145
|
+
leaveFrom="opacity-100 translate-y-0 sm:scale-100"
|
|
146
|
+
leaveTo="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
|
|
147
|
+
>
|
|
148
|
+
<Dialog.Panel className="">
|
|
149
|
+
<div className="animate-spin text-white">
|
|
150
|
+
<i className="fa fa-spinner f-spin fa-2x fa-fw"></i>
|
|
151
|
+
</div>
|
|
152
|
+
</Dialog.Panel>
|
|
153
|
+
</Transition.Child>
|
|
154
|
+
</div>
|
|
155
|
+
</div>
|
|
156
|
+
</Dialog>
|
|
157
|
+
</Transition.Root>
|
|
158
|
+
</>
|
|
159
|
+
);
|
|
160
|
+
};
|
|
161
|
+
export { PopUpBox, Loading };
|