Files
twenty/front/src/pages/not-found/NotFound.tsx
Lucas Bordeau f0e20b06df Added table record mock mode with companies (#2715)
* wip

* Removed console.log

* Refactor mocks into multiple files

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2023-11-25 19:50:50 +01:00

70 lines
1.8 KiB
TypeScript

import { useNavigate } from 'react-router-dom';
import styled from '@emotion/styled';
import { SignInBackgroundMockPage } from '@/sign-in-background-mock/components/SignInBackgroundMockPage';
import { MainButton } from '@/ui/input/button/components/MainButton';
import { useIsMobile } from '@/ui/utilities/responsive/hooks/useIsMobile';
const StyledBackDrop = styled.div`
align-items: center;
backdrop-filter: ${({ theme }) => theme.blur.light};
background: ${({ theme }) => theme.background.transparent.secondary};
display: flex;
flex-direction: column;
height: 100%;
justify-content: center;
left: 0;
position: fixed;
top: 0;
width: 100%;
z-index: 10000;
`;
const StyledTextContainer = styled.div`
align-items: center;
display: flex;
flex-direction: column;
justify-content: center;
padding: ${({ theme }) => theme.spacing(15)};
`;
const StyledButtonContainer = styled.div`
width: 200px;
`;
type StyledInfoProps = {
color: 'dark' | 'light';
};
const StyledInfo = styled.div<StyledInfoProps>`
color: ${(props) =>
props.color === 'light'
? props.theme.font.color.extraLight
: props.theme.font.color.primary};
font-size: ${() => (useIsMobile() ? '2.5rem' : '4rem')};
font-weight: ${({ theme }) => theme.font.weight.semiBold};
`;
export const NotFound = () => {
const navigate = useNavigate();
return (
<>
<StyledBackDrop>
<StyledTextContainer>
<StyledInfo color="dark">404</StyledInfo>
<StyledInfo color="light">Page not found</StyledInfo>
</StyledTextContainer>
<StyledButtonContainer>
<MainButton
title="Back to content"
fullWidth
onClick={() => navigate('/')}
/>
</StyledButtonContainer>
</StyledBackDrop>
<SignInBackgroundMockPage />
</>
);
};