Passed
Push — development ( 2f9cbb...cdc56b )
by Peter
09:24 queued 15s
created

frontend/src/pages/HomePage.tsx   A

Complexity

Total Complexity 1
Complexity/F 0

Size

Lines of Code 30
Function Count 0

Duplication

Duplicated Lines 0
Ratio 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 23
dl 0
loc 30
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
wmc 1
mnd 1
bc 1
fnc 0
bpm 0
cpm 0
noi 0
1
import { useSelector } from 'react-redux';
2
import { RootState } from '../redux/store/store';
3
4
import Login from '../components/Login';
5
6 2
const HomePage: React.FC = () => {
7
8 4
  const { isLoggedIn } = useSelector((state: RootState) =>  state.auth);
9
10 2
  return (
11
    <div className="flex flex-col items-center justify-center h-screen" data-testid="home-page">
12
        { isLoggedIn 
13
        ?
14
        (
15
        <div className="block max-w-sm p-6 bg-white border border-gray-200 rounded-lg shadow hover:bg-gray-100 dark:bg-gray-800 dark:border-gray-700 dark:hover:bg-gray-700">
16
            <h5 className="mb-2 text-2xl font-bold tracking-tight text-gray-800 dark:text-blue">Du är inloggad</h5>
17
          </div>
18
        )
19
        :
20
          (<>
21
            <h1 className="text-2xl font-bold mb-4 text-green-500">Logga in via Guthub</h1>
22
            <Login/>
23
          </>
24
          )
25
      }
26
    </div>
27
  );
28
};
29
30
export default HomePage;