thunderhub/pages/index.tsx
Anthony Potdevin b02694cd6c
refactor: ♻ cookies set from server (#49)
* chore: 🔧 change withApollo

* feat:  set cookie from server

* chore: 🔧 remove bcrypt dep

* fix: 🐛 initialize check

* chore: 🔧 remove cookies correctly

* fix: 🐛 status type
2020-05-26 07:03:33 +02:00

43 lines
1.1 KiB
TypeScript

import * as React from 'react';
import { Spacer } from 'src/components/spacer/Spacer';
import { withApollo } from 'config/client';
import { ServerAccounts } from 'src/components/accounts/ServerAccounts';
import { useAccountState } from 'src/context/AccountContext';
import { SessionLogin } from '../src/views/login/SessionLogin';
import { TopSection } from '../src/views/homepage/Top';
import { LoginBox } from '../src/views/homepage/LoginBox';
import { Accounts } from '../src/views/homepage/Accounts';
import { LoadingCard } from '../src/components/loading/LoadingCard';
import { Section } from '../src/components/section/Section';
const ContextApp = () => {
const { finishedFetch } = useAccountState();
return (
<>
<TopSection />
{!finishedFetch && (
<Section withColor={false}>
<LoadingCard loadingHeight={'160px'} />
</Section>
)}
{finishedFetch && (
<>
<SessionLogin />
<Accounts />
<LoginBox />
</>
)}
<Spacer />
</>
);
};
const Wrapped = () => (
<>
<ServerAccounts />
<ContextApp />
</>
);
export default withApollo(Wrapped);