umwd-components 0.1.42 → 0.1.43

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "umwd-components",
3
- "version": "0.1.42",
3
+ "version": "0.1.43",
4
4
  "description": "UMWD Component library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
Binary file
Binary file
Binary file
Binary file
@@ -2,6 +2,7 @@
2
2
 
3
3
  import React from "react";
4
4
  import Link from "next/link";
5
+ import Image from "next/image";
5
6
 
6
7
  import {
7
8
  Dialog,
@@ -83,7 +84,7 @@ function NavBar({ site_title, logo, pages = [], tabs = [], maxWidth = "xl" }) {
83
84
  alignItems: "center",
84
85
  }}
85
86
  >
86
- <Box sx={{ display: "flex", mr: 1 }}>
87
+ {/* <Box sx={{ display: "flex", mr: 1 }}>
87
88
  <img
88
89
  src={logo.url}
89
90
  width={logo.width || "32px"}
@@ -91,7 +92,18 @@ function NavBar({ site_title, logo, pages = [], tabs = [], maxWidth = "xl" }) {
91
92
  alt="site logo"
92
93
  style={{ maxWidth: "60px", maxHeight: "60px" }}
93
94
  />
94
- </Box>
95
+ </Box> */}
96
+ <Image
97
+ src={logo.url}
98
+ width={
99
+ logo.height >= 50
100
+ ? (logo.width / logo.height) * 50
101
+ : logo.width
102
+ }
103
+ height={logo.height}
104
+ alt={logo.alt || "site logo"}
105
+ style={{ maxHeight: "50px" }}
106
+ />
95
107
  {site_title !== undefined && (
96
108
  <Typography
97
109
  variant="h6"
@@ -108,6 +120,8 @@ function NavBar({ site_title, logo, pages = [], tabs = [], maxWidth = "xl" }) {
108
120
  </Box>
109
121
  </Link>
110
122
 
123
+ <Box sx={{ display: "block", width: "30px" }}></Box>
124
+
111
125
  {/* Large screen menu */}
112
126
  {pages.length > 0 && (
113
127
  <Box
@@ -137,6 +151,39 @@ function NavBar({ site_title, logo, pages = [], tabs = [], maxWidth = "xl" }) {
137
151
  </Box>
138
152
  )}
139
153
 
154
+ {/* Tabs */}
155
+ {tabs.length > 0 && (
156
+ <Box
157
+ sx={{
158
+ flexGrow: 1,
159
+ display: { xs: "none", md: "flex" },
160
+ }}
161
+ >
162
+ <Tabs
163
+ value={currentTab}
164
+ onChange={(event, newValue) => handleChange(event, newValue)}
165
+ aria-label="wrapped label tabs example"
166
+ textColor="secondary"
167
+ indicatorColor="secondary"
168
+ variant="fullWidth"
169
+ >
170
+ {tabs.length > 0 &&
171
+ tabs.map((tab) => {
172
+ return (
173
+ <Tab
174
+ key={tab.name}
175
+ value={tab.name}
176
+ label={tab.name}
177
+ onClick={() => {
178
+ router.push(tab.url);
179
+ }}
180
+ />
181
+ );
182
+ })}
183
+ </Tabs>
184
+ </Box>
185
+ )}
186
+
140
187
  {/* small screen logo and site title */}
141
188
  <Link href="/" style={{ textDecoration: "none", color: "unset" }}>
142
189
  <Box
@@ -276,32 +323,6 @@ function NavBar({ site_title, logo, pages = [], tabs = [], maxWidth = "xl" }) {
276
323
  </Dialog>
277
324
  </Box>
278
325
  </Toolbar>
279
-
280
- {/* Tabs */}
281
- {tabs.length > 0 && (
282
- <Tabs
283
- value={currentTab}
284
- onChange={(event, newValue) => handleChange(event, newValue)}
285
- aria-label="wrapped label tabs example"
286
- textColor="secondary"
287
- indicatorColor="secondary"
288
- variant="fullWidth"
289
- >
290
- {tabs.length > 0 &&
291
- tabs.map((tab) => {
292
- return (
293
- <Tab
294
- key={tab.name}
295
- value={tab.name}
296
- label={tab.name}
297
- onClick={() => {
298
- router.push(tab.url);
299
- }}
300
- />
301
- );
302
- })}
303
- </Tabs>
304
- )}
305
326
  </Container>
306
327
  </AppBar>
307
328
  );
@@ -1,6 +1,7 @@
1
1
  import NavBar from "../components/NavBar";
2
2
  import React from "react";
3
3
  import thumbnail from "../../public/placeholders/thumbnail_100X100.png";
4
+ import logoText from "../../public/logo_text.png";
4
5
 
5
6
  export default {
6
7
  title: "UMWD/NavBar",
@@ -65,3 +66,31 @@ UMWD.args = {
65
66
  },
66
67
  ],
67
68
  };
69
+
70
+ export const AMH = Template.bind({});
71
+
72
+ AMH.args = {
73
+ logo: {
74
+ url: logoText.src,
75
+ width: logoText.width,
76
+ height: logoText.height,
77
+ alt: "Logo",
78
+ },
79
+ tabs: [
80
+ {
81
+ name: "Resources",
82
+ link: "/resources",
83
+ action: () => console.log("Services"),
84
+ },
85
+ {
86
+ name: "Shop",
87
+ link: "/shop",
88
+ action: () => console.log("About"),
89
+ },
90
+ {
91
+ name: "Contact",
92
+ link: "/contact",
93
+ action: () => console.log("Contact"),
94
+ },
95
+ ],
96
+ };
Binary file
Binary file