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

gitify-app / gitify / 12586431667

02 Jan 2025 05:40PM UTC coverage: 87.209%. Remained the same
12586431667

Pull #1700

github

web-flow
Merge 35a8d97a0 into 0e8d27442
Pull Request #1700: build(deps): bump cross-spawn from 7.0.3 to 7.0.6

591 of 656 branches covered (90.09%)

Branch coverage included in aggregate %.

1584 of 1838 relevant lines covered (86.18%)

24.61 hits per line

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

0.0
/src/renderer/App.tsx
1
import { useContext } from 'react';
×
2
import {
×
3
  Navigate,
4
  Route,
5
  HashRouter as Router,
6
  Routes,
7
  useLocation,
8
} from 'react-router-dom';
9
import { Loading } from './components/Loading';
×
10
import { Sidebar } from './components/Sidebar';
×
11
import { AppContext, AppProvider } from './context/App';
×
12
import { AccountsRoute } from './routes/Accounts';
×
13
import { FiltersRoute } from './routes/Filters';
×
14
import { LoginRoute } from './routes/Login';
×
15
import { LoginWithOAuthAppRoute } from './routes/LoginWithOAuthApp';
×
16
import { LoginWithPersonalAccessTokenRoute } from './routes/LoginWithPersonalAccessToken';
×
17
import { NotificationsRoute } from './routes/Notifications';
×
18
import { SettingsRoute } from './routes/Settings';
×
19
import './App.css';
×
20

21
function RequireAuth({ children }) {
22
  const { isLoggedIn } = useContext(AppContext);
×
23
  const location = useLocation();
×
24

25
  return isLoggedIn ? (
×
26
    children
27
  ) : (
28
    <Navigate to="/login" replace state={{ from: location }} />
29
  );
30
}
31

32
export const App = () => {
×
33
  return (
×
34
    <AppProvider>
35
      <Router>
36
        <div className="flex h-full overflow-y-auto flex-col pl-14">
37
          <Loading />
38
          <Sidebar />
39
          <Routes>
40
            <Route
41
              path="/"
42
              element={
43
                <RequireAuth>
44
                  <NotificationsRoute />
45
                </RequireAuth>
46
              }
47
            />
48
            <Route
49
              path="/filters"
50
              element={
51
                <RequireAuth>
52
                  <FiltersRoute />
53
                </RequireAuth>
54
              }
55
            />
56
            <Route
57
              path="/settings"
58
              element={
59
                <RequireAuth>
60
                  <SettingsRoute />
61
                </RequireAuth>
62
              }
63
            />
64
            <Route
65
              path="/accounts"
66
              element={
67
                <RequireAuth>
68
                  <AccountsRoute />
69
                </RequireAuth>
70
              }
71
            />
72
            <Route path="/login" element={<LoginRoute />} />
73
            <Route
74
              path="/login-personal-access-token"
75
              element={<LoginWithPersonalAccessTokenRoute />}
76
            />
77
            <Route
78
              path="/login-oauth-app"
79
              element={<LoginWithOAuthAppRoute />}
80
            />
81
          </Routes>
82
        </div>
83
      </Router>
84
    </AppProvider>
85
  );
86
};
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

© 2025 Coveralls, Inc