AppWrapper.tsx 763 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import { Flex } from "reflexbox/styled-components";
  2. import styled from "styled-components";
  3. import React from "react";
  4. import { useStoreState } from "../store";
  5. import PageLoading from "./PageLoading";
  6. import Header from "./Header";
  7. const Wrapper = styled(Flex)`
  8. input {
  9. filter: none;
  10. }
  11. * {
  12. box-sizing: border-box;
  13. }
  14. *::-moz-focus-inner {
  15. border: none;
  16. }
  17. `;
  18. const AppWrapper = ({ children }: { children: any }) => {
  19. const loading = useStoreState(s => s.loading.loading);
  20. return (
  21. <Wrapper
  22. minHeight="100vh"
  23. width={1}
  24. flex="0 0 auto"
  25. alignItems="center"
  26. flexDirection="column"
  27. >
  28. <Header />
  29. {loading ? <PageLoading /> : children}
  30. </Wrapper>
  31. );
  32. };
  33. export default AppWrapper;