Skip to content

Commit

Permalink
up: refactor format
Browse files Browse the repository at this point in the history
  • Loading branch information
Khoerul Umam committed Oct 15, 2023
1 parent 850ee52 commit 2977d76
Show file tree
Hide file tree
Showing 21 changed files with 108 additions and 366 deletions.
41 changes: 41 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"zod": "^3.21.4"
},
"devDependencies": {
"@tailwindcss/typography": "^0.5.10",
"@types/eslint": "^8.44.2",
"@types/node": "^18.16.0",
"@types/react": "^18.2.20",
Expand Down
52 changes: 0 additions & 52 deletions prisma/migrations/20231003035832_init/migration.sql

This file was deleted.

12 changes: 0 additions & 12 deletions prisma/migrations/20231014134646_initvisitor/migration.sql

This file was deleted.

12 changes: 0 additions & 12 deletions prisma/migrations/20231014143419_init_share/migration.sql

This file was deleted.

3 changes: 0 additions & 3 deletions prisma/migrations/migration_lock.toml

This file was deleted.

34 changes: 5 additions & 29 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ datasource db {

model Category {
id String @id @default(cuid())
slug String
name String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
Expand All @@ -23,45 +24,20 @@ model Category {

model Course {
id String @id @default(cuid())
slug String
title String
categoryId String
category Category @relation(fields: [categoryId], references: [id])
description String
description String @db.Text
icon String
materials Material[]
materials String @db.Text
author String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@index([id, categoryId])
}

model Material {
id String @id @default(cuid())
title String
content String @db.Text
sequence String
courseId String
course Course @relation(fields: [courseId], references: [id])
code Code? @relation(fields: [codeId], references: [id])
codeId String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@index([id, courseId])
}

model Code {
id String @id @default(cuid())
title String
codes String @db.Text
language String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
Material Material[]
@@index([id])
}

model CourseVisitor {
id String @id @default(cuid())
courseId String @unique
Expand Down
6 changes: 4 additions & 2 deletions src/components/card/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ import { api } from "u/utils/api";
interface Props {
id: string
name: string
slug: string
}

const Card: NextPage<Props> = ({
id,
name
name,
slug
}) => {
const router = useRouter();
const { mutate } = api.visitorRouter.upsert.useMutation();
Expand All @@ -27,7 +29,7 @@ const Card: NextPage<Props> = ({

const goToDetail = (): void => {
handleVisitorClick();
void router.push('/card/' + id);
void router.push('/card/' + slug);
}

const handleVisitorClick = () => {
Expand Down
11 changes: 6 additions & 5 deletions src/components/cardstack/index.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
import { type NextPage } from "next";
import { type Material } from "u/interfaces/material";
import Content from "../content";

interface Props {
materials: Material[] | undefined
materials: string | undefined
}
const CardStack: NextPage<Props> = ({
materials
}) => {
const cards: string[] = materials?.split("\\") as unknown as string[];

return (
<div className="md:container md:mx-auto">
<div className="grid grid-cols-1 md:grid-cols-2 gap-6 px-6 md:px-0">
{
materials?.map((material) => {
return (<div key={material.id}>
<Content material={material}></Content>
cards?.map((item) => {
return (<div key={item}>
<Content material={item}></Content>
</div>);
})
}
Expand Down
Empty file removed src/components/carousel/button.tsx
Empty file.
82 changes: 0 additions & 82 deletions src/components/carousel/cardeffect.tsx

This file was deleted.

Loading

0 comments on commit 2977d76

Please sign in to comment.