Skip to content

Commit

Permalink
chore: update example
Browse files Browse the repository at this point in the history
  • Loading branch information
aiji42 committed Dec 15, 2022
1 parent e455196 commit 47cbf81
Showing 1 changed file with 29 additions and 19 deletions.
48 changes: 29 additions & 19 deletions examples/with-next-i18next/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ import {
Select,
InputGroup,
InputLeftAddon,
Container,
Flex,
Heading,
Spacer,
} from "@chakra-ui/react";
import { zodResolver } from "@hookform/resolvers/zod";
import z from "zod";
Expand Down Expand Up @@ -58,24 +62,30 @@ export default function HookForm() {
);

return (
<>
<InputGroup>
<InputLeftAddon children="🌐" />
<Select
defaultValue={router.locale}
onChange={changeLocale}
mb={8}
borderLeftRadius={0}
>
<option value="ar">العربية</option>
<option value="en">English</option>
<option value="fr">Français</option>
<option value="is">Icelandic</option>
<option value="ja">日本語</option>
<option value="pt">Português</option>
<option value="zh-CN">简体中文</option>
</Select>
</InputGroup>
<Container maxW="container.xl">
<Flex as="header" py="4" justifyContent="space-between">
<a href="https://github.com/aiji42/zod-i18n" rel="noopener noreferrer">
<Heading as="h1" fontSize="xl" color="gray.600">
zod-i18n-map
</Heading>
</a>
<InputGroup maxW="3xs">
<InputLeftAddon>🌐</InputLeftAddon>
<Select
defaultValue={router.locale}
onChange={changeLocale}
borderLeftRadius={0}
>
<option value="ar">العربية</option>
<option value="en">English</option>
<option value="fr">Français</option>
<option value="is">Icelandic</option>
<option value="ja">日本語</option>
<option value="pt">Português</option>
<option value="zh-CN">简体中文</option>
</Select>
</InputGroup>
</Flex>
<form onSubmit={handleSubmit(console.log)}>
<FormControl isInvalid={!!errors.username} mb={4}>
<FormLabel htmlFor="username">
Expand Down Expand Up @@ -124,6 +134,6 @@ export default function HookForm() {
<Trans>Submit</Trans>
</Button>
</form>
</>
</Container>
);
}

1 comment on commit 47cbf81

@vercel
Copy link

@vercel vercel bot commented on 47cbf81 Dec 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

zod-i18n – ./

zod-i18n-aiji42.vercel.app
zod-i18n-git-main-aiji42.vercel.app
zod-i18n.vercel.app

Please sign in to comment.