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 { CloseIcon } from "@/components/Icons"
|
||||||
import Title from "@/components/TempDesignSystem/Text/Title"
|
import Title from "@/components/TempDesignSystem/Text/Title"
|
||||||
|
|
||||||
|
import { SidePeekContentProps } from "./types"
|
||||||
|
|
||||||
import styles from "./content.module.css"
|
import styles from "./content.module.css"
|
||||||
|
|
||||||
export default function Content({
|
export default function Content({
|
||||||
@@ -13,12 +15,7 @@ export default function Content({
|
|||||||
contentKey,
|
contentKey,
|
||||||
isActive = false,
|
isActive = false,
|
||||||
onClose,
|
onClose,
|
||||||
}: PropsWithChildren<{
|
}: PropsWithChildren<SidePeekContentProps>) {
|
||||||
title?: string
|
|
||||||
contentKey: string
|
|
||||||
isActive?: boolean
|
|
||||||
onClose?: () => void
|
|
||||||
}>) {
|
|
||||||
return isActive ? (
|
return isActive ? (
|
||||||
<aside className={styles.content}>
|
<aside className={styles.content}>
|
||||||
<header className={styles.header}>
|
<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"
|
import styles from "./sidePeek.module.css"
|
||||||
|
|
||||||
type SidePeekProps = {
|
|
||||||
activeContent: string | null
|
|
||||||
onClose: (isOpen: boolean) => void
|
|
||||||
}
|
|
||||||
export default function SidePeek({
|
export default function SidePeek({
|
||||||
children,
|
children,
|
||||||
onClose,
|
onClose,
|
||||||
activeContent,
|
activeContent,
|
||||||
}: PropsWithChildren<SidePeekProps>) {
|
}: PropsWithChildren<{
|
||||||
|
onClose: (isOpen: boolean) => void
|
||||||
|
activeContent: string | null
|
||||||
|
}>) {
|
||||||
return (
|
return (
|
||||||
<DialogTrigger>
|
<DialogTrigger>
|
||||||
<Modal
|
<Modal
|
||||||
|
|||||||
Reference in New Issue
Block a user