Skip to content

Commit

Permalink
Merge branch 'main' of github.com-sett:TrustlessComputer/bvm-website
Browse files Browse the repository at this point in the history
  • Loading branch information
0xd22f9c committed Sep 11, 2024
2 parents 96787d0 + 80efab0 commit 52c9f77
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import BaseModal from '@/components/BaseModal';
import { Button, Flex } from '@chakra-ui/react';
import { Button, Flex, Text } from '@chakra-ui/react';
import s from './styles.module.scss';
import html2canvas from 'html2canvas';
import jsPDF from 'jspdf';
Expand Down Expand Up @@ -51,6 +51,14 @@ const WhitePaperModal = (props: IProps) => {
setWhitePaper(res);
}

useEffect(() => {
if(whitePaper?.status === 'processing') {
setIsRegenerating(true);
} else {
setIsRegenerating(false);
}
}, [whitePaper]);

const convertMarkdownToHtml = (markdownText: string) => {
return marked(markdownText);
};
Expand Down Expand Up @@ -217,6 +225,11 @@ const WhitePaperModal = (props: IProps) => {
<div ref={contentRef} className={s.whitePaperContent}
dangerouslySetInnerHTML={{ __html: convertMarkdownToHtml(markdownString) }}
></div>
{
isRegenerating && (
<Text textAlign={"center"} color={"#FA4E0E"} mt={4}>White Paper's content is generating. Please wait some minutes!</Text>
)
}
<Flex mt={"24px"} gap={"24px"} alignItems={"center"} justifyContent={"center"}>
<Button
bg={"#000 !important"}
Expand Down
1 change: 1 addition & 0 deletions src/services/api/dapp/whitePapers/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ export interface IWhitePaper extends IPosition {
token_id: number
white_paper: string
token: IToken
status: string;
}

0 comments on commit 52c9f77

Please sign in to comment.