Skip to content

Commit

Permalink
review: remove joining icon from navbar
Browse files Browse the repository at this point in the history
  • Loading branch information
theborakompanioni committed Aug 12, 2022
1 parent da44f14 commit de86014
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 34 deletions.
37 changes: 5 additions & 32 deletions src/components/Navbar.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React, { useMemo, useState } from 'react'
import React, { useState } from 'react'
import { Link, NavLink } from 'react-router-dom'
import * as rb from 'react-bootstrap'
import { useTranslation } from 'react-i18next'
import Sprite from './Sprite'
import Balance from './Balance'
import { TabActivityIndicator, JoiningIndicator } from './ActivityIndicators'
import { TabActivityIndicator } from './ActivityIndicators'
import { useSettings } from '../context/SettingsContext'
import { useCurrentWallet, useCurrentWalletInfo } from '../context/WalletContext'
import { useServiceInfo, useSessionConnectionError } from '../context/ServiceInfoContext'
Expand Down Expand Up @@ -99,25 +99,11 @@ const CenterNav = ({ makerRunning, schedulerRunning, singleCollaborativeTransact
)
}

const TrailingNav = ({ joiningRoute, onClick }) => {
const TrailingNav = ({ onClick }) => {
const { t } = useTranslation()

return (
<rb.Nav className="justify-content-center align-items-stretch">
{joiningRoute && (
<rb.Nav.Item className="d-flex align-items-center pe-2">
<div className="d-flex align-items-center px-0">
<NavLink to={joiningRoute} onClick={onClick} className="nav-link">
<rb.Navbar.Text className="d-md-none">{t('navbar.joining_in_progress')}</rb.Navbar.Text>
<JoiningIndicator
isOn={true}
className="navbar-text text-success"
title={t('navbar.joining_in_progress')}
/>
</NavLink>
</div>
</rb.Nav.Item>
)}
<rb.Nav.Item className="d-flex align-items-stretch">
<NavLink
to={routes.settings}
Expand Down Expand Up @@ -145,19 +131,6 @@ export default function Navbar() {

const [isExpanded, setIsExpanded] = useState(false)

const joiningRoute = useMemo(() => {
if (!serviceInfo) return null

if (serviceInfo.coinjoinInProgress) {
return serviceInfo.schedule ? routes.jam : routes.send
}
if (serviceInfo.makerRunning) {
return routes.earn
}

return null
}, [serviceInfo])

const height = '75px'

return (
Expand Down Expand Up @@ -252,7 +225,7 @@ export default function Navbar() {
}
onClick={() => setIsExpanded(!isExpanded)}
/>
<TrailingNav joiningRoute={joiningRoute} onClick={() => setIsExpanded(!isExpanded)} />
<TrailingNav onClick={() => setIsExpanded(!isExpanded)} />
</rb.Offcanvas.Body>
</rb.Navbar.Offcanvas>
<rb.Container className="d-none d-md-flex flex-1 flex-grow-0 align-items-stretch">
Expand All @@ -266,7 +239,7 @@ export default function Navbar() {
</rb.Container>
<rb.Container className="d-none d-md-flex flex-1 align-items-stretch">
<div className="ms-auto d-flex align-items-stretch">
<TrailingNav joiningRoute={joiningRoute} />
<TrailingNav />
</div>
</rb.Container>
</>
Expand Down
1 change: 0 additions & 1 deletion src/i18n/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"tab_send": "Send",
"tab_receive": "Receive",
"tab_earn": "Earn",
"joining_in_progress": "Joining",
"menu_mobile": "Menu",
"menu_mobile_settings": "Settings"
},
Expand Down
1 change: 0 additions & 1 deletion src/i18n/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"tab_send": "Envoyer",
"tab_receive": "Recevoir",
"tab_earn": "Générer",
"joining_in_progress": "Joindre",
"menu_mobile": "Menu",
"menu_mobile_settings": "Réglages"
},
Expand Down

0 comments on commit de86014

Please sign in to comment.