1- import React from 'react' ;
1+ import React , { useEffect } from 'react' ;
22import { BackgroundImage } from '../components/BackgroundImage' ;
33import { Layout } from '../components/Layout' ;
44import { CategoryList } from '../components/CategoryList' ;
55import { CardDescriptor } from "../data/types" ;
66import { CustomSection } from '../components/CustomizedSection' ;
77import { OrderedImgText } from '../components/OrderedImageCard' ;
88import { Testemonials } from '../components/Testemonials' ;
9+ import { isAdmin } from "../helpers/adminStore" ;
10+ import { useStore } from '@nanostores/react' ;
11+ import AdminView from '../components/AdminView' ;
912
1013const data : CardDescriptor [ ] = [
1114 { img : '/listViewImages/silverBraceletOnyx.png' , collectionText : "Silver Bracelet with Onyx" } ,
@@ -28,6 +31,11 @@ const Home: React.FC = () => {
2831 const title = "Vilora Jewelry" ;
2932 const subtitle = "We offer exquisite jewelry, each showcasing timeless elegance" ;
3033 const buttonText = "See Collections" ;
34+ const isAdminValue = useStore ( isAdmin ) ;
35+
36+ useEffect ( ( ) => {
37+ console . log ( isAdminValue ? 'Admin' : 'Client' ) ;
38+ } , [ isAdminValue ] ) ;
3139
3240 return (
3341 < >
@@ -38,75 +46,85 @@ const Home: React.FC = () => {
3846 img = "/model_1.png"
3947 />
4048
41- < Layout >
42- < section
43- className = "k-d-grid k-grid-cols-12 k-justify-content-center k-align-items-center k-col-span-12"
44- style = { { paddingTop : "60px" } }
45- >
46- < CategoryList title = 'Our Bestsellers' subtitle = 'Enjoy an excellent selection of fine jewelry' data = { data } />
47- </ section >
48- </ Layout >
49- < Layout >
50- < CustomSection >
51- < OrderedImgText
52- title = 'Timeless Classics'
53- subtitle = 'Get our unique handmade collections'
54- contentText = 'Jewelry enhances style and adds elegance, with each piece telling a unique story.'
55- img = "/homeModel2.png"
56- order = 'first'
57- link = "Shop Now"
58- />
59- </ CustomSection >
60- </ Layout >
61- < Layout >
62- < CustomSection >
63- < OrderedImgText
64- title = 'Fine Jewelry'
65- subtitle = 'Get our unique handmade collections'
66- contentText = "Jewelry elevates one's style and brings sophistication, with every piece narrating a distinct tale."
67- img = "/homeModel3.png"
68- order = 'last'
69- link = "Shop Now"
70- />
71- </ CustomSection >
72- </ Layout >
73- < Layout >
74- < CustomSection >
75- < CategoryList colSpan = { 6 } title = 'Our Rings' subtitle = 'Enjoy an excellent selection of fine rings' data = { ringsData } />
76- </ CustomSection >
77- </ Layout >
78- < Layout >
79- < CustomSection >
80- < OrderedImgText
81- title = 'Always On Time'
82- subtitle = 'Get our unique watches'
83- contentText = 'High-end gold watches for men are the epitome of luxury, combining precision with sophisticated craftsmanship.'
84- img = "/homeWatch1.png"
85- order = 'first'
86- link = "Shop Now"
87- />
88- </ CustomSection >
89- </ Layout >
90- < Layout >
91- < CustomSection >
92- < CategoryList title = 'Our Watches' subtitle = 'Enjoy an excellent selection of watches' data = { watchData } />
93- </ CustomSection >
94- </ Layout >
95- < Layout >
96- < CustomSection >
97- < OrderedImgText
98- title = 'Services'
99- subtitle = 'Explore expert repairs to elevate your experience'
100- contentText = 'Vilora provides services like custom designs, repairs, and appraisals to enhance the customer experience.'
101- img = "/homeServicesImage.png"
102- order = 'last'
103- link = "Learn More"
104- />
105- </ CustomSection >
106- </ Layout >
107- < Layout >
108- < Testemonials />
109- </ Layout >
49+ { isAdminValue ? (
50+ < Layout >
51+ < div className = "k-mt-8" >
52+ < AdminView />
53+ </ div >
54+ </ Layout >
55+ ) : (
56+ < >
57+ < Layout >
58+ < section
59+ className = "k-d-grid k-grid-cols-12 k-justify-content-center k-align-items-center k-col-span-12"
60+ style = { { paddingTop : "60px" } }
61+ >
62+ < CategoryList title = 'Our Bestsellers' subtitle = 'Enjoy an excellent selection of fine jewelry' data = { data } />
63+ </ section >
64+ </ Layout >
65+ < Layout >
66+ < CustomSection >
67+ < OrderedImgText
68+ title = 'Timeless Classics'
69+ subtitle = 'Get our unique handmade collections'
70+ contentText = 'Jewelry enhances style and adds elegance, with each piece telling a unique story.'
71+ img = "/homeModel2.png"
72+ order = 'first'
73+ link = "Shop Now"
74+ />
75+ </ CustomSection >
76+ </ Layout >
77+ < Layout >
78+ < CustomSection >
79+ < OrderedImgText
80+ title = 'Fine Jewelry'
81+ subtitle = 'Get our unique handmade collections'
82+ contentText = "Jewelry elevates one's style and brings sophistication, with every piece narrating a distinct tale."
83+ img = "/homeModel3.png"
84+ order = 'last'
85+ link = "Shop Now"
86+ />
87+ </ CustomSection >
88+ </ Layout >
89+ < Layout >
90+ < CustomSection >
91+ < CategoryList colSpan = { 6 } title = 'Our Rings' subtitle = 'Enjoy an excellent selection of fine rings' data = { ringsData } />
92+ </ CustomSection >
93+ </ Layout >
94+ < Layout >
95+ < CustomSection >
96+ < OrderedImgText
97+ title = 'Always On Time'
98+ subtitle = 'Get our unique watches'
99+ contentText = 'High-end gold watches for men are the epitome of luxury, combining precision with sophisticated craftsmanship.'
100+ img = "/homeWatch1.png"
101+ order = 'first'
102+ link = "Shop Now"
103+ />
104+ </ CustomSection >
105+ </ Layout >
106+ < Layout >
107+ < CustomSection >
108+ < CategoryList title = 'Our Watches' subtitle = 'Enjoy an excellent selection of watches' data = { watchData } />
109+ </ CustomSection >
110+ </ Layout >
111+ < Layout >
112+ < CustomSection >
113+ < OrderedImgText
114+ title = 'Services'
115+ subtitle = 'Explore expert repairs to elevate your experience'
116+ contentText = 'Vilora provides services like custom designs, repairs, and appraisals to enhance the customer experience.'
117+ img = "/homeServicesImage.png"
118+ order = 'last'
119+ link = "Learn More"
120+ />
121+ </ CustomSection >
122+ </ Layout >
123+ < Layout >
124+ < Testemonials />
125+ </ Layout >
126+ </ >
127+ ) }
110128 </ >
111129 ) ;
112130} ;
0 commit comments