Browse Source

done mobile design

cart-api-guide
azri 1 week ago
parent
commit
e7a9ed4fec

+ 3
- 0
src/assets/svg/logo.svg View File

@@ -0,0 +1,3 @@
1
+<svg xmlns="http://www.w3.org/2000/svg" width="194" height="45" viewBox="0 0 194 45">
2
+  <text id="AMBER" transform="translate(97 37)" fill="#fff" font-size="37" font-family="Lato-Bold, Lato" font-weight="700" letter-spacing="0.426em"><tspan x="-96.57" y="0">AMBER</tspan></text>
3
+</svg>

+ 1
- 1
src/components/ConfirmOrder/ConfirmOrder.jsx View File

@@ -208,7 +208,7 @@ const ConfirmOrder = () => {
208 208
 
209 209
         <ProductSuggestion />
210 210
 
211
-      </Box>
211
+      </Box> 
212 212
 
213 213
       <Typography variant='body2' sx={{ mb: 4, color: "#AEAEAE", letterSpacing: 1, textAlign:"center", mt:3, mb:6 }}>
214 214
         <span style={{ color: "#000", fontWeight: "bold" }}>NEED HELP?</span> CALL US: +44 (0)10 2345 6789 | EMAIL CUSTOMER CARE | SHIPPING INFORMATION | RETURNS & EXCHANGES

+ 15
- 9
src/components/Header/Header.jsx View File

@@ -1,6 +1,6 @@
1 1
 import React from 'react';
2
-import { styled } from '@mui/material/styles';
3
-import { Box, Typography } from '@mui/material';
2
+import { createStyles, styled } from '@mui/material/styles';
3
+import { Box, Typography, Link } from '@mui/material';
4 4
 import InstagramIcon from '@mui/icons-material/Instagram';
5 5
 import FacebookIcon from '@mui/icons-material/Facebook';
6 6
 import TwitterIcon from '@mui/icons-material/Twitter';
@@ -8,8 +8,8 @@ import PinterestIcon from '@mui/icons-material/Pinterest';
8 8
 
9 9
 const Container = styled(Box)(({theme})=>({
10 10
     backgroundColor: theme.palette.primary.main,
11
-    paddingTop: 20,
12
-    paddingBottom: 20,
11
+    paddingTop: 10,
12
+    paddingBottom: 10,
13 13
     width: "100%",
14 14
     display:"flex",
15 15
     position:"relative",
@@ -19,6 +19,12 @@ const Container = styled(Box)(({theme})=>({
19 19
     },
20 20
 }))
21 21
 
22
+const headerStyle = createStyles({
23
+    icon:{
24
+        fontSize:17
25
+    }
26
+})
27
+
22 28
 
23 29
 const Header = () => {
24 30
 
@@ -26,12 +32,12 @@ const Header = () => {
26 32
         <Container>
27 33
             <Box sx={{color:"white", px:23}}>
28 34
                 <Box sx={{display:"flex", gap:1}}>
29
-                    <InstagramIcon style={{ fontSize: 20 }} />
30
-                    <FacebookIcon style={{ fontSize: 20 }} />
31
-                    <TwitterIcon style={{ fontSize: 20 }} />
32
-                    <PinterestIcon style={{ fontSize: 20 }} />
35
+                    <InstagramIcon style={headerStyle.icon} />
36
+                    <FacebookIcon style={headerStyle.icon} />
37
+                    <TwitterIcon style={headerStyle.icon} />
38
+                    <PinterestIcon style={headerStyle.icon} />
33 39
                 </Box>
34
-                <Typography variant="body2" sx={{position: "absolute", top: "50%", left: "50%", transform: "translate(-50%, -50%)" }}>Don’t miss out on our next big thing! Click here to subcribe now.</Typography>
40
+                <Typography variant="body2" sx={{position: "absolute", top: "50%", left: "50%", transform: "translate(-50%, -50%)" }}>Don’t miss out on our next big thing! Click <Link sx={{color:"white", textDecoration:"underline"}}> here</Link> to subcribe now.</Typography>
35 41
             </Box>
36 42
         </Container>
37 43
     );

+ 175
- 77
src/components/Navbar/Navbar.jsx View File

@@ -8,11 +8,58 @@ import Box from "@mui/material/Box";
8 8
 import Header from "../Header";
9 9
 import InputBase from "@mui/material/InputBase";
10 10
 import SearchIcon from "@mui/icons-material/Search";
11
+import LocalMallIcon from '@mui/icons-material/LocalMall';
11 12
 import AccountCircleIcon from "@mui/icons-material/AccountCircle";
13
+import logoSrc from "../../assets/svg/logo.svg";
14
+import { styled } from '@mui/material/styles';
15
+import { MenuItem, Select, FormControl, Badge } from '@mui/material';
16
+import MobileNav from "./components/MobileNav";
17
+import { TrainRounded } from "@mui/icons-material";
18
+
19
+
20
+
21
+
22
+const LanguageSelect = styled(Select)(({ theme }) => ({
23
+  backgroundColor: 'black',
24
+  color: 'white',
25
+  border: '1px solid black',
26
+  fontSize: 12,
27
+  '& .MuiSelect-icon': {
28
+    color: 'white',
29
+  },
30
+  '&:hover': {
31
+    backgroundColor: 'white',
32
+    color: 'black',
33
+  },
34
+  '& .MuiMenuItem-root': {
35
+    backgroundColor: 'black',
36
+    color: 'white',
37
+  },
38
+  '& .MuiMenuItem-root:hover': {
39
+    backgroundColor: 'white',
40
+    color: 'black',
41
+  },
42
+}));
43
+
44
+const LanguageSelectItem = styled(MenuItem)(() => ({
45
+  backgroundColor: 'black',
46
+  color: 'white',
47
+  '&:hover': {
48
+    backgroundColor: 'white',
49
+    color: 'black',
50
+  },
51
+}));
52
+
12 53
 
13 54
 const Navbar = () => {
55
+
14 56
   const [showHeader, setShowHeader] = useState(true);
15 57
   const [lastScrollPos, setLastScrollPos] = useState(0);
58
+  const [language, setLanguage] = useState('English');
59
+
60
+  const handleChange = (event) => {
61
+    setLanguage(event.target.value);
62
+  };
16 63
 
17 64
   useEffect(() => {
18 65
     const handleScroll = () => {
@@ -32,91 +79,142 @@ const Navbar = () => {
32 79
   }, [lastScrollPos]);
33 80
 
34 81
   return (
35
-    <AppBar position="fixed" sx={{ backgroundColor: "background.black" }}>
36
-      {/* Conditionally render the Header */}
37
-      {showHeader && <Header />}
38
-
39
-      <Toolbar>
40
-        {/* Left Section: Logo */}
41
-        <Typography
42
-          variant="h6"
43
-          sx={{
44
-            flexGrow: 0,
45
-            color: "white",
46
-            letterSpacing: 10,
47
-            mx: 20,
48
-          }}
49
-        >
50
-          AMBER
51
-        </Typography>
52
-
53
-        {/* Center Section: Nav Items */}
54
-        <Box
55
-          sx={{
56
-            flexGrow: 1,
57
-            display: "flex",
58
-            gap: 2,
59
-          }}
60
-        >
61
-          <Button
62
-            color="inherit"
63
-            onClick={() => {
64
-              window.location.href = "/products";
65
-            }}
66
-          >
67
-            DISCOVER
68
-          </Button>
69
-          <Button
70
-            color="inherit"
71
-            onClick={() => {
72
-              window.location.href = "/";
73
-            }}
74
-          >
75
-            HOME
76
-          </Button>
77
-          <Button
78
-            color="inherit"
79
-            onClick={() => {
80
-              window.location.href = "/products";
81
-            }}
82
-          >
83
-            BEAUTY
84
-          </Button>
85
-          <Button
86
-            color="inherit"
87
-            onClick={() => {
88
-              window.location.href = "/products";
89
-            }}
90
-          >
91
-            SALE
92
-          </Button>
93
-        </Box>
82
+    <>
83
+      <AppBar position="fixed"
84
+        sx={{
85
+          backgroundColor: {
86
+            xs: "rgba(0,0,0,0)",
87
+            md: "rgba(0,0,0,0.9)",
88
+            lg: "background.black"
89
+          },
90
+          boxShadow: {
91
+            xs: "none",
92
+            md: "none",
93
+            lg: "0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12)"
94
+          }
95
+        }}
96
+      >
94 97
 
95
-        {/* Right Section: Search and Profile */}
96
-        <Box sx={{ display: "flex", alignItems: "center", marginRight: 20 }}>
98
+        {/* Conditionally render the Header */}
99
+        {showHeader && <Header />}
100
+
101
+        <Toolbar sx={{
102
+          px: {
103
+            xs: 2,
104
+            md: 10,
105
+            lg: 20
106
+          },
107
+          py: 0.5
108
+        }} disableGutters>
109
+
110
+          {/* Left Section: Logo */}
111
+          <Box sx={{
112
+            display:{
113
+              xs:"none",
114
+              md:"none",
115
+              lg:"block"
116
+            }
117
+          }}>
118
+            <img src={logoSrc} alt="Logo"
119
+              style={{
120
+                width: 150,
121
+                height: 50,
122
+              }} />
123
+          </Box>
124
+
125
+          {/* Center Section: Nav Items */}
97 126
           <Box
98 127
             sx={{
99
-              display: "flex",
100
-              alignItems: "center",
101
-              backgroundColor: "rgba(255, 255, 255, 0.15)",
102
-              borderRadius: 1,
103
-              padding: "0 8px",
128
+              flexGrow: 1,
129
+              display: {
130
+                xs: "none",
131
+                md: "none",
132
+                lg: "flex"
133
+              },
134
+              gap: 2,
104 135
             }}
105 136
           >
106
-            <SearchIcon />
107
-            <InputBase
108
-              placeholder="Search…"
137
+            <Button
138
+              color="inherit"
139
+              onClick={() => {
140
+                window.location.href = "/products";
141
+              }}
142
+            >
143
+              DISCOVER
144
+            </Button>
145
+            <Button
146
+              color="inherit"
147
+              onClick={() => {
148
+                window.location.href = "/";
149
+              }}
150
+            >
151
+              HOME
152
+            </Button>
153
+            <Button
154
+              color="inherit"
155
+              onClick={() => {
156
+                window.location.href = "/products";
157
+              }}
158
+            >
159
+              BEAUTY
160
+            </Button>
161
+            <Button
162
+              color="inherit"
163
+              onClick={() => {
164
+                window.location.href = "/products";
165
+              }}
166
+            >
167
+              SALE
168
+            </Button>
169
+          </Box>
170
+
171
+          {/* Right Section: Search and Profile */}
172
+          <Box sx={{ display: "flex", alignItems: "center", gap: 1.2, ml: "auto" }}>
173
+
174
+            <FormControl
109 175
               sx={{
110
-                color: "inherit",
176
+                display: {
177
+                  xs: "none",
178
+                  lg: "block"
179
+                }
111 180
               }}
112
-            />
181
+            >
182
+              <LanguageSelect
183
+                value={language}
184
+                onChange={handleChange}
185
+                label=""
186
+                MenuProps={{
187
+                  PaperProps: {
188
+                    style: {
189
+                      backgroundColor: 'black',
190
+                      color: 'white'
191
+                    },
192
+                  },
193
+                }}
194
+              >
195
+                <LanguageSelectItem value="English">English</LanguageSelectItem>
196
+                <LanguageSelectItem value="Malay">Malay</LanguageSelectItem>
197
+                <LanguageSelectItem value="Chinese">Chinese</LanguageSelectItem>
198
+              </LanguageSelect>
199
+            </FormControl>
200
+
201
+            <IconButton color="inherit">
202
+              <SearchIcon sx={{ color: "white" }} />
203
+            </IconButton>
204
+
205
+            <Badge badgeContent={1} color="primary">
206
+              <LocalMallIcon color="action" sx={{ color: "white" }} />
207
+            </Badge>
208
+
209
+            <IconButton color="inherit">
210
+              <AccountCircleIcon sx={{ color: "white" }} />
211
+            </IconButton>
113 212
           </Box>
114
-          <IconButton color="inherit">
115
-            <AccountCircleIcon sx={{ color: "white" }} />
116
-          </IconButton>
117
-        </Box>
118
-      </Toolbar>
119
-    </AppBar>
213
+
214
+        </Toolbar>
215
+      </AppBar>
216
+      {/* <MobileNav open={true} menu={[]}/> */}
217
+    </>
120 218
   );
121 219
 };
122 220
 

+ 74
- 0
src/components/Navbar/components/MobileNav/MobileNav.jsx View File

@@ -0,0 +1,74 @@
1
+import React from "react";
2
+import { Drawer, Box, List, ListItem, ListItemButton, ListItemIcon, ListItemText, Divider } from "@mui/material";
3
+import logoSrc from "../../assets/svg/logo.svg";
4
+import InboxIcon from "@mui/icons-material/Inbox";
5
+import MailIcon from "@mui/icons-material/Mail";
6
+
7
+const MobileNav = ({ open, menu = [] }) => {
8
+  return (
9
+    <Drawer
10
+      open={open}
11
+      onClose={() => {}}
12
+      sx={{
13
+        "& .MuiDrawer-paper": {
14
+          backgroundColor: "black",
15
+          color: "white",
16
+          width: 250,
17
+        },
18
+      }}
19
+    >
20
+      {/* Logo Section */}
21
+      <Box
22
+        sx={{
23
+          display: "flex",
24
+          justifyContent: "center",
25
+          alignItems: "center",
26
+          height: 80,
27
+          borderBottom: "1px solid white",
28
+        }}
29
+      >
30
+        <img
31
+          src={logoSrc}
32
+          alt="Logo"
33
+          style={{
34
+            width: 150,
35
+            height: 50,
36
+          }}
37
+        />
38
+      </Box>
39
+
40
+      {/* Main Navigation */}
41
+      <Box sx={{ width: 250 }} role="presentation">
42
+        <List>
43
+          {menu.map((text, index) => (
44
+            <ListItem key={text} disablePadding>
45
+              <ListItemButton
46
+                sx={{
47
+                  color: "white",
48
+                  "&:hover": {
49
+                    backgroundColor: "white",
50
+                    color: "black",
51
+                  },
52
+                }}
53
+              >
54
+                <ListItemIcon
55
+                  sx={{
56
+                    color: "white",
57
+                    "&:hover": {
58
+                      color: "black",
59
+                    },
60
+                  }}
61
+                >
62
+                  {index % 2 === 0 ? <InboxIcon /> : <MailIcon />}
63
+                </ListItemIcon>
64
+                <ListItemText primary={text} />
65
+              </ListItemButton>
66
+            </ListItem>
67
+          ))}
68
+        </List>
69
+      </Box>
70
+    </Drawer>
71
+  );
72
+};
73
+
74
+export default MobileNav;

+ 1
- 0
src/components/Navbar/components/MobileNav/index.js View File

@@ -0,0 +1 @@
1
+export {default} from "./MobileNav"

Loading…
Cancel
Save