• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

EcrituresNumeriques / stylo / 13555673604

26 Feb 2025 11:50PM UTC coverage: 27.924% (-0.002%) from 27.926%
13555673604

push

github

web-flow
Update Header.jsx

clés trad dans l'interface

372 of 572 branches covered (65.03%)

Branch coverage included in aggregate %.

0 of 4 new or added lines in 1 file covered. (0.0%)

3832 of 14483 relevant lines covered (26.46%)

1.9 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/front/src/components/Header.jsx
1
import React, { useMemo } from 'react'
×
2
import { LifeBuoy } from 'react-feather'
×
3
import { useSelector } from 'react-redux'
×
4
import { NavLink, Route, Switch } from 'react-router-dom'
×
5
import { useTranslation } from 'react-i18next'
×
6

7
import logoContent from '/images/logo.svg?inline'
×
8
import { useActiveWorkspace } from '../hooks/workspace.js'
×
9

10
import styles from './header.module.scss'
×
11
import LanguagesMenu from './header/LanguagesMenu.jsx'
×
12
import UserMenu from './header/UserMenu.jsx'
×
13

14
function Header() {
×
15
  const activeWorkspace = useActiveWorkspace()
×
16
  const activeWorkspaceId = useMemo(
×
17
    () => activeWorkspace?._id,
×
18
    [activeWorkspace]
×
19
  )
×
20
  const connected = useSelector((state) => state.loggedIn)
×
21
  const { t } = useTranslation()
×
22

23
  return (
×
24
    <Switch>
×
25
      <Route path="*/preview" />
×
26
      <Route path="/credentials/auth-callback" />
×
27
      <Route path="*">
×
28
        <header className={styles.headerContainer} role="banner">
×
29
          <section className={styles.header}>
×
30
            <h1 className={styles.logo}>
×
31
              <NavLink to="/" rel="home">
×
32
                <img src={logoContent} alt="Stylo" title="Stylo" />
×
33
              </NavLink>
×
34
            </h1>
×
35
            <nav role="navigation">
×
36
              <ul className={styles.menuLinks}>
×
37
                {connected && (
×
38
                  <li>
×
39
                    <NavLink
×
40
                      to={
×
41
                        activeWorkspaceId
×
42
                          ? `/workspaces/${activeWorkspaceId}/articles`
×
43
                          : '/articles'
×
44
                      }
45
                    >
NEW
46
                      {t('header.articles.link')}
×
47
                    </NavLink>
×
48
                  </li>
×
49
                )}
50
                {connected && (
×
51
                  <li>
×
52
                    <NavLink
×
53
                      to={
×
54
                        activeWorkspaceId
×
55
                          ? `/workspaces/${activeWorkspaceId}/corpus`
×
56
                          : '/corpus'
×
57
                      }
58
                    >
NEW
59
                      {t('credentials.login.confirmButton')}
×
60
                    </NavLink>
×
61
                  </li>
×
62
                )}
63
                {!connected && (
×
64
                  <li>
×
65
                    <NavLink to="/">
×
NEW
66
                      {t('header.corpus.link')}
×
67
                    </NavLink>
×
68
                  </li>
×
69
                )}
70
                {!connected && (
×
71
                  <li>
×
72
                    <NavLink to="/register" className={styles.registerAction}>
×
73
                      {t('credentials.login.registerLink')}
×
74
                    </NavLink>
×
75
                  </li>
×
76
                )}
77
              </ul>
×
78
            </nav>
×
79
            <nav className={styles.secondaryNav}>
×
80
              {connected && <UserMenu />}
×
81
              <a
×
82
                className={styles.documentationLink}
×
83
                href="https://stylo-doc.ecrituresnumeriques.ca"
×
84
                target="_blank"
×
85
                rel="noopener noreferrer"
×
86
              >
87
                <LifeBuoy size={16} />
×
NEW
88
                {t('header.documentation.link')}
×
89
              </a>
×
90
              <LanguagesMenu />
×
91
            </nav>
×
92
          </section>
×
93
        </header>
×
94
      </Route>
×
95
    </Switch>
×
96
  )
97
}
×
98

99
export default Header
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc