@openstack_dev/gatsby-theme-marketing-oif-core 1.0.15 → 1.0.17

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": "@openstack_dev/gatsby-theme-marketing-oif-core",
3
- "version": "1.0.15",
3
+ "version": "1.0.17",
4
4
  "description": "Base theme for Marketing Sites",
5
5
  "author": "smarcet",
6
6
  "keywords": [
@@ -6,6 +6,7 @@ import Button from "@mui/material/Button";
6
6
  import AddIcon from "@mui/icons-material/Add";
7
7
  import RemoveIcon from "@mui/icons-material/Remove";
8
8
  import ArrowDropDownIcon from "@mui/icons-material/ArrowDropDown";
9
+ import Link from "../../Link";
9
10
 
10
11
  import styles from "../index.module.scss";
11
12
 
@@ -15,7 +16,6 @@ function AuthUserSubNavBar({
15
16
  navbarMenu,
16
17
  setActiveMenu,
17
18
  isSearchBarOpen,
18
- handleNavigation,
19
19
  }) {
20
20
  const onClickLogout = () => {
21
21
  navigate("/auth/logout", {
@@ -40,36 +40,38 @@ function AuthUserSubNavBar({
40
40
  )}
41
41
  </Button>
42
42
  {navbarMenu === "My Account" && (
43
- <Box className={styles.mobileDropdownMenu}>
44
- <Button
45
- className={styles.mobileDropdownOption}
46
- onClick={() => handleNavigation("/profile/")}
47
- sx={{ display: "block" }}
48
- disableRipple
49
- >
50
- Edit Profile
51
- </Button>
52
- <Button
53
- className={styles.mobileDropdownOption}
54
- onClick={() => handleNavigation(
55
- `/community/members/profile/${
43
+ <Box className={styles.mobileDropdownMenu} component="ul">
44
+ <li role="presentation">
45
+ <Link
46
+ className={styles.mobileDropdownOption}
47
+ to="/profile/"
48
+ sx={{ display: "block" }}
49
+ >
50
+ Edit Profile
51
+ </Link>
52
+ </li>
53
+ <li role="presentation">
54
+ <Link
55
+ className={styles.mobileDropdownOption}
56
+ to={`/community/members/profile/${
56
57
  member.id
57
- }/${`${member.first_name.toLowerCase()}-${member.last_name.toLowerCase()}`}`,
58
- )}
59
- sx={{ display: "block" }}
60
- disableRipple
61
- >
62
- View Public Profile
63
- </Button>
58
+ }/${`${member.first_name.toLowerCase()}-${member.last_name.toLowerCase()}`}`}
59
+ sx={{ display: "block" }}
60
+ >
61
+ View Public Profile
62
+ </Link>
63
+ </li>
64
64
  <div className={styles.divider} />
65
- <Button
66
- className={styles.mobileDropdownOption}
67
- sx={{ display: "block" }}
68
- onClick={onClickLogout}
69
- disableRipple
70
- >
71
- Log out
72
- </Button>
65
+ <li role="presentation">
66
+ <Button
67
+ className={styles.mobileDropdownOption}
68
+ sx={{ display: "block" }}
69
+ onClick={onClickLogout}
70
+ disableRipple
71
+ >
72
+ Log out
73
+ </Button>
74
+ </li>
73
75
  </Box>
74
76
  )}
75
77
  </>
@@ -91,36 +93,40 @@ function AuthUserSubNavBar({
91
93
  >
92
94
  My Account
93
95
  <ArrowDropDownIcon className={styles.arrowDownIcon} />
94
- <Box className={styles.dropDownMenu}>
95
- <Button
96
- className={styles.dropdownMenuOption}
97
- onClick={() => handleNavigation("/profile/")}
98
- sx={{ display: "block" }}
99
- disableRipple
100
- >
101
- Edit Profile
102
- </Button>
103
- <Button
104
- className={styles.dropdownMenuOption}
105
- onClick={() => handleNavigation(
106
- `/community/members/profile/${
96
+ <Box className={styles.dropDownMenu} component="ul">
97
+ <li role="presentation">
98
+ <Link
99
+ className={styles.dropdownMenuOption}
100
+ to="/profile/"
101
+ sx={{ display: "block" }}
102
+ >
103
+ Edit Profile
104
+ </Link>
105
+ </li>
106
+ <li role="presentation">
107
+ <Link
108
+ className={styles.dropdownMenuOption}
109
+ to={`/community/members/profile/${
107
110
  member.id
108
- }/${`${member.first_name.toLowerCase()}-${member.last_name.toLowerCase()}`}`,
109
- )}
110
- sx={{ display: "block" }}
111
- disableRipple
112
- >
113
- View Public Profile
114
- </Button>
115
- <div className={styles.divider} />
116
- <Button
117
- className={styles.dropdownMenuOption}
118
- sx={{ display: "block" }}
119
- onClick={onClickLogout}
120
- disableRipple
121
- >
122
- Log out
123
- </Button>
111
+ }/${`${member.first_name.toLowerCase()}-${member.last_name.toLowerCase()}`}`}
112
+ sx={{ display: "block" }}
113
+ >
114
+ View Public Profile
115
+ </Link>
116
+ </li>
117
+ <li role="presentation">
118
+ <div className={styles.divider} />
119
+ </li>
120
+ <li role="presentation">
121
+ <Button
122
+ className={styles.dropdownMenuOption}
123
+ sx={{ display: "block" }}
124
+ onClick={onClickLogout}
125
+ disableRipple
126
+ >
127
+ Log out
128
+ </Button>
129
+ </li>
124
130
  </Box>
125
131
  </Box>
126
132
  </Box>
@@ -133,7 +139,6 @@ AuthUserSubNavBar.propTypes = {
133
139
  navbarMenu: PropTypes.string.isRequired,
134
140
  setActiveMenu: PropTypes.func,
135
141
  isSearchBarOpen: PropTypes.bool,
136
- handleNavigation: PropTypes.func.isRequired,
137
142
  };
138
143
 
139
144
  AuthUserSubNavBar.defaultProps = {
@@ -1,27 +1,36 @@
1
1
  import * as React from "react";
2
2
  import PropTypes from "prop-types";
3
3
  import Box from "@mui/material/Box";
4
- import Button from "@mui/material/Button";
4
+ import Link from "../../Link";
5
5
 
6
6
  import styles from "../index.module.scss";
7
7
 
8
- function NavBarDropDown({ isMobile, items, handleNavigation }) {
8
+ function NavBarDropDown({ isMobile, items }) {
9
9
  return (
10
- <Box className={isMobile ? styles.mobileDropdownMenu : styles.dropDownMenu}>
10
+ <Box
11
+ className={isMobile ? styles.mobileDropdownMenu : styles.dropDownMenu}
12
+ component="ul"
13
+ >
11
14
  {items.map((subItem) => (!subItem.title && !subItem.link ? (
12
- <div className={styles.divider} key={subItem.title} />
15
+ <li role="presentation">
16
+ <div className={styles.divider} key={subItem.title} />
17
+ </li>
13
18
  ) : (
14
- <Button
15
- className={
16
- isMobile ? styles.mobileDropdownOption : styles.dropdownMenuOption
17
- }
18
- key={isMobile ? `${subItem.title}-mobile` : subItem.title}
19
- onClick={(ev) => handleNavigation(ev, subItem.link)}
20
- sx={{ display: "block" }}
21
- disableRipple
22
- >
23
- {subItem.title}
24
- </Button>
19
+ <li role="presentation">
20
+ <Link
21
+ className={
22
+ isMobile
23
+ ? styles.mobileDropdownOption
24
+ : styles.dropdownMenuOption
25
+ }
26
+ key={isMobile ? `${subItem.title}-mobile` : subItem.title}
27
+ to={subItem.link}
28
+ sx={{ display: "block" }}
29
+ disableRipple
30
+ >
31
+ {subItem.title}
32
+ </Link>
33
+ </li>
25
34
  )))}
26
35
  </Box>
27
36
  );
@@ -37,7 +46,6 @@ NavBarDropDown.propTypes = {
37
46
  requiresAuth: PropTypes.bool,
38
47
  }),
39
48
  ).isRequired,
40
- handleNavigation: PropTypes.func.isRequired,
41
49
  };
42
50
 
43
51
  NavBarDropDown.defaultProps = {
@@ -1,6 +1,5 @@
1
1
  import * as React from "react";
2
2
  import PropTypes from "prop-types";
3
- import Button from "@mui/material/Button";
4
3
  import AddIcon from "@mui/icons-material/Add";
5
4
  import RemoveIcon from "@mui/icons-material/Remove";
6
5
  import ArrowDropDownIcon from "@mui/icons-material/ArrowDropDown";
@@ -10,56 +9,47 @@ import Link from "../../Link";
10
9
  import styles from "../index.module.scss";
11
10
 
12
11
  function NavBarItem({
13
- isMobile,
14
- item,
15
- navbarMenu,
16
- setActiveMenu,
17
- handleNavigation,
12
+ isMobile, item, navbarMenu, setActiveMenu,
18
13
  }) {
19
14
  return isMobile ? (
20
15
  <>
21
- <Button
22
- disableRipple
23
- className={styles.mobileOption}
24
- key={`${item.title}-mobile`}
25
- onClick={() => setActiveMenu(item.title)}
26
- >
27
- {item.title}
16
+ <li role="presentation" className={styles.mobileOption}>
17
+ <Link key={`${item.title}-mobile`} to={item.link}>
18
+ {item.title}
19
+ </Link>
28
20
  {item.items?.length > 0
29
21
  && (item.title === navbarMenu ? (
30
- <RemoveIcon aria-hidden="true" />
22
+ <RemoveIcon aria-hidden="true" onClick={() => setActiveMenu("")} />
31
23
  ) : (
32
- <AddIcon aria-hidden="true" />
24
+ <AddIcon
25
+ aria-hidden="true"
26
+ onClick={() => setActiveMenu(item.title)}
27
+ />
33
28
  ))}
34
- </Button>
29
+ </li>
35
30
  {item.items?.length > 0 && item.title === navbarMenu && (
36
- <NavBarDropDown
37
- items={item.items}
38
- handleNavigation={handleNavigation}
39
- isMobile
40
- />
31
+ <NavBarDropDown items={item.items} isMobile />
41
32
  )}
42
33
  </>
43
34
  ) : (
44
- <Link
45
- className={styles.navbarOption}
46
- key={item.title}
47
- sx={{ my: 2, display: "block" }}
48
- href={item.link}
49
- >
50
- {item.items?.length > 0 ? (
51
- <>
52
- {item.title}
53
- <ArrowDropDownIcon className={styles.arrowDownIcon} />
54
- <NavBarDropDown
55
- items={item.items}
56
- handleNavigation={handleNavigation}
57
- />
58
- </>
59
- ) : (
60
- item.title
61
- )}
62
- </Link>
35
+ <li role="presentation">
36
+ <Link
37
+ className={styles.navbarOption}
38
+ key={item.title}
39
+ sx={{ my: 2, display: "block" }}
40
+ to={item.link}
41
+ >
42
+ {item.items?.length > 0 ? (
43
+ <>
44
+ {item.title}
45
+ <ArrowDropDownIcon className={styles.arrowDownIcon} />
46
+ <NavBarDropDown items={item.items} />
47
+ </>
48
+ ) : (
49
+ item.title
50
+ )}
51
+ </Link>
52
+ </li>
63
53
  );
64
54
  }
65
55
 
@@ -81,7 +71,6 @@ NavBarItem.propTypes = {
81
71
  }),
82
72
  navbarMenu: PropTypes.string.isRequired,
83
73
  setActiveMenu: PropTypes.func,
84
- handleNavigation: PropTypes.func.isRequired,
85
74
  };
86
75
 
87
76
  NavBarItem.defaultProps = {
@@ -7,7 +7,7 @@ import NavBarDropDown from "../NavBarDropDown";
7
7
 
8
8
  import styles from "../index.module.scss";
9
9
 
10
- function PublicUserSubNavBar({ isSearchBarOpen, isDesktop, handleNavigation }) {
10
+ function PublicUserSubNavBar({ isSearchBarOpen, isDesktop }) {
11
11
  const publicNavbarMenu = [
12
12
  {
13
13
  link: "https://openinfra.dev/join",
@@ -59,10 +59,7 @@ function PublicUserSubNavBar({ isSearchBarOpen, isDesktop, handleNavigation }) {
59
59
  >
60
60
  Join
61
61
  <ArrowDropDownIcon className={styles.arrowDownIcon} />
62
- <NavBarDropDown
63
- items={publicNavbarMenu}
64
- handleNavigation={handleNavigation}
65
- />
62
+ <NavBarDropDown items={publicNavbarMenu} />
66
63
  </Box>
67
64
  <LoginButton backUrl={getBackURL()} />
68
65
  </Box>
@@ -72,7 +69,6 @@ function PublicUserSubNavBar({ isSearchBarOpen, isDesktop, handleNavigation }) {
72
69
  PublicUserSubNavBar.propTypes = {
73
70
  isSearchBarOpen: PropTypes.bool,
74
71
  isDesktop: PropTypes.bool,
75
- handleNavigation: PropTypes.func.isRequired,
76
72
  };
77
73
 
78
74
  PublicUserSubNavBar.defaultProps = {
@@ -62,6 +62,7 @@
62
62
  opacity: 0;
63
63
  transition: opacity 0.3s ease;
64
64
  .dropdownMenuOption {
65
+ display: inline-block;
65
66
  color: #8a959e;
66
67
  font-size: 12px;
67
68
  font-weight: 400;
@@ -70,6 +71,7 @@
70
71
  padding: 15px 15px;
71
72
  text-decoration: none;
72
73
  text-align: left;
74
+ width: 100%;
73
75
  &:hover {
74
76
  color: #333;
75
77
  background-color: #f5f5f5;
@@ -143,6 +145,11 @@
143
145
  }
144
146
  .navbarMobileMenu {
145
147
  flex-direction: column;
148
+ padding-inline-start: 0px;
149
+ color: #8a959e;
150
+ li {
151
+ list-style: none;
152
+ }
146
153
  .openstackSearchBarMobile {
147
154
  display: block;
148
155
  visibility: hidden;
@@ -150,6 +157,7 @@
150
157
  transition: visibility 0.3s ease;
151
158
  }
152
159
  .mobileOption {
160
+ display: inline-flex;
153
161
  color: #8a959e;
154
162
  justify-content: space-between;
155
163
  line-height: 20px;
@@ -159,11 +167,22 @@
159
167
  text-transform: uppercase;
160
168
  position: relative;
161
169
  padding: 15px 15px;
162
- cursor: pointer;
163
- &:hover,
164
- &:visited {
165
- color: #333;
166
- background-color: transparent;
170
+ a {
171
+ color: #8a959e;
172
+ text-decoration: none;
173
+ &:visited {
174
+ color: #8a959e;
175
+ background-color: transparent;
176
+ text-decoration: none;
177
+ }
178
+ &:hover {
179
+ color: #333;
180
+ background-color: transparent;
181
+ text-decoration: none;
182
+ }
183
+ }
184
+ svg {
185
+ cursor: pointer;
167
186
  }
168
187
  }
169
188
  .mobileDropdownMenu {
@@ -176,15 +195,26 @@
176
195
  background: #edf2f7;
177
196
  opacity: 1;
178
197
  border-radius: 4px;
198
+ transition: opacity 0.3s ease;
179
199
  .mobileDropdownOption {
200
+ display: inline-block;
180
201
  color: #8a959e;
181
202
  font-size: 12px;
182
203
  font-weight: 400;
183
204
  text-align: left;
184
- &:hover,
205
+ text-decoration: none;
206
+ text-transform: uppercase;
207
+ width: 100%;
208
+ padding: 5px 15px 5px 25px;
185
209
  &:visited {
210
+ color: #8a959e;
211
+ background-color: transparent;
212
+ text-decoration: none;
213
+ }
214
+ &:hover {
186
215
  color: #333;
187
216
  background-color: transparent;
217
+ text-decoration: none;
188
218
  }
189
219
  }
190
220
  .divider {
@@ -1,6 +1,5 @@
1
1
  import * as React from "react";
2
2
  import PropTypes from "prop-types";
3
- import { navigate } from "gatsby";
4
3
  import { connect } from "react-redux";
5
4
  import { Container } from "@mui/material";
6
5
  import "@fortawesome/fontawesome-free/css/all.css";
@@ -30,11 +29,6 @@ function NavBarTemplate({ data, isLoggedUser, member }) {
30
29
  setNavbarMenu("");
31
30
  };
32
31
 
33
- const handleNavigation = (ev, url) => {
34
- ev.preventDefault();
35
- navigate(url);
36
- };
37
-
38
32
  return (
39
33
  <nav role="navigation">
40
34
  <AppBar
@@ -59,6 +53,7 @@ function NavBarTemplate({ data, isLoggedUser, member }) {
59
53
  },
60
54
  justifyContent: "flex-end",
61
55
  }}
56
+ component="ul"
62
57
  >
63
58
  {data.items.map(
64
59
  (item) => item.display && (
@@ -66,7 +61,6 @@ function NavBarTemplate({ data, isLoggedUser, member }) {
66
61
  key={`navbar-item-${item.title}`}
67
62
  item={item}
68
63
  navbarMenu={navbarMenu}
69
- handleNavigation={handleNavigation}
70
64
  />
71
65
  ),
72
66
  )}
@@ -77,12 +71,10 @@ function NavBarTemplate({ data, isLoggedUser, member }) {
77
71
  member={member}
78
72
  navbarMenu={navbarMenu}
79
73
  isSearchBarOpen={isSearchBarOpen}
80
- handleNavigation={handleNavigation}
81
74
  />
82
75
  ) : (
83
76
  <PublicUserSubNavBar
84
77
  isSearchBarOpen={isSearchBarOpen}
85
- handleNavigation={handleNavigation}
86
78
  isDesktop
87
79
  />
88
80
  )}
@@ -94,6 +86,7 @@ function NavBarTemplate({ data, isLoggedUser, member }) {
94
86
  sx={{
95
87
  display: { xs: "flex", md: "none" },
96
88
  }}
89
+ component="ul"
97
90
  >
98
91
  {data.items.map(
99
92
  (item) => item.display && (
@@ -102,7 +95,6 @@ function NavBarTemplate({ data, isLoggedUser, member }) {
102
95
  key={`navbar-item-mobile-${item.title}`}
103
96
  navbarMenu={navbarMenu}
104
97
  setActiveMenu={(option) => handleSetActiveMenu(option)}
105
- handleNavigation={handleNavigation}
106
98
  isMobile
107
99
  />
108
100
  ),
@@ -112,11 +104,10 @@ function NavBarTemplate({ data, isLoggedUser, member }) {
112
104
  member={member}
113
105
  navbarMenu={navbarMenu}
114
106
  setActiveMenu={(option) => handleSetActiveMenu(option)}
115
- handleNavigation={handleNavigation}
116
107
  isMobile
117
108
  />
118
109
  ) : (
119
- <PublicUserSubNavBar handleNavigation={handleNavigation} />
110
+ <PublicUserSubNavBar />
120
111
  )}
121
112
  </Box>
122
113
  )}
@@ -1 +1 @@
1
- { "staticJsonFilesBuildTime": [], "lastBuild": 1714691681596 }
1
+ { "staticJsonFilesBuildTime": [], "lastBuild": 1714750103949 }