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

vitorspadacio / react-sample / 1da39984-63f4-4bea-b5f1-7e06cbbbf5cf

18 Apr 2025 07:01PM UTC coverage: 90.293% (-9.7%) from 100.0%
1da39984-63f4-4bea-b5f1-7e06cbbbf5cf

push

circleci

vitorspadacio
feat: ajustes lista livros e mais

30 of 30 branches covered (100.0%)

Branch coverage included in aggregate %.

56 of 99 new or added lines in 15 files covered. (56.57%)

370 of 413 relevant lines covered (89.59%)

11.31 hits per line

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

96.0
/src/components/Menu/Menu.tsx
1
import favicon from '@assets/images/favicon.png'
5✔
2
import noUserIcon from '@assets/images/no_user.svg'
5✔
3
import userIcon from '@assets/images/user.svg'
5✔
4
import { selectDisplayName } from '@features/auth/AuthSelectors'
5✔
5
import { useAuthStore } from '@features/auth/AuthStore'
5✔
6
import { router } from '@features/routes'
5✔
7
import { Content, DisplayName, Logged, Login, MenuItem, Nav, Title } from './Menu.styles'
5✔
8

9
export default function () {
5✔
10
  const { user } = useAuthStore()
46✔
11
  const { logOut } = useAuthStore()
46✔
12
  const displayName = useAuthStore(selectDisplayName)
46✔
13

14
  const actualLogLink = user ? (
46✔
15
    <>
16
      <DisplayName>{displayName}</DisplayName>
17
      <Login onClick={() => logOut()}>Sair</Login>
2✔
18
    </>
19
  ) : (
20
    <Login title='Entrar pelo menu' onClick={() => handleNavigateClick('/auth/login')}>
1✔
21
      Entrar
22
    </Login>
23
  )
24

25
  const actualUserIcon = user ? userIcon : noUserIcon
46✔
26

27
  const handleNavigateClick = (route: string) => router.navigate(route)
46✔
28

29
  return (
46✔
30
    <Nav>
31
      <Content>
32
        <Title onClick={() => handleNavigateClick('/')}>
1✔
33
          <img src={favicon} alt='logo' />
34
          React Sample
35
        </Title>
36

37
        <MenuItem onClick={() => handleNavigateClick('/todo')}>Todo</MenuItem>
1✔
38
        <MenuItem onClick={() => handleNavigateClick('/rpg')}>RPG</MenuItem>
1✔
NEW
39
        <MenuItem onClick={() => handleNavigateClick('/book')}>Livros</MenuItem>
×
40

41
        <Logged>
42
          {actualLogLink}
43
          <img alt='user' src={actualUserIcon} />
44
        </Logged>
45
      </Content>
46
    </Nav>
47
  )
48
}
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