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

CaptainFact / captain-fact-frontend / 13509561802

24 Feb 2025 10:56PM UTC coverage: 5.504% (-1.4%) from 6.953%
13509561802

push

github

web-flow
Release (#1375)

* chore(deps-dev): Bump @babel/preset-env from 7.20.2 to 7.26.9 (#1371)

Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.20.2 to 7.26.9.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.26.9/packages/babel-preset-env)

---
updated-dependencies:
- dependency-name: "@babel/preset-env"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Misc styles & GraphQL fixes (#1374)

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

43 of 1647 branches covered (2.61%)

Branch coverage included in aggregate %.

192 of 2623 relevant lines covered (7.32%)

0.17 hits per line

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

0.0
/app/components/Users/UserMenu.jsx
1
import 'react'
2

3
import PropTypes from 'prop-types'
4
import { withTranslation } from 'react-i18next'
5
import { withRouter } from 'react-router'
6
import { Videos } from 'styled-icons/boxicons-solid'
7
import { UserCircle } from 'styled-icons/fa-regular'
8
import { Bell } from 'styled-icons/fa-solid'
9
import { Activity, LogOut, Rss, Settings } from 'styled-icons/feather'
10

11
const BASE_LINKS = [
×
12
  { path: '', i18nKey: 'menu.activity', Icon: Activity },
13
  { path: '/videos', i18nKey: 'menu.addedVideos', Icon: Videos },
14
  { path: '/profile', i18nKey: 'menu.profile', Icon: UserCircle },
15
]
16

17
const AUTHENTICATED_LINKS = [
×
18
  { path: '/subscriptions', i18nKey: 'menu.subscriptions', Icon: Rss },
19
  { path: '/notifications', i18nKey: 'menu.notifications', Icon: Bell },
20
  { path: '/settings', i18nKey: 'menu.settings', Icon: Settings },
21
]
22

23
/**
24
 * Menu entries for user profile sections.
25
 */
26
const UserMenu = ({ t, isSelf, user, children, location, hasLogout }) => {
×
27
  const entries = !isSelf ? BASE_LINKS : [...BASE_LINKS, ...AUTHENTICATED_LINKS]
×
28

29
  if (hasLogout) {
×
30
    entries.push({
×
31
      path: '/logout',
32
      isRootPath: true,
33
      i18nKey: 'menu.logout',
34
      Icon: LogOut,
35
    })
36
  }
37

38
  return entries.map((entry, index) => {
×
39
    const route = entry.isRootPath ? entry.path : `/u/${user.username}${entry.path}`
×
40
    const isActive = location.pathname === route
×
41
    return children({
×
42
      key: entry.path,
43
      Icon: entry.Icon,
44
      title: t(entry.i18nKey),
45
      route,
46
      isActive,
47
      index,
48
    })
49
  })
50
}
51

52
UserMenu.propTypes = {
×
53
  /** User */
54
  user: PropTypes.shape({ username: PropTypes.string.isRequired }).isRequired,
55
  /**
56
   * A render function used to render a single item.
57
   *
58
   * Gets passed an object like:
59
   *
60
   *    - key: A unique key for this entry. You **must** set the `key` prop if
61
   *      rendering a React component.
62
   *    - Icon
63
   *    - title
64
   *    - link
65
   *    - isActive
66
   */
67
  children: PropTypes.func.isRequired,
68
  /** Wether we're displaying the menu for currently logged in user */
69
  isSelf: PropTypes.bool,
70
  /** Logout */
71
  hasLogout: PropTypes.bool,
72
}
73

74
UserMenu.defaultProps = {
×
75
  isSelf: false,
76
}
77

78
export default withTranslation('main')(withRouter(UserMenu))
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