Last active
October 15, 2022 16:06
-
-
Save dioxmio/2701984b223d460cd9f9847c08e30ce5 to your computer and use it in GitHub Desktop.
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
interface Props { | |
children: React.ReactNode; | |
content: React.ReactNode; | |
footer?: string; | |
isOpen: boolean; | |
onClose?: () => void; | |
title?: string; | |
} | |
// ❌ Wide multi purpose Component | |
function Dialog(props): Props { | |
return ( | |
<... /> | |
) | |
} | |
type AvengerProps = { | |
description: string; | |
name: string; | |
} | |
// Example of usage. We have a big contract to fill | |
function ShowAvenger({name, description}: AvengerProps) { | |
return ( | |
<Dialog | |
title={name} | |
content={<AvengerDetails description={description} />} | |
.... | |
/> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment