Skip to content

Commit

Permalink
fix(admin): add back link to create pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Rei-x committed Feb 27, 2023
1 parent 0722dbf commit 3291bee
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 3 deletions.
16 changes: 15 additions & 1 deletion src/features/admin/views/organizations/create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,21 @@ import {
FormLabel,
Heading,
Input,
Link,
Select,
Switch,
Textarea,
useToast,
VStack,
} from "@chakra-ui/react";
import { motion } from "framer-motion";
import { route } from "nextjs-routes";
import React from "react";
import slugify from "slugify";
import { z } from "zod";
import { FormField } from "../../components/FormField";
import { Layout } from "../../components/Layout";
import NextLink from "next/link";

const departments = [
"W1 - Wydział Architektury",
Expand Down Expand Up @@ -119,7 +122,18 @@ export const CreateOrganizationPage = () => {

return (
<Layout>
<Heading mb={4}>Stwórz organizacje</Heading>
<Link
href={route({
pathname: "/admin/organizacje",
})}
color="gray"
as={NextLink}
>
Wróć
</Link>
<Heading mt={2} mb={4}>
Stwórz organizacje
</Heading>
<form
onSubmit={handleSubmit(async (data) => {
if (!data.addManually) {
Expand Down
24 changes: 22 additions & 2 deletions src/features/admin/views/tags/create.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
import { useForm } from "@/hooks/useForm";
import { api } from "@/utils/api";
import { Button, Heading, Input, useToast, VStack } from "@chakra-ui/react";
import {
Button,
Heading,
Input,
Link,
useToast,
VStack,
} from "@chakra-ui/react";
import React from "react";
import { z } from "zod";
import { FormField } from "../../components/FormField";
import { Layout } from "../../components/Layout";
import NextLink from "next/link";
import { route } from "nextjs-routes";

const schema = z.object({
text: z
Expand All @@ -31,7 +40,18 @@ export const CreateTagPage = () => {

return (
<Layout>
<Heading mb={4}>Stwórz tag</Heading>
<Link
href={route({
pathname: "/admin/tagi",
})}
color="gray"
as={NextLink}
>
Wróć
</Link>
<Heading mt={2} mb={4}>
Stwórz tag
</Heading>
<form
onSubmit={handleSubmit(async (data) => {
try {
Expand Down

0 comments on commit 3291bee

Please sign in to comment.