@cashub/ui 0.29.0 → 0.29.1
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/layout/AsideHeader.jsx +5 -5
- package/layout/Layout.jsx +3 -1
- package/layout/Sidebar.jsx +17 -5
- package/package.json +1 -1
package/layout/AsideHeader.jsx
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
|
-
import headerStyle from '
|
|
3
|
-
import media from '
|
|
2
|
+
import headerStyle from '../../styles/header.style';
|
|
3
|
+
import media from '../../styles/mixin/media';
|
|
4
4
|
import Logo from './Logo';
|
|
5
5
|
import MenuIcon from './MenuIcon';
|
|
6
6
|
|
|
7
|
-
const AsideHeader = ({ theme, toggleSidebar }) => {
|
|
7
|
+
const AsideHeader = ({ theme, logo, hasSidebar, toggleSidebar }) => {
|
|
8
8
|
return (
|
|
9
9
|
<Brand>
|
|
10
|
-
<MenuIcon theme={theme} toggleSidebar={toggleSidebar} />
|
|
11
|
-
<Logo />
|
|
10
|
+
{hasSidebar && <MenuIcon theme={theme} toggleSidebar={toggleSidebar} />}
|
|
11
|
+
{logo && <Logo src={logo} />}
|
|
12
12
|
</Brand>
|
|
13
13
|
);
|
|
14
14
|
};
|
package/layout/Layout.jsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
|
-
import { ScrollToTopButton } from '
|
|
3
|
+
import { ScrollToTopButton } from '@cashub/ui';
|
|
4
4
|
import Header from './Header';
|
|
5
5
|
import Container from './Container';
|
|
6
6
|
import Footer from './Footer';
|
|
@@ -46,6 +46,8 @@ const Layout = ({
|
|
|
46
46
|
{navContent && (
|
|
47
47
|
<Sidebar
|
|
48
48
|
theme={theme}
|
|
49
|
+
logo={logo}
|
|
50
|
+
hasSidebar={!!navContent}
|
|
49
51
|
$display={display}
|
|
50
52
|
toggleSidebar={toggleSidebar}
|
|
51
53
|
>
|
package/layout/Sidebar.jsx
CHANGED
|
@@ -3,13 +3,20 @@ import { FaCaretRight } from 'react-icons/fa';
|
|
|
3
3
|
import { Link, useLocation } from 'react-router-dom';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
5
|
import styled, { css } from 'styled-components';
|
|
6
|
-
import headerStyle from '
|
|
7
|
-
import media from '
|
|
8
|
-
import scrollbar from '
|
|
6
|
+
import headerStyle from '../../styles/header.style';
|
|
7
|
+
import media from '../../styles/mixin/media';
|
|
8
|
+
import scrollbar from '../../styles/mixin/scrollbar';
|
|
9
9
|
import Aside from './Aside';
|
|
10
10
|
import AsideHeader from './AsideHeader';
|
|
11
11
|
|
|
12
|
-
const Sidebar = ({
|
|
12
|
+
const Sidebar = ({
|
|
13
|
+
theme,
|
|
14
|
+
logo,
|
|
15
|
+
hasSidebar,
|
|
16
|
+
$display,
|
|
17
|
+
toggleSidebar,
|
|
18
|
+
children,
|
|
19
|
+
}) => {
|
|
13
20
|
const location = useLocation();
|
|
14
21
|
const sidebarRef = useRef(null);
|
|
15
22
|
const [hoverDisplay, setHoverDisplay] = useState(false);
|
|
@@ -46,7 +53,12 @@ const Sidebar = ({ theme, $display, toggleSidebar, children }) => {
|
|
|
46
53
|
onMouseOver={handleMouseOver}
|
|
47
54
|
onMouseOut={handleMouseOut}
|
|
48
55
|
>
|
|
49
|
-
<AsideHeader
|
|
56
|
+
<AsideHeader
|
|
57
|
+
theme={theme}
|
|
58
|
+
logo={logo}
|
|
59
|
+
hasSidebar={hasSidebar}
|
|
60
|
+
toggleSidebar={toggleSidebar}
|
|
61
|
+
/>
|
|
50
62
|
<Menu>
|
|
51
63
|
{children.map((prop, key) => {
|
|
52
64
|
if (prop.parent === true) {
|