l-min-components 1.0.167 → 1.0.168
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
|
@@ -429,7 +429,8 @@ export const Nav2 = styled.ul`
|
|
|
429
429
|
export const NavGroup2 = styled.div`
|
|
430
430
|
width: 50%;
|
|
431
431
|
display: flex;
|
|
432
|
-
justify-content: end;
|
|
432
|
+
justify-content: flex-end;
|
|
433
|
+
gap: 70px;
|
|
433
434
|
`;
|
|
434
435
|
|
|
435
436
|
export const CountryFlagGroup2 = styled.div`
|
|
@@ -440,7 +441,7 @@ export const CountryFlagGroup2 = styled.div`
|
|
|
440
441
|
align-items: center;
|
|
441
442
|
position: relative;
|
|
442
443
|
width: 70px;
|
|
443
|
-
margin: 0
|
|
444
|
+
margin: 0 0 0 0;
|
|
444
445
|
|
|
445
446
|
& > svg {
|
|
446
447
|
position: absolute;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import React, { useState, useEffect, useRef } from "react";
|
|
1
|
+
import React, { useState, useEffect, useRef, useCallback } from "react";
|
|
2
2
|
import ReactFlagsSelect from "react-flags-select";
|
|
3
3
|
import logo from "./assets/images/logo.png";
|
|
4
4
|
import { Navbar2, NavGroup2, Nav2, CountryFlagGroup2 } from "./index.styled";
|
|
5
5
|
import { ArrowDownIcon } from "./assets/svg/arrow-down";
|
|
6
6
|
import ButtonComponent from "../button";
|
|
7
|
+
import { useLocation, useNavigate } from "react-router-dom";
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* @param {{
|
|
@@ -19,12 +20,16 @@ const HeaderComponentTwo = (props) => {
|
|
|
19
20
|
const [isOpen, setIsOpen] = useState(false);
|
|
20
21
|
const [searchResultOpen, setSearchResultOpen] = useState(false);
|
|
21
22
|
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
const navigate = useNavigate();
|
|
24
|
+
const location = useLocation();
|
|
25
|
+
console.log(location);
|
|
24
26
|
useEffect(() => {
|
|
25
27
|
setIsOpen(false);
|
|
26
28
|
}, []);
|
|
27
29
|
|
|
30
|
+
const goToLogin = useCallback(() => {
|
|
31
|
+
navigate("/sign-in");
|
|
32
|
+
}, []);
|
|
28
33
|
return (
|
|
29
34
|
<Navbar2>
|
|
30
35
|
<img src={logo} alt="Learngual logo" />
|
|
@@ -55,7 +60,9 @@ const HeaderComponentTwo = (props) => {
|
|
|
55
60
|
<ArrowDownIcon />
|
|
56
61
|
</CountryFlagGroup2>
|
|
57
62
|
|
|
58
|
-
|
|
63
|
+
{location.pathname.includes("sign-in") && (
|
|
64
|
+
<ButtonComponent type="secondary" text="Log in" onClick={goToLogin} />
|
|
65
|
+
)}
|
|
59
66
|
</NavGroup2>
|
|
60
67
|
</Navbar2>
|
|
61
68
|
);
|
package/src/components/index.js
CHANGED
|
@@ -25,4 +25,4 @@ export { default as SelectDropdownGraph } from "./graph";
|
|
|
25
25
|
export { default as NotificationThresholdComponent } from "./notificationThreshold";
|
|
26
26
|
export { default as DevAPIdocs } from "./developerAPIdocs";
|
|
27
27
|
export { default as Calender } from "./calender/input";
|
|
28
|
-
export { default as ErrorPage } from "./errorPage"
|
|
28
|
+
export { default as ErrorPage } from "./errorPage";
|