@@ -31,75 +31,7 @@ import ModelSkate from "@/_3d/scenes/skate_0";
3131
3232import ClickAwayListener from "@mui/material/ClickAwayListener" ;
3333import Clickable from "../_utils/components/stateless/clickable" ;
34-
35- //
36- const listItems = [
37- {
38- collection : "BAYC" ,
39- list : [ { img : af1x_exemple , title : "hello" , id : 0 } ] ,
40- } ,
41- {
42- collection : "CryptoPunks" ,
43- list : [
44- { img : af1x_exemple , title : "hello" , id : 0 } ,
45- { img : af1x_exemple , title : "hello" , id : 1 } ,
46- { img : af1x_exemple , title : "hello" , id : 2 } ,
47- { img : af1x_exemple , title : "hello" , id : 3 } ,
48- { img : af1x_exemple , title : "hello" , id : 4 } ,
49- { img : af1x_exemple , title : "hello" , id : 5 } ,
50- { img : af1x_exemple , title : "hello" , id : 6 } ,
51- { img : af1x_exemple , title : "hello" , id : 7 } ,
52- ] ,
53- } ,
54- {
55- collection : "Isotile" ,
56- list : [
57- {
58- img : "https://lh3.googleusercontent.com/BBj09xD7R4bBtg1lgnAAS9_TfoYXKwMtudlk-0fVljlURaK7BWcARCpkM-1LGNGTAcsGO6V1TgrtmQFvCo8uVYW_QEfASK-9j6Nr=s300" ,
59- title : "hello" ,
60- id : 0 ,
61- } ,
62- {
63- img : "https://lh3.googleusercontent.com/BBj09xD7R4bBtg1lgnAAS9_TfoYXKwMtudlk-0fVljlURaK7BWcARCpkM-1LGNGTAcsGO6V1TgrtmQFvCo8uVYW_QEfASK-9j6Nr=s300" ,
64- title : "hello" ,
65- id : 1 ,
66- } ,
67- {
68- img : "https://lh3.googleusercontent.com/BBj09xD7R4bBtg1lgnAAS9_TfoYXKwMtudlk-0fVljlURaK7BWcARCpkM-1LGNGTAcsGO6V1TgrtmQFvCo8uVYW_QEfASK-9j6Nr=s300" ,
69- title : "hello" ,
70- id : 2 ,
71- } ,
72- {
73- img : "https://lh3.googleusercontent.com/BBj09xD7R4bBtg1lgnAAS9_TfoYXKwMtudlk-0fVljlURaK7BWcARCpkM-1LGNGTAcsGO6V1TgrtmQFvCo8uVYW_QEfASK-9j6Nr=s300" ,
74- title : "hello" ,
75- id : 3 ,
76- } ,
77- ] ,
78- } ,
79- {
80- collection : "Cool Cats" ,
81- list : [
82- { img : af1x_exemple , title : "hello" , id : 0 } ,
83- { img : af1x_exemple , title : "hello" , id : 1 } ,
84- { img : af1x_exemple , title : "hello" , id : 2 } ,
85- { img : af1x_exemple , title : "hello" , id : 3 } ,
86- { img : af1x_exemple , title : "hello" , id : 4 } ,
87- { img : af1x_exemple , title : "hello" , id : 5 } ,
88- { img : af1x_exemple , title : "hello" , id : 6 } ,
89- { img : af1x_exemple , title : "hello" , id : 7 } ,
90- { img : af1x_exemple , title : "hello" , id : 8 } ,
91- ] ,
92- } ,
93- ] ;
94-
95- const fakeDrop = {
96- id : "0" ,
97- collections : [
98- { name : "alpha" , contract : "0x" } ,
99- { name : "alpha" , contract : "0x" } ,
100- { name : "alpha" , contract : "0x" } ,
101- ] ,
102- } ;
34+ import { useSelector } from "./store/hooks" ;
10335
10436const pastilles = [
10537 {
@@ -151,12 +83,9 @@ export const My3DScene: FC = () => {
15183} ;
15284
15385const Drop : FC = ( ) => {
154- const [ activeStep , setActiveStep ] = React . useState ( 0 ) ;
155-
156- let params = useParams ( ) ;
86+ const state = useSelector ( ( state ) => state . appState ) ;
15787
15888 const [ currentItem , setItem ] = React . useState ( undefined as any ) ;
159-
16089 const [ checked , setChecked ] = React . useState ( false ) ;
16190
16291 const handleChange = ( ) => {
@@ -208,41 +137,45 @@ const Drop: FC = () => {
208137 < Style . BodyLeftSide >
209138 { /* */ }
210139 < Style . InnerLeftSide >
211- { listItems . map ( ( list , index1 ) => (
212- < div key = { index1 } >
213- < Style . CollectionName > { list . collection } </ Style . CollectionName >
214- < ImageList cols = { 4 } gap = { 4 } style = { { marginBottom : "20px" } } >
215- { list . list . map ( ( item , index ) => (
216- < ImageListItem
217- key = { index }
218- style = { {
219- border :
220- currentItem &&
221- currentItem . collection === list . collection &&
222- currentItem . id === item . id
223- ? "3px solid #2AFE00"
224- : "3px solid white" ,
225- cursor : "pointer" ,
226- } }
227- onClick = { ( ) => {
228- setItem ( {
229- collection : list . collection ,
230- id : item . id ,
231- img : item . img ,
232- } ) ;
233- } }
234- >
235- < img
236- src = { `${ item . img } ?w=248&fit=crop&auto=format` }
237- srcSet = { `${ item . img } ?w=248&fit=crop&auto=format&dpr=2 2x` }
238- alt = { item . title }
239- loading = "lazy"
240- />
241- </ ImageListItem >
242- ) ) }
243- </ ImageList >
244- </ div >
245- ) ) }
140+ { state . nfts . length ? (
141+ state . nfts . map ( ( list , index1 ) => (
142+ < div key = { index1 } >
143+ < Style . CollectionName > { list . collection } </ Style . CollectionName >
144+ < ImageList cols = { 4 } gap = { 4 } style = { { marginBottom : "20px" } } >
145+ { list . list . map ( ( item , index ) => (
146+ < ImageListItem
147+ key = { index }
148+ style = { {
149+ border :
150+ currentItem &&
151+ currentItem . collection === list . collection &&
152+ currentItem . id === item . id
153+ ? "3px solid #2AFE00"
154+ : "3px solid white" ,
155+ cursor : "pointer" ,
156+ } }
157+ onClick = { ( ) => {
158+ setItem ( {
159+ collection : list . collection ,
160+ id : item . id ,
161+ img : item . img ,
162+ } ) ;
163+ } }
164+ >
165+ < img
166+ src = { `${ item . img } ?w=248&fit=crop&auto=format` }
167+ srcSet = { `${ item . img } ?w=248&fit=crop&auto=format&dpr=2 2x` }
168+ alt = { item . title }
169+ loading = "lazy"
170+ />
171+ </ ImageListItem >
172+ ) ) }
173+ </ ImageList >
174+ </ div >
175+ ) )
176+ ) : (
177+ < Style . InnerLeftSideNoNfts > You do not own any NFTs :'(</ Style . InnerLeftSideNoNfts >
178+ ) }
246179 </ Style . InnerLeftSide >
247180 </ Style . BodyLeftSide >
248181 </ Style . LeftSide >
0 commit comments