Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
car-crushers-portal/app/routes/rpserver_.application.tsx
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
88 lines (82 sloc)
2.48 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
Button, | |
Container, | |
FormControl, | |
FormLabel, | |
Heading, | |
Input, | |
NumberDecrementStepper, | |
NumberIncrementStepper, | |
NumberInput, | |
NumberInputField, | |
NumberInputStepper, | |
Textarea, | |
VStack, | |
} from "@chakra-ui/react"; | |
import { useLoaderData } from "@remix-run/react"; | |
export async function loader({ context }: { context: RequestContext }) { | |
const { current_user: user } = context.data; | |
if (!user.id) | |
throw new Response(null, { | |
status: 401, | |
}); | |
if (await context.env.DATA.get(`rpserverblock_${user.id}`)) | |
throw new Response(null, { | |
status: 403, | |
}); | |
return null; | |
} | |
export default function () { | |
useLoaderData<typeof loader>(); | |
return ( | |
<Container maxW="container.md"> | |
<Heading pb="32px">RP Server Application</Heading> | |
<VStack alignItems="start" spacing={12}> | |
<FormControl isRequired> | |
<FormLabel>Server Invite</FormLabel> | |
<Input maxLength={48} placeholder="https://discord.gg/abcdef123456" /> | |
</FormControl> | |
<FormControl isRequired> | |
<FormLabel>Roblox Username</FormLabel> | |
<Input maxLength={20} placeholder="builderman" /> | |
</FormControl> | |
<FormControl isRequired> | |
<FormLabel>How old are you?</FormLabel> | |
<NumberInput> | |
<NumberInputField /> | |
<NumberInputStepper> | |
<NumberIncrementStepper /> | |
<NumberDecrementStepper /> | |
</NumberInputStepper> | |
</NumberInput> | |
</FormControl> | |
<FormControl isRequired> | |
<FormLabel>Introduce yourself!</FormLabel> | |
<Textarea | |
placeholder="Who are you? What do you enjoy doing? Write everything you want us to know about you." | |
rows={5} | |
/> | |
</FormControl> | |
<FormControl isRequired> | |
<FormLabel>What is your RP server about?</FormLabel> | |
<Input | |
maxLength={256} | |
placeholder="This can be just about anything tangentally related to CC2." | |
/> | |
</FormControl> | |
<FormControl> | |
<FormLabel>Explain the above in more details</FormLabel> | |
<Textarea | |
placeholder="What are your specific plans for your server?" | |
rows={5} | |
/> | |
</FormControl> | |
<FormControl> | |
<FormLabel>Anything else?</FormLabel> | |
<Textarea placeholder="Any questions or comments" rows={5} /> | |
</FormControl> | |
<Button>Submit</Button> | |
</VStack> | |
</Container> | |
); | |
} |