-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add reader page to show publizon reader and enhance work page l…
…ayout with smartLink
- Loading branch information
1 parent
94f0a0b
commit 6c231ca
Showing
14 changed files
with
138 additions
and
64 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,20 @@ | ||
"use client" | ||
|
||
import React from "react" | ||
|
||
import Reader from "@/components/shared/publizonReader/PublizonReader" | ||
|
||
function Page({ searchParams: { id } }: { searchParams: { id: string } }) { | ||
const handleBack = () => { | ||
window.history.back() | ||
} | ||
|
||
return ( | ||
<div className="absolute inset-0 h-screen w-screen"> | ||
<div className="absolute h-full w-full bg-reader-grey"></div> | ||
<Reader onBackCallback={() => handleBack()} type="demo" identifier={id} /> | ||
</div> | ||
) | ||
} | ||
|
||
export default Page |
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
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
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
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,36 @@ | ||
import Link from "next/link" | ||
import React from "react" | ||
|
||
function SmartLink({ | ||
href, | ||
target = "_self", | ||
linkType = "internal", | ||
children, | ||
className, | ||
}: { | ||
href: string | ||
target?: string | ||
linkType?: "internal" | "external" | ||
children: React.ReactNode | ||
className?: string | ||
}) { | ||
// Internal link | ||
if (linkType === "internal") { | ||
return ( | ||
<Link className={className} href={href} target={target}> | ||
{children} | ||
</Link> | ||
) | ||
} | ||
|
||
// External link | ||
if (linkType === "external") { | ||
return ( | ||
<a className={className} href={href} target={target}> | ||
{children} | ||
</a> | ||
) | ||
} | ||
} | ||
|
||
export default SmartLink |
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
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
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,3 @@ | ||
import { cn as classNames } from "../helpers/helper.cn" | ||
|
||
export const cn = classNames |
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
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
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