| Total Complexity | 1 |
| Complexity/F | 0 |
| Lines of Code | 30 |
| Function Count | 0 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Coverage | 100% |
| Changes | 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; |