Skip to content

Commit

Permalink
removed full language name from navbar
Browse files Browse the repository at this point in the history
  • Loading branch information
shuhaib-aot committed Nov 9, 2023
1 parent 0ab8f9b commit 950ebf6
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions forms-flow-nav/src/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,7 @@ const NavBar = React.memo(({ props }) => {
const isAuthenticated = instance?.isAuthenticated();
const { pathname } = location;
const [userDetail, setUserDetail] = React.useState({});

const [lang, setLang] = React.useState(userDetail?.locale);
const [selectedLanguage, setSelectedLanguage] = useState({});
const [lang, setLang] = React.useState(userDetail?.locale);
const userRoles = JSON.parse(
StorageService.get(StorageService.User.USER_ROLE)
);
Expand Down Expand Up @@ -138,10 +136,7 @@ const NavBar = React.memo(({ props }) => {
localStorage.setItem("lang", language);
}, [lang]);

useEffect(()=>{
const language = selectLanguages?.find((item)=> item.name === lang);
setSelectedLanguage(language || {})
},[lang,selectLanguages])


React.useEffect(() => {
setUserDetail(
Expand Down Expand Up @@ -324,8 +319,8 @@ const NavBar = React.memo(({ props }) => {
title={
<>
<i className="fa fa-globe mr-2" />
{selectedLanguage?.value}
({lang ? lang : "LANGUAGE"})

{lang ? lang : "LANGUAGE"}
</>
}
id="basic-nav-dropdown"
Expand Down

0 comments on commit 950ebf6

Please sign in to comment.