From 3df9aa545d7c991433dd480552b16294d864166a Mon Sep 17 00:00:00 2001 From: Kevin Qi Date: Sun, 28 Apr 2019 15:32:01 -0700 Subject: [PATCH] click button to toggle extended examples --- demo/src/Demo.tsx | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/demo/src/Demo.tsx b/demo/src/Demo.tsx index aa786f7..c457d1c 100644 --- a/demo/src/Demo.tsx +++ b/demo/src/Demo.tsx @@ -14,6 +14,8 @@ const Example: React.FunctionComponent<{ description: string }> = ({ description ); function Demo() { + const [showAllExamples, setShowAllExamples] = React.useState(false); + return (
@@ -97,13 +99,25 @@ function Demo() {
- - - - - - - + {showAllExamples ? ( + + + + + + + + + ) : ( +
+ +
+ )}