chore: typing for sidepeek components
This commit is contained in:
@@ -5,6 +5,8 @@ import { Children, PropsWithChildren } from "react"
|
||||
import { CloseIcon } from "@/components/Icons"
|
||||
import Title from "@/components/TempDesignSystem/Text/Title"
|
||||
|
||||
import { SidePeekContentProps } from "./types"
|
||||
|
||||
import styles from "./content.module.css"
|
||||
|
||||
export default function Content({
|
||||
@@ -13,12 +15,7 @@ export default function Content({
|
||||
contentKey,
|
||||
isActive = false,
|
||||
onClose,
|
||||
}: PropsWithChildren<{
|
||||
title?: string
|
||||
contentKey: string
|
||||
isActive?: boolean
|
||||
onClose?: () => void
|
||||
}>) {
|
||||
}: PropsWithChildren<SidePeekContentProps>) {
|
||||
return isActive ? (
|
||||
<aside className={styles.content}>
|
||||
<header className={styles.header}>
|
||||
|
||||
6
components/TempDesignSystem/SidePeek/Content/types.ts
Normal file
6
components/TempDesignSystem/SidePeek/Content/types.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export type SidePeekContentProps = {
|
||||
title?: string
|
||||
contentKey: string
|
||||
isActive?: boolean
|
||||
onClose?: () => void
|
||||
}
|
||||
@@ -5,15 +5,14 @@ import { Dialog, DialogTrigger, Modal } from "react-aria-components"
|
||||
|
||||
import styles from "./sidePeek.module.css"
|
||||
|
||||
type SidePeekProps = {
|
||||
activeContent: string | null
|
||||
onClose: (isOpen: boolean) => void
|
||||
}
|
||||
export default function SidePeek({
|
||||
children,
|
||||
onClose,
|
||||
activeContent,
|
||||
}: PropsWithChildren<SidePeekProps>) {
|
||||
}: PropsWithChildren<{
|
||||
onClose: (isOpen: boolean) => void
|
||||
activeContent: string | null
|
||||
}>) {
|
||||
return (
|
||||
<DialogTrigger>
|
||||
<Modal
|
||||
|
||||
Reference in New Issue
Block a user