Skip to content

Commit

Permalink
add new navbar to welcome view
Browse files Browse the repository at this point in the history
  • Loading branch information
ValbuenaG committed Jan 9, 2025
1 parent 6e058fd commit 4d075da
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"dependencies": {
"@babel/core": "^7.16.0",
"@divviup/dap": "^0.9.0",
"@horizontal-org/shira-ui": "1.0.23",
"@horizontal-org/shira-ui": "1.0.26",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.3",
"@popperjs/core": "^2.11.8",
"@svgr/webpack": "^5.5.0",
Expand Down
1 change: 1 addition & 0 deletions src/components/UI/Navbar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//old navbar -- remove
import { FunctionComponent, useState } from 'react'
import { styled } from '@horizontal-org/shira-ui'
import Logo from '../Icons/Logo'
Expand Down
4 changes: 3 additions & 1 deletion src/language/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@
"navbar": {
"home": "Home",
"about": "About",
"menu": "Menu"
"menu": "Menu",
"login": "Log in",
"create_space": "Create space"
}
}
24 changes: 20 additions & 4 deletions src/scenes/Welcome/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { FunctionComponent, useEffect } from "react";
import { styled, Button } from '@horizontal-org/shira-ui'
import { Navbar } from "../../components/UI/Navbar";
import { useNavigate } from "react-router-dom";
import {
styled,
Button,
Navbar
} from '@horizontal-org/shira-ui'
import { SceneWrapper } from "../../components/UI/SceneWrapper";
import { LanguageSelect } from "../../components/UI/Select";
import { FiChevronRight } from 'react-icons/fi'
Expand All @@ -15,6 +19,7 @@ import GreenFish from '../../assets/GreenFish'
export const WelcomeScene: FunctionComponent = () => {
const changeScene = useStore((state) => state.changeScene)
const { t, i18n } = useTranslation()
let navigate = useNavigate()

useEffect(() => {
const sendMetric = async() => {
Expand All @@ -33,10 +38,21 @@ export const WelcomeScene: FunctionComponent = () => {

sendMetric()
}, [])


const handleNavigation = (route: string) => {
if (route === '/login' || route === '/create-space') {
const adminUrl = process.env.REACT_APP_ADMIN_URL;
window.location.href = `${adminUrl}${route}`;
} else {
navigate(route);
}
}
return (
<SceneWrapper bg='white'>
<Navbar />
<Navbar
translatedTexts={{home: t('navbar.home'), about: t('navbar.about'), menu: t('navbar.menu'), logIn: t('navbar.login'), createSpace: t('navbar.create_space')}}
onNavigate={handleNavigation}
/>

<MailHookWrapper>
<MailHook />
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1418,10 +1418,10 @@
resolved "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz"
integrity sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==

"@horizontal-org/[email protected].23":
version "1.0.23"
resolved "https://registry.yarnpkg.com/@horizontal-org/shira-ui/-/shira-ui-1.0.23.tgz#3c25ca6fbc0d3248a5b43617953da2ac2a0edb1d"
integrity sha512-2v3uwSI2YnWHf+oolJiXE4nLTFugaurJbZS1jDjYPWGcC/FLsBehRBhkTjNtLJ4qtND5qGoVyCjNl69KxHR4qQ==
"@horizontal-org/[email protected].26":
version "1.0.26"
resolved "https://registry.yarnpkg.com/@horizontal-org/shira-ui/-/shira-ui-1.0.26.tgz#6679c122ff2fd36de2dd2220d61df09e8802b842"
integrity sha512-waGqrjpqXEj2kPma01v75/r2AmaDUlqmONZqjgNS6KlciarVrdNrlVax6qN5ZrInJlDO4mxEN0yrlexKpVjqPg==
dependencies:
react-icons "^5.4.0"
styled-components "^6.1.13"
Expand Down

0 comments on commit 4d075da

Please sign in to comment.