2019-12-16 02:05:44 +00:00
|
|
|
import React, { forwardRef } from 'react';
|
2019-12-23 05:18:29 +00:00
|
|
|
import { Form } from 'formik';
|
2020-07-04 21:21:28 +00:00
|
|
|
import { breakpoint } from '@/theme';
|
2020-03-28 22:42:53 +00:00
|
|
|
import FlashMessageRender from '@/components/FlashMessageRender';
|
2021-07-22 17:15:27 +00:00
|
|
|
import tw, { styled } from 'twin.macro';
|
2019-06-22 20:53:41 +00:00
|
|
|
|
2021-07-17 18:48:14 +00:00
|
|
|
const Wrapper = styled.div`
|
2020-03-28 22:42:53 +00:00
|
|
|
${breakpoint('sm')`
|
|
|
|
${tw`w-4/5 mx-auto`}
|
|
|
|
`};
|
|
|
|
|
|
|
|
${breakpoint('md')`
|
|
|
|
${tw`p-10`}
|
|
|
|
`};
|
|
|
|
|
|
|
|
${breakpoint('lg')`
|
|
|
|
${tw`w-3/5`}
|
|
|
|
`};
|
|
|
|
|
|
|
|
${breakpoint('xl')`
|
|
|
|
${tw`w-full`}
|
|
|
|
max-width: 700px;
|
|
|
|
`};
|
|
|
|
`;
|
|
|
|
|
2021-07-17 18:48:14 +00:00
|
|
|
const Inner = ({ children }: { children: React.ReactNode }) => (
|
|
|
|
<div css={tw`md:flex w-full bg-white shadow-lg rounded-lg p-6 md:pl-0 mx-1`}>
|
|
|
|
<div css={tw`flex-none select-none mb-6 md:mb-0 self-center`}>
|
|
|
|
<img src={'/assets/svgs/pterodactyl.svg'} css={tw`block w-48 md:w-64 mx-auto`}/>
|
|
|
|
</div>
|
|
|
|
<div css={tw`flex-1`}>
|
|
|
|
{children}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
|
|
|
|
const Container = ({ title, children }: { title?: string, children: React.ReactNode }) => (
|
|
|
|
<Wrapper>
|
2020-07-04 21:21:28 +00:00
|
|
|
{title &&
|
|
|
|
<h2 css={tw`text-3xl text-center text-neutral-100 font-medium py-4`}>
|
2020-03-28 22:42:53 +00:00
|
|
|
{title}
|
2020-07-04 21:21:28 +00:00
|
|
|
</h2>
|
|
|
|
}
|
|
|
|
<FlashMessageRender css={tw`mb-2 px-1`}/>
|
2021-07-17 18:48:14 +00:00
|
|
|
{children}
|
2020-07-04 21:21:28 +00:00
|
|
|
<p css={tw`text-center text-neutral-500 text-xs mt-4`}>
|
2021-03-26 16:30:13 +00:00
|
|
|
© 2015 - {(new Date()).getFullYear()}
|
2020-04-17 21:43:03 +00:00
|
|
|
<a
|
2020-07-04 21:21:28 +00:00
|
|
|
rel={'noopener nofollow noreferrer'}
|
2020-04-17 21:43:03 +00:00
|
|
|
href={'https://pterodactyl.io'}
|
|
|
|
target={'_blank'}
|
2020-07-04 21:21:28 +00:00
|
|
|
css={tw`no-underline text-neutral-500 hover:text-neutral-300`}
|
2020-04-17 21:43:03 +00:00
|
|
|
>
|
|
|
|
Pterodactyl Software
|
|
|
|
</a>
|
|
|
|
</p>
|
2021-07-17 18:48:14 +00:00
|
|
|
</Wrapper>
|
|
|
|
);
|
|
|
|
|
|
|
|
type FormContainerProps = React.DetailedHTMLProps<React.FormHTMLAttributes<HTMLFormElement>, HTMLFormElement> & {
|
|
|
|
title?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
const FormContainer = forwardRef<HTMLFormElement, FormContainerProps>(({ title, ...props }, ref) => (
|
|
|
|
<Container title={title}>
|
|
|
|
<Form {...props} ref={ref}>
|
|
|
|
<Inner>{props.children}</Inner>
|
|
|
|
</Form>
|
2020-03-28 22:42:53 +00:00
|
|
|
</Container>
|
2019-12-16 02:05:44 +00:00
|
|
|
));
|
2021-07-17 18:48:14 +00:00
|
|
|
|
|
|
|
type DivContainerProps = React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> & {
|
|
|
|
title?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export const DivContainer = ({ title, ...props }: DivContainerProps) => (
|
|
|
|
<Container title={title}>
|
|
|
|
<div {...props}>
|
|
|
|
<Inner>{props.children}</Inner>
|
|
|
|
</div>
|
|
|
|
</Container>
|
|
|
|
);
|
|
|
|
|
|
|
|
export default FormContainer;
|