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

CaptainFact / captain-fact-frontend / 12937903925

23 Jan 2025 08:56PM UTC coverage: 5.504% (-1.4%) from 6.953%
12937903925

push

github

web-flow
chore: Migrate to tailwind (#1355)

43 of 1647 branches covered (2.61%)

Branch coverage included in aggregate %.

6 of 306 new or added lines in 94 files covered. (1.96%)

94 existing lines in 39 files now uncovered.

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/LoggedInUser/SubscriptionsPage.jsx
1
import { Query } from '@apollo/client/react/components'
2
import { get } from 'lodash'
3
import React, { Component } from 'react'
4
import { withTranslation } from 'react-i18next'
5
import { Link } from 'react-router-dom'
6
import { Videos } from 'styled-icons/boxicons-solid'
7

8
import { loggedInUserSubscriptionsQuery } from '../../API/graphql_queries'
9
import { videoURL } from '../../lib/cf_routes'
10
import SubscribeBtn from '../Notifications/SubscribeBtn'
11
import { StyledH2 } from '../StyledUtils/Title'
12
import { Card } from '../ui/card'
13
import { ErrorView } from '../Utils/ErrorView'
14
import { LoadingFrame } from '../Utils/LoadingFrame'
15

16
@withTranslation('main')
17
export default class NotificationsPage extends Component {
18
  renderScopeIcon() {
19
    return <Videos size="1.5em" />
×
20
  }
21

22
  render() {
23
    return (
×
24
      <Query
25
        query={loggedInUserSubscriptionsQuery}
26
        variables={{ scopes: ['video'] }}
27
        fetchPolicy="network-only"
28
      >
29
        {({ data, loading, error }) => {
30
          if (loading) {
×
31
            return <LoadingFrame />
×
32
          } else if (error) {
×
33
            return <ErrorView error={error} />
×
34
          }
35

36
          const subscriptions = get(data, 'loggedInUser.subscriptions', [])
×
37
          return (
×
38
            <div className="flex flex-col items-center px-3 py-4">
39
              <StyledH2 textTransform="capitalize">{this.props.t('entities.video_other')}</StyledH2>
40
              <div>
41
                {subscriptions.length === 0 ? (
×
42
                  <Card className="p-6">No subscriptions</Card>
43
                ) : (
44
                  subscriptions.map((subscription) => (
NEW
45
                    <div key={subscription.id} className="flex mb-3 items-center">
×
46
                      <div className="flex mr-2">
47
                        <SubscribeBtn
48
                          size={24}
49
                          scope={subscription.scope}
50
                          entityId={subscription.videoId}
51
                          isSubscribed={subscription.isSubscribed}
52
                        />
53
                      </div>
54
                      <div className="mr-1">{this.renderScopeIcon(subscription.scope)}</div>
55
                      <div>
56
                        <Link className="hover:underline" to={videoURL(subscription.video.hashId)}>
57
                          {subscription.video.title}
58
                        </Link>
59
                      </div>
60
                    </div>
61
                  ))
62
                )}
63
              </div>
64
            </div>
65
          )
66
        }}
67
      </Query>
68
    )
69
  }
70
}
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