From 9e50a024eedb25308548897e64a3ca880ad03ca2 Mon Sep 17 00:00:00 2001 From: spencerwooo Date: Tue, 22 Feb 2022 14:09:57 +0800 Subject: [PATCH] show download buttons when file content is still loading --- components/previews/CodePreview.tsx | 15 ++++++++++----- components/previews/MarkdownPreview.tsx | 13 ++++++++++--- components/previews/TextPreview.tsx | 11 ++++++++--- 3 files changed, 28 insertions(+), 11 deletions(-) diff --git a/components/previews/CodePreview.tsx b/components/previews/CodePreview.tsx index d846408..980bd8f 100644 --- a/components/previews/CodePreview.tsx +++ b/components/previews/CodePreview.tsx @@ -29,14 +29,19 @@ const CodePreview: FC<{ file: any }> = ({ file }) => { } if (validating) { return ( - - - + <> + + + + + + + ) } return ( -
+ <> = ({ file }) => { -
+ ) } diff --git a/components/previews/MarkdownPreview.tsx b/components/previews/MarkdownPreview.tsx index da84668..815b5fe 100644 --- a/components/previews/MarkdownPreview.tsx +++ b/components/previews/MarkdownPreview.tsx @@ -96,9 +96,16 @@ const MarkdownPreview: FC<{ } if (validating) { return ( - - - + <> + + + + {standalone && ( + + + + )} + ) } diff --git a/components/previews/TextPreview.tsx b/components/previews/TextPreview.tsx index 79f1766..fbaef5d 100644 --- a/components/previews/TextPreview.tsx +++ b/components/previews/TextPreview.tsx @@ -30,9 +30,14 @@ const TextPreview = ({ file }) => { if (!content) { return ( - - - + <> + + + + + + + ) }