Skip to content

Commit 1de23e6

Browse files
committed
resolved unhandled errors
1 parent 58c0246 commit 1de23e6

File tree

6 files changed

+32
-14
lines changed

6 files changed

+32
-14
lines changed

app/components/Link.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
import React from "react";
22
import NextLink from "next/link";
3-
import { Link as RadixLink } from "@radix-ui/themes";
43

54
interface Props {
65
href: string;
76
children: string;
87
}
98
export const Link = ({ href, children }: Props) => {
109
return (
11-
<NextLink href={href} passHref legacyBehavior>
12-
<RadixLink className="text-blue-500 hover:text-blue-700">
13-
{children}
14-
</RadixLink>
10+
<NextLink href={href} className="text-purple-500 hover:text-purple-700">
11+
{children}
1512
</NextLink>
1613
);
1714
};

app/issues/[id]/edit/loading.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import IssueFormSkeleton from "../../_components/IssueFormSkeleton";
2+
3+
export default IssueFormSkeleton;

app/issues/_components/IssueForm.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@ import { issueSchema } from "@/app/createIssueSchema";
33
import { zodResolver } from "@hookform/resolvers/zod";
44
import { Button, Callout, TextField } from "@radix-ui/themes";
55
import axios from "axios";
6+
import "easymde/dist/easymde.min.css";
7+
import SimpleMDE from "react-simplemde-editor";
68

79
import { useRouter } from "next/navigation";
810
import { useState } from "react";
911
import { Controller, useForm } from "react-hook-form";
1012

1113
import { z } from "zod";
12-
import { ErrorMessage, Spinner, MarkdownEditor } from "../../components";
14+
import { ErrorMessage, Spinner } from "../../components";
1315
import { Issue } from "@prisma/client";
1416

1517
type IssueFormData = z.infer<typeof issueSchema>;
@@ -65,7 +67,7 @@ const IssueForm = ({ issue }: Props) => {
6567
control={control}
6668
defaultValue={issue?.description}
6769
render={({ field }) => (
68-
<MarkdownEditor placeholder="Description" {...field} />
70+
<SimpleMDE placeholder="Description" {...field} />
6971
)}
7072
/>
7173
<ErrorMessage>{errors?.description?.message}</ErrorMessage>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { Skeleton } from "@/app/components";
2+
import { Box } from "@radix-ui/themes";
3+
4+
const IssueFormSkeleton = () => {
5+
return (
6+
<Box>
7+
<Skeleton height="2rem" />
8+
<Skeleton height="20rem" />
9+
</Box>
10+
);
11+
};
12+
13+
export default IssueFormSkeleton;

app/issues/new/loading.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
import React from "react";
1+
import IssueFormSkeleton from "../_components/IssueFormSkeleton";
22

3-
const LoadingNewIssuepage = () => {
4-
return <div>LoadingNewIssuepage</div>;
5-
};
6-
7-
export default LoadingNewIssuepage;
3+
export default IssueFormSkeleton;

app/issues/new/page.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
import IssueForm from "../_components/IssueForm";
1+
"use client";
2+
import dynamic from "next/dynamic";
3+
import IssueFormSkeleton from "./loading";
4+
5+
const IssueForm = dynamic(() => import("../_components/IssueForm"), {
6+
ssr: false,
7+
loading: () => <IssueFormSkeleton />,
8+
});
29

310
const NewIssuePage = () => {
411
return <IssueForm />;

0 commit comments

Comments
 (0)