create-dubhe 0.1.2 → 0.1.3
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/package.json +1 -1
- package/template/101/sui-template/.prettierrc +7 -7
- package/template/101/sui-template/README.md +8 -9
- package/template/101/sui-template/contracts/counter/.history/sui_localnet/latest.json +11 -0
- package/template/101/sui-template/contracts/counter/Move.lock +45 -0
- package/template/101/sui-template/dubhe.config.ts +11 -11
- package/template/101/sui-template/eslint.config.mjs +14 -0
- package/template/101/sui-template/next.config.ts +7 -0
- package/template/101/sui-template/package.json +23 -40
- package/template/101/sui-template/pnpm-lock.yaml +8133 -0
- package/template/101/sui-template/postcss.config.mjs +8 -0
- package/template/101/sui-template/src/app/favicon.ico +0 -0
- package/template/101/sui-template/src/app/globals.css +21 -0
- package/template/101/sui-template/src/app/layout.tsx +34 -0
- package/template/101/sui-template/src/app/page.tsx +106 -0
- package/template/101/sui-template/src/app/state/index.tsx +5 -0
- package/template/101/sui-template/src/chain/config.ts +2 -2
- package/template/101/sui-template/tailwind.config.ts +18 -0
- package/template/101/sui-template/tsconfig.json +11 -8
- package/template/contract/sui-template/package.json +1 -1
- package/template/nextjs/sui-template/.prettierrc +7 -7
- package/template/nextjs/sui-template/README.md +8 -8
- package/template/nextjs/sui-template/contracts/counter/.history/sui_localnet/latest.json +11 -0
- package/template/nextjs/sui-template/contracts/counter/Move.lock +52 -0
- package/template/nextjs/sui-template/contracts/counter/Move.toml +1 -1
- package/template/nextjs/sui-template/dubhe.config.ts +11 -11
- package/template/nextjs/sui-template/eslint.config.mjs +14 -0
- package/template/nextjs/sui-template/next.config.mjs +5 -0
- package/template/nextjs/sui-template/package.json +25 -41
- package/template/nextjs/sui-template/pnpm-lock.yaml +9002 -0
- package/template/nextjs/sui-template/postcss.config.mjs +8 -0
- package/template/nextjs/sui-template/src/app/favicon.ico +0 -0
- package/template/nextjs/sui-template/src/app/globals.css +21 -0
- package/template/nextjs/sui-template/src/app/layout.tsx +17 -0
- package/template/nextjs/sui-template/src/app/page.tsx +151 -0
- package/template/nextjs/sui-template/src/{pages/_app.tsx → app/providers.tsx} +6 -12
- package/template/nextjs/sui-template/src/app/state/index.tsx +5 -0
- package/template/nextjs/sui-template/src/chain/config.ts +3 -3
- package/template/nextjs/sui-template/tailwind.config.ts +18 -0
- package/template/nextjs/sui-template/tsconfig.json +13 -15
- package/template/101/sui-template/.dockerignore +0 -7
- package/template/101/sui-template/.eslintrc.json +0 -3
- package/template/101/sui-template/Dockerfile +0 -52
- package/template/101/sui-template/LICENSE +0 -674
- package/template/101/sui-template/jest.config.ts +0 -17
- package/template/101/sui-template/next-env.d.ts +0 -5
- package/template/101/sui-template/next-i18next.config.js +0 -6
- package/template/101/sui-template/next.config.js +0 -15
- package/template/101/sui-template/postcss.config.js +0 -6
- package/template/101/sui-template/public/discord.svg +0 -9
- package/template/101/sui-template/public/fail.svg +0 -12
- package/template/101/sui-template/public/favicon.ico +0 -0
- package/template/101/sui-template/public/locales/de/common.json +0 -8
- package/template/101/sui-template/public/locales/de/footer.json +0 -3
- package/template/101/sui-template/public/locales/de/second-page.json +0 -5
- package/template/101/sui-template/public/locales/en/common.json +0 -8
- package/template/101/sui-template/public/locales/en/footer.json +0 -3
- package/template/101/sui-template/public/locales/en/second-page.json +0 -5
- package/template/101/sui-template/public/locales/zn/common.json +0 -8
- package/template/101/sui-template/public/locales/zn/footer.json +0 -3
- package/template/101/sui-template/public/locales/zn/second-page.json +0 -5
- package/template/101/sui-template/public/logo.svg +0 -1
- package/template/101/sui-template/public/medium.svg +0 -9
- package/template/101/sui-template/public/successful.svg +0 -11
- package/template/101/sui-template/public/telegram.svg +0 -9
- package/template/101/sui-template/public/twitter.svg +0 -9
- package/template/101/sui-template/src/css/font-awesome.css +0 -2337
- package/template/101/sui-template/src/css/font-awesome.min.css +0 -4
- package/template/101/sui-template/src/fonts/FontAwesome.otf +0 -0
- package/template/101/sui-template/src/fonts/fontawesome-webfont.eot +0 -0
- package/template/101/sui-template/src/fonts/fontawesome-webfont.svg +0 -2671
- package/template/101/sui-template/src/fonts/fontawesome-webfont.ttf +0 -0
- package/template/101/sui-template/src/fonts/fontawesome-webfont.woff +0 -0
- package/template/101/sui-template/src/fonts/fontawesome-webfont.woff2 +0 -0
- package/template/101/sui-template/src/jotai/index.tsx +0 -12
- package/template/101/sui-template/src/pages/_app.tsx +0 -15
- package/template/101/sui-template/src/pages/home/index.tsx +0 -117
- package/template/101/sui-template/src/pages/index.tsx +0 -12
- package/template/101/sui-template/tailwind.config.js +0 -56
- package/template/nextjs/sui-template/.dockerignore +0 -7
- package/template/nextjs/sui-template/.eslintrc.json +0 -3
- package/template/nextjs/sui-template/Dockerfile +0 -52
- package/template/nextjs/sui-template/LICENSE +0 -674
- package/template/nextjs/sui-template/jest.config.ts +0 -17
- package/template/nextjs/sui-template/next-env.d.ts +0 -5
- package/template/nextjs/sui-template/next-i18next.config.js +0 -6
- package/template/nextjs/sui-template/next.config.js +0 -15
- package/template/nextjs/sui-template/postcss.config.js +0 -6
- package/template/nextjs/sui-template/public/discord.svg +0 -9
- package/template/nextjs/sui-template/public/fail.svg +0 -12
- package/template/nextjs/sui-template/public/favicon.ico +0 -0
- package/template/nextjs/sui-template/public/locales/de/common.json +0 -8
- package/template/nextjs/sui-template/public/locales/de/footer.json +0 -3
- package/template/nextjs/sui-template/public/locales/de/second-page.json +0 -5
- package/template/nextjs/sui-template/public/locales/en/common.json +0 -8
- package/template/nextjs/sui-template/public/locales/en/footer.json +0 -3
- package/template/nextjs/sui-template/public/locales/en/second-page.json +0 -5
- package/template/nextjs/sui-template/public/locales/zn/common.json +0 -8
- package/template/nextjs/sui-template/public/locales/zn/footer.json +0 -3
- package/template/nextjs/sui-template/public/locales/zn/second-page.json +0 -5
- package/template/nextjs/sui-template/public/logo.svg +0 -1
- package/template/nextjs/sui-template/public/medium.svg +0 -9
- package/template/nextjs/sui-template/public/successful.svg +0 -11
- package/template/nextjs/sui-template/public/telegram.svg +0 -9
- package/template/nextjs/sui-template/public/twitter.svg +0 -9
- package/template/nextjs/sui-template/src/components/Animation.tsx +0 -80
- package/template/nextjs/sui-template/src/components/Container.tsx +0 -11
- package/template/nextjs/sui-template/src/components/footer/index.tsx +0 -138
- package/template/nextjs/sui-template/src/components/head/index.tsx +0 -14
- package/template/nextjs/sui-template/src/components/header/index.tsx +0 -173
- package/template/nextjs/sui-template/src/components/pop_up_box/index.tsx +0 -149
- package/template/nextjs/sui-template/src/css/font-awesome.css +0 -2337
- package/template/nextjs/sui-template/src/css/font-awesome.min.css +0 -4
- package/template/nextjs/sui-template/src/fonts/FontAwesome.otf +0 -0
- package/template/nextjs/sui-template/src/fonts/fontawesome-webfont.eot +0 -0
- package/template/nextjs/sui-template/src/fonts/fontawesome-webfont.svg +0 -2671
- package/template/nextjs/sui-template/src/fonts/fontawesome-webfont.ttf +0 -0
- package/template/nextjs/sui-template/src/fonts/fontawesome-webfont.woff +0 -0
- package/template/nextjs/sui-template/src/fonts/fontawesome-webfont.woff2 +0 -0
- package/template/nextjs/sui-template/src/jotai/index.tsx +0 -13
- package/template/nextjs/sui-template/src/pages/home/index.tsx +0 -172
- package/template/nextjs/sui-template/src/pages/index.tsx +0 -15
- package/template/nextjs/sui-template/tailwind.config.js +0 -56
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import Link from "next/link"
|
|
2
|
-
import {Container} from "../Container";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const ends =[
|
|
6
|
-
{
|
|
7
|
-
title:"Product",
|
|
8
|
-
content:[
|
|
9
|
-
{
|
|
10
|
-
h1:"Overview",
|
|
11
|
-
href:"",
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
h1:"Download",
|
|
15
|
-
href:"",
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
h1:"Docs",
|
|
19
|
-
href:"",
|
|
20
|
-
},
|
|
21
|
-
]
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
title:"Resources",
|
|
26
|
-
content:[
|
|
27
|
-
{
|
|
28
|
-
h1:"About Us",
|
|
29
|
-
href:"",
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
h1:"Download",
|
|
33
|
-
href:"",
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
h1:"Docs",
|
|
37
|
-
href:"",
|
|
38
|
-
},
|
|
39
|
-
]
|
|
40
|
-
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
title:"Follow Us",
|
|
44
|
-
content:[
|
|
45
|
-
{
|
|
46
|
-
h1:"Discord",
|
|
47
|
-
href:"",
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
h1:"Twitter",
|
|
51
|
-
href:"",
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
h1:"Telegram",
|
|
55
|
-
href:"",
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
h1:"Github",
|
|
59
|
-
href:"",
|
|
60
|
-
}
|
|
61
|
-
]
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
]
|
|
65
|
-
const participate=[
|
|
66
|
-
{
|
|
67
|
-
href:"",
|
|
68
|
-
img:"/telegram.svg"
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
href:"",
|
|
72
|
-
img:"/twitter.svg",
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
href:"",
|
|
76
|
-
img:"/discord.svg",
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
href:"",
|
|
80
|
-
img:"/medium.svg",
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
]
|
|
84
|
-
const Footer=()=>{
|
|
85
|
-
return(
|
|
86
|
-
<>
|
|
87
|
-
<Container className="pt-10">
|
|
88
|
-
<div className="md:flex justify-between pt-12 items-center">
|
|
89
|
-
|
|
90
|
-
<div className="text-center md:flex justify-between mb-10 mt-10 md:mt-0 ">
|
|
91
|
-
{ends.map(end=>(
|
|
92
|
-
<div key={end.title} className="md:mr-10" >
|
|
93
|
-
<div className="text-white font-semibold text-base ">
|
|
94
|
-
{end.title}
|
|
95
|
-
</div>
|
|
96
|
-
{end.content.map(item=>(
|
|
97
|
-
<div key={item.h1} className="my-3 text-sm transition duration-300 transform hover:translate-x-2 md:text-left text-white">
|
|
98
|
-
|
|
99
|
-
<Link legacyBehavior href={item.href}>
|
|
100
|
-
<a>
|
|
101
|
-
{item.h1}
|
|
102
|
-
</a>
|
|
103
|
-
</Link>
|
|
104
|
-
</div>))}
|
|
105
|
-
</div>
|
|
106
|
-
))}
|
|
107
|
-
</div>
|
|
108
|
-
|
|
109
|
-
<div>
|
|
110
|
-
<div className="flex justify-center md:justify-start " >
|
|
111
|
-
<img className="w-18" src="/logo.svg" alt=""/>
|
|
112
|
-
</div>
|
|
113
|
-
<div className="my-5 text-[#4F5568] text-sm text-center ">
|
|
114
|
-
Aura Wallet is the safest wallet
|
|
115
|
-
</div>
|
|
116
|
-
<div className="flex justify-center items-center md:justify-start ">
|
|
117
|
-
{participate.map(item=>(
|
|
118
|
-
<div key={item.img} className="mr-5 ">
|
|
119
|
-
<Link legacyBehavior href={item.href}>
|
|
120
|
-
<a className="">
|
|
121
|
-
<img className="w-6" src={item.img} alt=""/>
|
|
122
|
-
</a></Link>
|
|
123
|
-
</div> ))}
|
|
124
|
-
</div>
|
|
125
|
-
</div>
|
|
126
|
-
</div>
|
|
127
|
-
<div className="border-t border-[#1A1A1A] py-3 mt-5 ">
|
|
128
|
-
<div className=" flex justify-center md:block text-[#969696] text-sm ">
|
|
129
|
-
© 2022 Aura Wallet</div>
|
|
130
|
-
</div>
|
|
131
|
-
</Container>
|
|
132
|
-
|
|
133
|
-
</>
|
|
134
|
-
)
|
|
135
|
-
}
|
|
136
|
-
export {
|
|
137
|
-
Footer
|
|
138
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import Head from 'next/head'
|
|
2
|
-
const Heads = () =>{
|
|
3
|
-
return(
|
|
4
|
-
<Head>
|
|
5
|
-
<title>Test Website</title>
|
|
6
|
-
{/*<meta*/}
|
|
7
|
-
{/* name="description"*/}
|
|
8
|
-
{/* content="Seamless Portal to Web3.0."*/}
|
|
9
|
-
{/*/>*/}
|
|
10
|
-
<link rel="icon" className="rounded-full" href="/favicon.ico" />
|
|
11
|
-
</Head>
|
|
12
|
-
)
|
|
13
|
-
}
|
|
14
|
-
export default Heads
|
|
@@ -1,173 +0,0 @@
|
|
|
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
|
-
|
|
7
|
-
function classNames(...classes) {
|
|
8
|
-
return classes.filter(Boolean).join(' ')
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
function MenuIcon(props) {
|
|
12
|
-
return (
|
|
13
|
-
<svg viewBox="0 0 24 24" fill="none" aria-hidden="true" {...props}>
|
|
14
|
-
<path
|
|
15
|
-
d="M5 6h14M5 18h14M5 12h14"
|
|
16
|
-
strokeWidth={2}
|
|
17
|
-
strokeLinecap="round"
|
|
18
|
-
strokeLinejoin="round"
|
|
19
|
-
/>
|
|
20
|
-
</svg>
|
|
21
|
-
)
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function ChevronUpIcon(props) {
|
|
25
|
-
return (
|
|
26
|
-
<svg viewBox="0 0 24 24" fill="none" aria-hidden="true" {...props}>
|
|
27
|
-
<path
|
|
28
|
-
d="M17 14l-5-5-5 5"
|
|
29
|
-
strokeWidth={2}
|
|
30
|
-
strokeLinecap="round"
|
|
31
|
-
strokeLinejoin="round"
|
|
32
|
-
/>
|
|
33
|
-
</svg>
|
|
34
|
-
)
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const Header = () =>{
|
|
39
|
-
const [scroll,setScroll]=useState(false)
|
|
40
|
-
const navigation = [
|
|
41
|
-
{name:"Test1", href:"#test1"},
|
|
42
|
-
{name:"Test2", href:"#test2"},
|
|
43
|
-
{name:"Test3", href:"#test3"},
|
|
44
|
-
// {name:"TEAM", href:"#team"},
|
|
45
|
-
]
|
|
46
|
-
|
|
47
|
-
if(typeof window !== "undefined"){
|
|
48
|
-
window.onscroll = function() {myFunction()};
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function myFunction() {
|
|
52
|
-
if (document.body.scrollTop > 50 || document.documentElement.scrollTop > 50) {
|
|
53
|
-
setScroll(true)
|
|
54
|
-
} else {
|
|
55
|
-
setScroll(false)
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
const to = (toEl)=>{
|
|
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)
|
|
66
|
-
|
|
67
|
-
window.scrollTo({
|
|
68
|
-
top:height,
|
|
69
|
-
behavior:'smooth'
|
|
70
|
-
})
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
return (
|
|
74
|
-
<div className={classNames(scroll?'p-3 backdrop-blur-sm bg-[#2E2E2E]/80':"py-4 ","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")}>
|
|
75
|
-
<div className={"relative z-10 items-center flex "}>
|
|
76
|
-
<Link href="/" legacyBehavior>
|
|
77
|
-
<a>
|
|
78
|
-
<img
|
|
79
|
-
className="w-10 h-10 rounded-full flex lg:mr-5"
|
|
80
|
-
src="/logo.svg"
|
|
81
|
-
alt=""
|
|
82
|
-
/>
|
|
83
|
-
</a>
|
|
84
|
-
</Link>
|
|
85
|
-
<div className="hidden lg:flex lg:gap-10">
|
|
86
|
-
{navigation.map((item) => (
|
|
87
|
-
<button key={item.name} onClick={()=>{to(item.href)}}
|
|
88
|
-
className="text-sm lg:text-base font-medium text-white transition duration-700 ">
|
|
89
|
-
{item.name}
|
|
90
|
-
</button>
|
|
91
|
-
))}
|
|
92
|
-
</div>
|
|
93
|
-
</div>
|
|
94
|
-
<div className="flex items-center gap-6">
|
|
95
|
-
|
|
96
|
-
<Popover className="lg:hidden">
|
|
97
|
-
|
|
98
|
-
{({ open }) => (
|
|
99
|
-
<>
|
|
100
|
-
<Popover.Button
|
|
101
|
-
className="relative z-10 -m-2 inline-flex items-center rounded-lg stroke-gray-500 p-2 outline-none"
|
|
102
|
-
aria-label="Toggle site navigation"
|
|
103
|
-
>
|
|
104
|
-
|
|
105
|
-
{({ open }) =>
|
|
106
|
-
open ? (
|
|
107
|
-
<ChevronUpIcon className="h-10 w-10" />
|
|
108
|
-
) : (
|
|
109
|
-
<MenuIcon className="h-10 w-10" />
|
|
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>
|
|
168
|
-
</div>
|
|
169
|
-
|
|
170
|
-
)
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
export default Header
|
|
@@ -1,149 +0,0 @@
|
|
|
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
|
-
|
|
7
|
-
function classNames(...classes) {
|
|
8
|
-
return classes.filter(Boolean).join(' ')
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
//右侧弹出框
|
|
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
|
-
|
|
31
|
-
},3000)
|
|
32
|
-
}
|
|
33
|
-
},[pop_up_boxState])
|
|
34
|
-
return(
|
|
35
|
-
<div
|
|
36
|
-
id="Pop_up_box"
|
|
37
|
-
aria-live="assertive"
|
|
38
|
-
className="pointer-events-none z-50 fixed inset-0 top-12 flex items-end px-4 py-6 sm:items-start sm:p-6 "
|
|
39
|
-
>
|
|
40
|
-
<div className="flex w-full flex-col items-center space-y-4 sm:items-end">
|
|
41
|
-
{/* Notification panel, dynamically insert this into the live region when it needs to be displayed */}
|
|
42
|
-
<Transition
|
|
43
|
-
show={pop_up_boxState}
|
|
44
|
-
as={Fragment}
|
|
45
|
-
enter="transform ease-out duration-300 transition"
|
|
46
|
-
enterFrom="translate-y-2 opacity-0 sm:translate-y-0 sm:translate-x-2"
|
|
47
|
-
enterTo="translate-y-0 opacity-100 sm:translate-x-0"
|
|
48
|
-
leave="transition ease-in duration-100"
|
|
49
|
-
leaveFrom="opacity-100"
|
|
50
|
-
leaveTo="opacity-0"
|
|
51
|
-
>
|
|
52
|
-
<div className={classNames(pop_up_boxData.state?"bg-green-50":"bg-red-50","pointer-events-auto w-full max-w-xs overflow-hidden rounded-lg ")}>
|
|
53
|
-
<div className="p-4">
|
|
54
|
-
<div className="flex items-center">
|
|
55
|
-
<img className={pop_up_boxData.state?"w-10 mt-1":"hidden"} src="/successful.svg" alt=""/>
|
|
56
|
-
<img className={pop_up_boxData.state?"hidden":"w-10 mt-1"} src="/fail.svg" alt=""/>
|
|
57
|
-
<div className="ml-3 w-0 flex-1 pt-0.5 text-white text-sm">
|
|
58
|
-
<p className={classNames(pop_up_boxData.state?
|
|
59
|
-
"text-green-800"
|
|
60
|
-
:
|
|
61
|
-
"text-red-800",
|
|
62
|
-
"text-sm font-medium ")}>{pop_up_boxData.type} {classNames(pop_up_boxData.state?"success":"fail")}</p>
|
|
63
|
-
<p className={pop_up_boxData.state?"hidden":"mt-1 text-red-800 font-black"}>Please try again</p>
|
|
64
|
-
<div className={pop_up_boxData.hash == ""? "hidden":""}>
|
|
65
|
-
<Link legacyBehavior href={`https://explorer.sui.io/transaction/${pop_up_boxData.hash}?network=https%3A%2F%2Fwallet-rpc.devnet.sui.io%2F` } target="_Blank">
|
|
66
|
-
<a className={classNames(pop_up_boxData.state?
|
|
67
|
-
"bg-green-50 text-green-500 hover:bg-green-100"
|
|
68
|
-
:
|
|
69
|
-
"bg-red-50 text-red-500 hover:bg-red-100",
|
|
70
|
-
"mt-1 underline font-semibold ")}
|
|
71
|
-
target="_Blank">
|
|
72
|
-
View on Explorer
|
|
73
|
-
</a></Link>
|
|
74
|
-
|
|
75
|
-
</div>
|
|
76
|
-
</div>
|
|
77
|
-
|
|
78
|
-
<div className="-mt-4 flex flex-shrink-0">
|
|
79
|
-
<button
|
|
80
|
-
type="button"
|
|
81
|
-
className={classNames(pop_up_boxData.state?
|
|
82
|
-
"bg-green-50 text-green-500 hover:bg-green-100"
|
|
83
|
-
:
|
|
84
|
-
"bg-red-50 text-red-500 hover:bg-red-100",
|
|
85
|
-
"inline-flex rounded-md p-1.5")}
|
|
86
|
-
onClick={() => {
|
|
87
|
-
setSop_up_boxState(false)
|
|
88
|
-
}}
|
|
89
|
-
>
|
|
90
|
-
<i className="fa fa-times" aria-hidden="true"></i>
|
|
91
|
-
<span className="sr-only">Close</span>
|
|
92
|
-
</button>
|
|
93
|
-
</div>
|
|
94
|
-
</div>
|
|
95
|
-
</div>
|
|
96
|
-
</div>
|
|
97
|
-
</Transition>
|
|
98
|
-
</div>
|
|
99
|
-
</div>
|
|
100
|
-
)
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
//加载弹出框
|
|
104
|
-
const Loading = () =>{
|
|
105
|
-
const [openLoading,setOpenLoading] =useAtom(OpenBoxState)
|
|
106
|
-
return(
|
|
107
|
-
<>
|
|
108
|
-
<Transition.Root show={openLoading} as={Fragment}>
|
|
109
|
-
<Dialog as="div" className="relative z-50" onClose={()=>false}>
|
|
110
|
-
<Transition.Child
|
|
111
|
-
as={Fragment}
|
|
112
|
-
enter="ease-out duration-300"
|
|
113
|
-
enterFrom="opacity-0"
|
|
114
|
-
enterTo="opacity-100"
|
|
115
|
-
leave="ease-in duration-200"
|
|
116
|
-
leaveFrom="opacity-100"
|
|
117
|
-
leaveTo="opacity-0"
|
|
118
|
-
>
|
|
119
|
-
<div className="fixed inset-0 bg-gray-400 bg-opacity-50 transition-opacity" />
|
|
120
|
-
</Transition.Child>
|
|
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
|
-
|
|
149
|
-
|