Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detailed forms #86

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions app/components/GameForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import {
Button,
Textarea,
Grid,
FormHelperText,
Link as ChakraLink,
} from '@chakra-ui/react';

import PossibleGameDuplicates from '../components/PossibleGameDuplicates';
Expand Down Expand Up @@ -94,6 +96,18 @@ const GameForm = ({ defaultData, loading, ...rest }) => {
type="url"
pattern="https://www.igdb.com\/games\/(.+)"
/>
{newGameName && (
<FormHelperText>
You might want to search{' '}
<ChakraLink
href={`https://www.igdb.com/search?utf8=%E2%9C%93&q=${newGameName}`}
isExternal
>
here
</ChakraLink>
.
</FormHelperText>
)}
<FormErrorMessage>
{errors.name && errors.name.message}
</FormErrorMessage>
Expand All @@ -120,6 +134,9 @@ const GameForm = ({ defaultData, loading, ...rest }) => {
placeholder="https://example.com"
type="url"
/>
<FormHelperText>
Official game website, otherwise Steam, itch.io...
</FormHelperText>
<FormErrorMessage>
{errors.site && errors.site.message}
</FormErrorMessage>
Expand Down
2 changes: 1 addition & 1 deletion app/routes/associations.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const Associations = () => {
{currentUser && (
<Button
as={Link}
to="/orgs/create"
to="/orgs/create?type=association"
colorScheme="teal"
leftIcon={<AddIcon />}
>
Expand Down
1 change: 1 addition & 0 deletions app/routes/orgs.create.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export const loader = async ({ request }) => {
return json({
values: {
name: searchParams.get('name') || '',
type: searchParams.get('type'),
},
currentUser,
});
Expand Down
2 changes: 1 addition & 1 deletion app/routes/studios.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const Studios = () => {
{currentUser && (
<Button
as={Link}
to="/orgs/create"
to="/orgs/create?type=studio"
colorScheme="teal"
leftIcon={<AddIcon />}
>
Expand Down