-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Now we are rendering html with typography elements coming from "tailwind" --------- Co-authored-by: Can Sirin <[email protected]>
- Loading branch information
Showing
54 changed files
with
10,452 additions
and
4,458 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
apps/kampus/app/odin/mufredat/[[...lesson]]/OdinLessonBody.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { graphql, useFragment } from "react-relay"; | ||
|
||
import { type OdinLessonBody_body$key } from "./__generated__/OdinLessonBody_body.graphql"; | ||
|
||
interface Props { | ||
body: OdinLessonBody_body$key | null; | ||
} | ||
|
||
const useOdinLessonBodyFragment = (key: OdinLessonBody_body$key | null) => | ||
useFragment( | ||
graphql` | ||
fragment OdinLessonBody_body on OdinLessonBody { | ||
html | ||
} | ||
`, | ||
key | ||
); | ||
|
||
export const OdinLessonBody = (props: Props) => { | ||
const body = useOdinLessonBodyFragment(props.body); | ||
|
||
return ( | ||
<div | ||
className="prose dark:prose-invert hover:prose-a:text-blue-500" | ||
dangerouslySetInnerHTML={{ __html: body?.html ?? "" }} | ||
/> | ||
); | ||
}; |
23 changes: 23 additions & 0 deletions
23
apps/kampus/app/odin/mufredat/[[...lesson]]/OdinLessonTitle.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { graphql, useFragment } from "react-relay"; | ||
|
||
import { type OdinLessonTitle_title$key } from "./__generated__/OdinLessonTitle_title.graphql"; | ||
|
||
interface Props { | ||
lesson: OdinLessonTitle_title$key | null; | ||
} | ||
|
||
const useOdinLessonTitleFragment = (key: OdinLessonTitle_title$key | null) => | ||
useFragment( | ||
graphql` | ||
fragment OdinLessonTitle_title on OdinLesson { | ||
title | ||
} | ||
`, | ||
key | ||
); | ||
|
||
export const OdinLessonTitle = (props: Props) => { | ||
const lesson = useOdinLessonTitleFragment(props.lesson); | ||
|
||
return <h2 className="text-3xl font-bold">{lesson?.title}</h2>; | ||
}; |
42 changes: 42 additions & 0 deletions
42
apps/kampus/app/odin/mufredat/[[...lesson]]/__generated__/OdinLessonBody_body.graphql.ts
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
98 changes: 54 additions & 44 deletions
98
apps/kampus/app/odin/mufredat/[[...lesson]]/__generated__/OdinLessonQuery.graphql.ts
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
42 changes: 42 additions & 0 deletions
42
apps/kampus/app/odin/mufredat/[[...lesson]]/__generated__/OdinLessonTitle_title.graphql.ts
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.