Amber Shopify Project created using ReactJS+React-Redux with GraphQL API integration. Storefront Shopify API: https://github.com/Shopify/shopify-app-js/tree/main/packages/api-clients/storefront-api-client#readme
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

Home.jsx 7.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. import React from 'react'
  2. import { Box, Button, Typography } from '@mui/material'
  3. import Grid from '@mui/material/Grid2';
  4. import LocationOnIcon from '@mui/icons-material/LocationOn';
  5. import CarouselContainer from '../components/CarouselContainer'
  6. import ProductSelected from '../components/ProductSelected'
  7. // import SocialMedia from '../components/SocialMedia'
  8. // import Feature from '../components/Feature'
  9. // import { Link } from '@mui/material'
  10. import VideoAds from '../components/VideoAds'
  11. import ProductType from '../components/ProductType';
  12. // import NewsLetter from '../components/NewsLetter';
  13. import ProductService from "../services/ProductService"
  14. import AmberHomeWallpaper from "../assets/images/amberHomeWallpaper.webp";
  15. import AmberBeautyWallpaper from "../assets/images/amberBeautyWallpaper.webp";
  16. import AmberClothing from "../assets/images/MAINHEADER-13.webp"
  17. const stores = [
  18. {
  19. // name: "AMBER IOI STORE",
  20. // address: "IOI City Mall",
  21. name: "IOI CITY MALL",
  22. address: "G-67 IOI CITY MALL, PUTRAJAYA",
  23. image: "/AMBERIOISTORE.jpeg",
  24. directionUrl: "https://www.google.com/maps/search/?api=1&query=IOI%20City%20Mall%20Putrajaya"
  25. },
  26. {
  27. // name: "AMBER SWM STORE",
  28. // address: "Wangsa Walk Mall",
  29. name: "WANGSA WALK MALL",
  30. address: "LOT G-77, WANGSA WALK MALL, KUALA LUMPUR",
  31. image: "/AMBERSWMSTORE.jpeg",
  32. directionUrl: "https://www.google.com/maps/search/?api=1&query=AMBER%20Wangsa%20Walk%20Mall"
  33. }
  34. ]
  35. const Home = () => {
  36. React.useEffect(()=>{
  37. ProductService.getProducts();
  38. },[])
  39. return (
  40. <>
  41. <CarouselContainer />
  42. <Box sx={{
  43. px: {
  44. xs: 2,
  45. md: 5,
  46. lg: 5
  47. }
  48. }}>
  49. <ProductSelected />
  50. </Box>
  51. <VideoAds />
  52. <Box sx={{
  53. px: {
  54. xs: 2,
  55. md: 5,
  56. lg: 5
  57. },
  58. mb: {
  59. xs: 2,
  60. md: 5,
  61. lg: 10
  62. }
  63. }}>
  64. <Box sx={{ flexGrow: 1, mt: 5 }}>
  65. <Grid container spacing={2}>
  66. <Grid size={12}>
  67. <ProductType title={'Apparel'} img_url={AmberClothing}/>
  68. </Grid>
  69. <Grid size={{xs:12, md:6}}>
  70. {/* <ProductType title={'BEAUTY'} img_url={AmberBeautyWallpaper}/> */}
  71. <ProductType title={'Essentials'} img_url={AmberBeautyWallpaper}/>
  72. </Grid>
  73. <Grid size={{xs:12, md:6}}>
  74. {/* <ProductType title={'HOME'} img_url={AmberHomeWallpaper} /> */}
  75. <ProductType title={'Essentials'} img_url={AmberHomeWallpaper} />
  76. </Grid>
  77. </Grid>
  78. </Box>
  79. </Box>
  80. {/*
  81. <NewsLetter />
  82. */}
  83. <Box sx={{ px:{
  84. xs: 2,
  85. md: 5,
  86. lg: 5
  87. }, mb: 10 }}>
  88. {/*
  89. <Feature />
  90. */}
  91. <Box id="find-us" sx={{ textAlign: "center", mt: 6 }}>
  92. <Typography
  93. component="a"
  94. href="#find-us"
  95. variant="body1"
  96. sx={{
  97. color: "inherit",
  98. display: "inline-block",
  99. fontWeight: "400",
  100. fontSize: {
  101. xs: "1.8rem",
  102. md: "2rem"
  103. },
  104. mb: 4,
  105. letterSpacing: 0,
  106. textDecoration: "none",
  107. textTransform: "uppercase"
  108. }}
  109. >
  110. FIND US
  111. </Typography>
  112. <Grid
  113. container
  114. spacing={2}
  115. sx={{
  116. maxWidth: 1200,
  117. mx: "auto"
  118. }}
  119. >
  120. {stores.map(({ name, address, image, directionUrl }) => (
  121. <Grid key={name} size={{ xs: 12, md: 6 }}>
  122. <Box
  123. sx={{
  124. position: "relative",
  125. height: {
  126. xs: 280,
  127. sm: 360,
  128. md: 400
  129. },
  130. overflow: "hidden",
  131. borderRadius: "4px",
  132. textAlign: "left",
  133. "&:hover .store-image": {
  134. transform: "scale(1.06)"
  135. }
  136. }}
  137. >
  138. <Box
  139. className="store-image"
  140. sx={{
  141. position: "absolute",
  142. inset: 0,
  143. backgroundImage: `url("${image}")`,
  144. backgroundSize: "cover",
  145. backgroundPosition: "center",
  146. transition: "transform 550ms ease",
  147. transform: "scale(1)"
  148. }}
  149. />
  150. <Box
  151. sx={{
  152. position: "absolute",
  153. inset: 0,
  154. background: "linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(0,0,0,0.62) 100%)"
  155. }}
  156. />
  157. <Box
  158. sx={{
  159. position: "absolute",
  160. left: {
  161. xs: 8,
  162. md: 9
  163. },
  164. right: {
  165. xs: 3,
  166. md: 4
  167. },
  168. bottom: {
  169. xs: 8,
  170. md: 9
  171. },
  172. color: "#FFF"
  173. }}
  174. >
  175. <Typography
  176. variant="h4"
  177. sx={{
  178. fontWeight: "700",
  179. mb: 0.5,
  180. textTransform: "uppercase",
  181. fontSize: {
  182. xs: "1.45rem",
  183. md: "1.65rem"
  184. },
  185. lineHeight: 1.1,
  186. textShadow: "0 1px 8px rgba(0,0,0,0.55)"
  187. }}
  188. >
  189. {name}
  190. </Typography>
  191. <Typography
  192. variant="body2"
  193. sx={{
  194. fontWeight: "400",
  195. mb: 2,
  196. textTransform: "uppercase",
  197. fontSize: {
  198. xs: "0.8rem",
  199. md: "0.9rem"
  200. },
  201. textShadow: "0 1px 8px rgba(0,0,0,0.55)"
  202. }}
  203. >
  204. {address}
  205. </Typography>
  206. <Button
  207. href={directionUrl}
  208. target="_blank"
  209. rel="noreferrer"
  210. variant="contained"
  211. sx={{
  212. backgroundColor: "#000",
  213. color: "#FFF",
  214. textTransform: "none",
  215. borderRadius: "4px",
  216. minHeight: 38,
  217. px: 2,
  218. fontWeight: "700",
  219. fontSize: "0.875rem",
  220. "&:hover": {
  221. backgroundColor: "#222"
  222. }
  223. }}
  224. startIcon={<LocationOnIcon />}
  225. >
  226. Directions
  227. </Button>
  228. </Box>
  229. </Box>
  230. </Grid>
  231. ))}
  232. </Grid>
  233. </Box>
  234. </Box>
  235. </>
  236. )
  237. }
  238. export default Home