From 59fae98030973eb21528d63543ffbccf1beb58e1 Mon Sep 17 00:00:00 2001 From: Pavel Torbeev Date: Sun, 27 Aug 2023 06:54:33 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=BB=D1=83=D1=87=D1=88=D0=B8=D0=BB=20?= =?UTF-8?q?=D0=BF=D1=80=D0=B5=D0=B7=D0=B5=D0=BD=D1=82=D0=B0=D1=86=D0=B8?= =?UTF-8?q?=D1=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/deck/getDeck.ts | 1 + src/config.ts | 9 ++-- src/pages/chat/ChatPage.tsx | 4 +- src/pages/deck/DeckPage.tsx | 1 + src/pages/deck/document/Document.tsx | 21 +++++++-- src/pages/deck/document/shared.ts | 26 ++++++++++- src/pages/deck/document/slides/Slide1.tsx | 21 +++++---- src/pages/deck/document/slides/Slide10.tsx | 14 ++---- src/pages/deck/document/slides/Slide11.tsx | 12 ++--- src/pages/deck/document/slides/Slide12.tsx | 15 +++--- src/pages/deck/document/slides/Slide13.tsx | 18 +++----- src/pages/deck/document/slides/Slide2.tsx | 10 ++-- src/pages/deck/document/slides/Slide3.tsx | 43 ++++++++++++------ src/pages/deck/document/slides/Slide4.tsx | 44 ++++++++++++------ src/pages/deck/document/slides/Slide5.tsx | 9 ++-- src/pages/deck/document/slides/Slide6.tsx | 12 ++--- src/pages/deck/document/slides/Slide7.tsx | 12 ++--- src/pages/deck/document/slides/Slide8.tsx | 18 +++++--- src/pages/deck/document/slides/Slide9.tsx | 53 +++++++++++++++++----- 19 files changed, 213 insertions(+), 130 deletions(-) diff --git a/src/api/deck/getDeck.ts b/src/api/deck/getDeck.ts index 20a1b84..71ac11f 100644 --- a/src/api/deck/getDeck.ts +++ b/src/api/deck/getDeck.ts @@ -20,6 +20,7 @@ export type GetDeckResponse = { data: { slug: string; answer: any; + photos?: string[] }[]; }[]; }; diff --git a/src/config.ts b/src/config.ts index 752b757..d4b6dc8 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,3 +1,6 @@ -export const API_URL = 'http://192.168.83.181:8000/api'; -// export const API_URL = 'http://192.168.22.4:8000/api'; -// export const API_URL = 'https://ed68-77-234-219-9.ngrok-free.app/api'; \ No newline at end of file +// export const BACKEND_URL = 'http://192.168.83.181:8000'; +// export const BACKEND_URL = 'http://192.168.22.4:8000'; +// export const BACKEND_URL = 'https://ed68-77-234-219-9.ngrok-free.app'; +export const BACKEND_URL = 'http://192.168.83.181'; + +export const API_URL = BACKEND_URL + '/api'; \ No newline at end of file diff --git a/src/pages/chat/ChatPage.tsx b/src/pages/chat/ChatPage.tsx index 6f34e7f..3e79351 100644 --- a/src/pages/chat/ChatPage.tsx +++ b/src/pages/chat/ChatPage.tsx @@ -29,8 +29,8 @@ export interface ChatPageProps { const QUESTION_POLLING_MS = 1000; -const DEFAULT_DECK_ID = 80; -const DEFAULT_QUESTION_ID = 25; +const DEFAULT_DECK_ID = 0; +const DEFAULT_QUESTION_ID = 0; export const ChatPage: ReactFCC = (props) => { const {className} = props; diff --git a/src/pages/deck/DeckPage.tsx b/src/pages/deck/DeckPage.tsx index 608054f..5a5d55c 100644 --- a/src/pages/deck/DeckPage.tsx +++ b/src/pages/deck/DeckPage.tsx @@ -14,6 +14,7 @@ import {generateGrowChart} from './document/media/generateGrowChart'; export const DeckPage: ReactFCC = () => { const deckId = useUrlParam(DECK_PAGE_PARAM, {parser: parseInt}); + // todo поставить таумаут искуственно const { data } = useDeck({ deckId: deckId ?? 0, config: { diff --git a/src/pages/deck/document/Document.tsx b/src/pages/deck/document/Document.tsx index 745f8f3..f131b80 100644 --- a/src/pages/deck/document/Document.tsx +++ b/src/pages/deck/document/Document.tsx @@ -15,6 +15,7 @@ import {Slide10} from './slides/Slide10'; import {Slide11} from './slides/Slide11'; import {Slide12} from './slides/Slide12'; import {Slide13} from './slides/Slide13'; +import {BACKEND_URL} from '../../../config'; Chart.defaults.font.size = 20; @@ -28,18 +29,32 @@ export interface MyDocumentProps { Font.register({ family: "Roboto", - src: "https://cdnjs.cloudflare.com/ajax/libs/ink/3.1.10/fonts/Roboto/roboto-medium-webfont.ttf" + fonts: [ + { fontWeight: 'medium', src: "https://cdn.jsdelivr.net/npm/roboto-font@0.1.0/fonts/Roboto/roboto-medium-webfont.ttf" }, + { fontWeight: 'normal', src: "https://cdn.jsdelivr.net/npm/roboto-font@0.1.0/fonts/Roboto/roboto-regular-webfont.ttf" }, + { fontWeight: 'light', src: "https://cdn.jsdelivr.net/npm/roboto-font@0.1.0/fonts/Roboto/roboto-light-webfont.ttf" }, + ] +}); + +Font.register({ + family: "Roboto Slab", + fonts: [ + { fontWeight: 'light', src: "https://cdn.jsdelivr.net/npm/roboto-font@0.1.0/fonts/Roboto_slab/robotoslab-light-webfont.ttf" }, + { fontWeight: 'normal', src: "https://cdn.jsdelivr.net/npm/roboto-font@0.1.0/fonts/Roboto_slab/robotoslab-regular-webfont.ttf" }, + ] }); export const MyDocument: ReactFCC = (props) => { const { data, marketChart, financialChart, growChart, onRender } = props; + const images = data.slides[12].data?.find((i) => i.slug === 'images')?.photos; + return ( - - + + diff --git a/src/pages/deck/document/shared.ts b/src/pages/deck/document/shared.ts index d1628ac..dfab67a 100644 --- a/src/pages/deck/document/shared.ts +++ b/src/pages/deck/document/shared.ts @@ -1,2 +1,26 @@ export const bgColor = '#EFEEE7'; -export const primaryColor = '#2B2C30'; \ No newline at end of file +export const primaryColor = '#2B2C30'; +export const secondaryColor = '#5e6166'; + +export const pageFontStyles: any = { + fontFamily: 'Roboto Slab', + fontWeight: 'light', + fontSize: 22 +} + +export const titleStyles: any = { + fontSize: 36, + width: '100%', + letterSpacing: 3, + textTransform: 'uppercase', + fontFamily: 'Roboto', + fontWeight: 'normal', +} + +export const subtitleStyles: any = { + fontSize: 24, + width: '100%', + textTransform: 'uppercase', + fontFamily: 'Roboto Slab', + fontWeight: 'normal', +} \ No newline at end of file diff --git a/src/pages/deck/document/slides/Slide1.tsx b/src/pages/deck/document/slides/Slide1.tsx index c639a15..65c1ad8 100644 --- a/src/pages/deck/document/slides/Slide1.tsx +++ b/src/pages/deck/document/slides/Slide1.tsx @@ -1,6 +1,6 @@ import {ReactFCC} from '../../../../utils/ReactFCC'; import {Page, StyleSheet, Text, View} from '@react-pdf/renderer'; -import {bgColor, primaryColor} from '../shared'; +import {bgColor, pageFontStyles, primaryColor, titleStyles} from '../shared'; import format from 'date-fns/format'; import {GetDeckResponse} from '../../../../api/deck/getDeck'; import {ExtractArray} from '../../../../utils/types'; @@ -19,7 +19,7 @@ const styles = StyleSheet.create({ backgroundColor: bgColor, color: primaryColor, padding: '56px', - fontFamily: 'Roboto' + ...pageFontStyles }, mainBlock: { flex: '1', @@ -29,8 +29,10 @@ const styles = StyleSheet.create({ alignItems: 'stretch' }, title: { + ...titleStyles, fontSize: 96, - width: '100%', + fontFamily: 'Roboto Slab', + color: 'black' }, divider: { width: '100%', @@ -43,24 +45,23 @@ const styles = StyleSheet.create({ width: '100%', fontSize: '20px', }, - secondaryBlock: { - // - }, info: { display: 'flex', flexDirection: 'column', rowGap: 4 }, infoText: { - fontFamily: 'Helvetica', + fontFamily: 'Roboto', + fontWeight: 'normal', fontSize: '14px', } }); export const Slide1: ReactFCC = (props) => { - const { title, description, data } = props; + const { description, data } = props; const name = data.find((i) => i.slug === 'names')?.answer as string; + const your_role = data.find((i) => i.slug === 'your_role')?.answer as string; return ( @@ -70,9 +71,9 @@ export const Slide1: ReactFCC = (props) => { {description} - + - Henrietta Mitchell, Founder & CEO + {your_role} {format(new Date(), 'dd MMM, yyyy')} diff --git a/src/pages/deck/document/slides/Slide10.tsx b/src/pages/deck/document/slides/Slide10.tsx index 1a4ae73..e729f50 100644 --- a/src/pages/deck/document/slides/Slide10.tsx +++ b/src/pages/deck/document/slides/Slide10.tsx @@ -1,6 +1,6 @@ import {ReactFCC} from '../../../../utils/ReactFCC'; import {Image, Page, StyleSheet, Text, View} from '@react-pdf/renderer'; -import {bgColor, primaryColor} from '../shared'; +import {bgColor, pageFontStyles, primaryColor, subtitleStyles, titleStyles} from '../shared'; import {GetDeckResponse} from '../../../../api/deck/getDeck'; import {ExtractArray} from '../../../../utils/types'; import {currencyFormatter, formatDate} from '../../../../utils/fomat'; @@ -16,14 +16,11 @@ const styles = StyleSheet.create({ alignItems: 'stretch', backgroundColor: bgColor, color: primaryColor, - fontFamily: 'Roboto', padding: '48px', + ...pageFontStyles }, title: { - fontSize: 36, - width: '100%', - letterSpacing: 3, - textTransform: 'uppercase' + ...titleStyles, }, divider: { width: '100%', @@ -37,8 +34,7 @@ const styles = StyleSheet.create({ marginBottom: 24 }, subtitle: { - width: '100%', - fontSize: '24px', + ...subtitleStyles }, }); @@ -56,7 +52,7 @@ export const Slide10: ReactFCC = (props) => { Сколько инвестиций необходимо - {currencyFormatter.format(how_much_investments)} + {currencyFormatter.format(how_much_investments)}р. Цели инвестиций {investments_sold} diff --git a/src/pages/deck/document/slides/Slide11.tsx b/src/pages/deck/document/slides/Slide11.tsx index 26cf679..26fd767 100644 --- a/src/pages/deck/document/slides/Slide11.tsx +++ b/src/pages/deck/document/slides/Slide11.tsx @@ -1,6 +1,6 @@ import {ReactFCC} from '../../../../utils/ReactFCC'; import {Image, Page, StyleSheet, Text, View} from '@react-pdf/renderer'; -import {bgColor, primaryColor} from '../shared'; +import {bgColor, pageFontStyles, primaryColor, subtitleStyles, titleStyles} from '../shared'; import {GetDeckResponse} from '../../../../api/deck/getDeck'; import {ExtractArray} from '../../../../utils/types'; @@ -16,14 +16,11 @@ const styles = StyleSheet.create({ alignItems: 'stretch', backgroundColor: bgColor, color: primaryColor, - fontFamily: 'Roboto', padding: '48px', + ...pageFontStyles }, title: { - fontSize: 36, - width: '100%', - letterSpacing: 3, - textTransform: 'uppercase' + ...titleStyles }, divider: { width: '100%', @@ -37,8 +34,7 @@ const styles = StyleSheet.create({ marginBottom: 24 }, subtitle: { - width: '100%', - fontSize: '24px', + ...subtitleStyles }, image: { maxWidth: '600px', diff --git a/src/pages/deck/document/slides/Slide12.tsx b/src/pages/deck/document/slides/Slide12.tsx index b622c9f..5ff55b5 100644 --- a/src/pages/deck/document/slides/Slide12.tsx +++ b/src/pages/deck/document/slides/Slide12.tsx @@ -1,6 +1,6 @@ import {ReactFCC} from '../../../../utils/ReactFCC'; -import {Image, Page, StyleSheet, Text, View} from '@react-pdf/renderer'; -import {bgColor, primaryColor} from '../shared'; +import {Page, StyleSheet, Text, View} from '@react-pdf/renderer'; +import {bgColor, pageFontStyles, primaryColor, subtitleStyles, titleStyles} from '../shared'; import {GetDeckResponse} from '../../../../api/deck/getDeck'; import {ExtractArray} from '../../../../utils/types'; import {formatDate} from '../../../../utils/fomat'; @@ -17,14 +17,15 @@ const styles = StyleSheet.create({ alignItems: 'stretch', backgroundColor: bgColor, color: primaryColor, - fontFamily: 'Roboto', padding: '48px', + ...pageFontStyles, }, title: { fontSize: 36, width: '100%', letterSpacing: 3, - textTransform: 'uppercase' + textTransform: 'uppercase', + ...titleStyles }, divider: { width: '100%', @@ -33,8 +34,8 @@ const styles = StyleSheet.create({ margin: '8px 0 16px' }, subtitle: { - fontSize: '18px', - marginBottom: '4px', + ...subtitleStyles, + marginBottom: '12px', marginLeft: '-6px' }, text: { @@ -70,7 +71,7 @@ export const Slide12: ReactFCC = (props) => { return ( - Роадмап + План развития diff --git a/src/pages/deck/document/slides/Slide13.tsx b/src/pages/deck/document/slides/Slide13.tsx index a5781e5..bb83697 100644 --- a/src/pages/deck/document/slides/Slide13.tsx +++ b/src/pages/deck/document/slides/Slide13.tsx @@ -1,9 +1,8 @@ import {ReactFCC} from '../../../../utils/ReactFCC'; -import {Image, Page, StyleSheet, Text, View} from '@react-pdf/renderer'; -import {bgColor, primaryColor} from '../shared'; +import {Page, StyleSheet, Text, View} from '@react-pdf/renderer'; +import {bgColor, pageFontStyles, primaryColor, subtitleStyles, titleStyles} from '../shared'; import {GetDeckResponse} from '../../../../api/deck/getDeck'; import {ExtractArray} from '../../../../utils/types'; -import {formatDate} from '../../../../utils/fomat'; import {Fragment} from 'react'; export interface Slide13Props { @@ -17,14 +16,11 @@ const styles = StyleSheet.create({ alignItems: 'stretch', backgroundColor: bgColor, color: primaryColor, - fontFamily: 'Roboto', padding: '48px', + ...pageFontStyles }, title: { - fontSize: 36, - width: '100%', - letterSpacing: 3, - textTransform: 'uppercase' + ...titleStyles }, divider: { width: '100%', @@ -38,8 +34,7 @@ const styles = StyleSheet.create({ marginBottom: 24 }, subtitle: { - width: '100%', - fontSize: '24px', + ...subtitleStyles, marginBottom: 24 }, }); @@ -55,10 +50,9 @@ export const Slide13: ReactFCC = (props) => { Контакты - {Object.entries(links).map(([name, link], index) => ( + {links && Object.entries(links).map(([name, link], index) => ( {`${name}: ${link}`} - {/*{text as string}*/} ))} diff --git a/src/pages/deck/document/slides/Slide2.tsx b/src/pages/deck/document/slides/Slide2.tsx index 19cae93..84b7382 100644 --- a/src/pages/deck/document/slides/Slide2.tsx +++ b/src/pages/deck/document/slides/Slide2.tsx @@ -1,6 +1,6 @@ import {ReactFCC} from '../../../../utils/ReactFCC'; import {Page, StyleSheet, Text, View} from '@react-pdf/renderer'; -import {bgColor, primaryColor} from '../shared'; +import {bgColor, pageFontStyles, primaryColor, titleStyles} from '../shared'; import {GetDeckResponse} from '../../../../api/deck/getDeck'; import {ExtractArray} from '../../../../utils/types'; @@ -15,14 +15,11 @@ const styles = StyleSheet.create({ alignItems: 'stretch', backgroundColor: bgColor, color: primaryColor, - fontFamily: 'Roboto', padding: '48px', + ...pageFontStyles }, title: { - fontSize: 36, - width: '100%', - letterSpacing: 3, - textTransform: 'uppercase' + ...titleStyles }, divider: { width: '100%', @@ -32,7 +29,6 @@ const styles = StyleSheet.create({ }, text: { width: '100%', - fontSize: '20px', }, }); diff --git a/src/pages/deck/document/slides/Slide3.tsx b/src/pages/deck/document/slides/Slide3.tsx index 5016693..1612e1c 100644 --- a/src/pages/deck/document/slides/Slide3.tsx +++ b/src/pages/deck/document/slides/Slide3.tsx @@ -1,13 +1,16 @@ import {ReactFCC} from '../../../../utils/ReactFCC'; -import {Page, StyleSheet, Text, View} from '@react-pdf/renderer'; -import {bgColor, primaryColor} from '../shared'; +import {Image, Page, StyleSheet, Text, View} from '@react-pdf/renderer'; +import {bgColor, pageFontStyles, primaryColor, secondaryColor, titleStyles} from '../shared'; import {GetDeckResponse} from '../../../../api/deck/getDeck'; import {ExtractArray} from '../../../../utils/types'; export interface SlideProps { data: ExtractArray['data']; + image?: string; } +const percentOffset = 55; + const styles = StyleSheet.create({ page: { display: 'flex', @@ -15,14 +18,11 @@ const styles = StyleSheet.create({ alignItems: 'stretch', backgroundColor: bgColor, color: primaryColor, - fontFamily: 'Roboto', padding: '48px', + ...pageFontStyles, }, title: { - fontSize: 36, - width: '100%', - letterSpacing: 3, - textTransform: 'uppercase' + ...titleStyles, }, divider: { width: '100%', @@ -32,22 +32,37 @@ const styles = StyleSheet.create({ }, text: { width: '100%', - fontSize: '20px', }, + imageContainer: { + position: 'absolute', + top: 48, + right: 20, + padding: '10px 20px', + border: `1px solid ${secondaryColor}` + }, + image: { + width: 300, + height: 300, + objectFit: 'contain' + } }); export const Slide3: ReactFCC = (props) => { - const { data } = props; + const { data, image } = props; const actuality = data.find((i) => i.slug === 'actuality')?.answer as string; return ( - - Описание и ценностное предложение стартапа - - {actuality} - + Описание и ценность + + {actuality} + + {image && ( + + + + )} ) } \ No newline at end of file diff --git a/src/pages/deck/document/slides/Slide4.tsx b/src/pages/deck/document/slides/Slide4.tsx index 1ca2f22..811d61a 100644 --- a/src/pages/deck/document/slides/Slide4.tsx +++ b/src/pages/deck/document/slides/Slide4.tsx @@ -1,13 +1,16 @@ import {ReactFCC} from '../../../../utils/ReactFCC'; -import {Page, StyleSheet, Text, View} from '@react-pdf/renderer'; -import {bgColor, primaryColor} from '../shared'; +import {Image, Page, StyleSheet, Text, View} from '@react-pdf/renderer'; +import {bgColor, pageFontStyles, primaryColor, secondaryColor, titleStyles} from '../shared'; import {GetDeckResponse} from '../../../../api/deck/getDeck'; import {ExtractArray} from '../../../../utils/types'; export interface SlideProps { data: ExtractArray['data']; + image?: string; } +const percentOffset = 70; + const styles = StyleSheet.create({ page: { display: 'flex', @@ -15,14 +18,11 @@ const styles = StyleSheet.create({ alignItems: 'stretch', backgroundColor: bgColor, color: primaryColor, - fontFamily: 'Roboto', padding: '48px', + ...pageFontStyles }, title: { - fontSize: 36, - width: '100%', - letterSpacing: 3, - textTransform: 'uppercase' + ...titleStyles }, divider: { width: '100%', @@ -35,22 +35,38 @@ const styles = StyleSheet.create({ fontSize: '20px', marginBottom: 24 }, + imageContainer: { + position: 'absolute', + top: 48, + right: 20, + padding: '10px 20px', + border: `1px solid ${secondaryColor}` + }, + image: { + width: 200, + height: 200, + objectFit: 'contain' + } }); export const Slide4: ReactFCC = (props) => { - const { data } = props; + const { data, image } = props; const solve = data.find((i) => i.slug === 'solve')?.answer as string; const works = data.find((i) => i.slug === 'works')?.answer as string; return ( - - Решение - - {solve} - {works} - + Решение + + {solve} + {works} + + {image && ( + + + + )} ) } \ No newline at end of file diff --git a/src/pages/deck/document/slides/Slide5.tsx b/src/pages/deck/document/slides/Slide5.tsx index 7a07405..f77e003 100644 --- a/src/pages/deck/document/slides/Slide5.tsx +++ b/src/pages/deck/document/slides/Slide5.tsx @@ -1,6 +1,6 @@ import {ReactFCC} from '../../../../utils/ReactFCC'; import {Image, Page, StyleSheet, Text, View} from '@react-pdf/renderer'; -import {bgColor, primaryColor} from '../shared'; +import {bgColor, pageFontStyles, primaryColor, titleStyles} from '../shared'; import {GetDeckResponse} from '../../../../api/deck/getDeck'; import {ExtractArray} from '../../../../utils/types'; @@ -16,14 +16,11 @@ const styles = StyleSheet.create({ alignItems: 'stretch', backgroundColor: bgColor, color: primaryColor, - fontFamily: 'Roboto', padding: '48px', + ...pageFontStyles, }, title: { - fontSize: 36, - width: '100%', - letterSpacing: 3, - textTransform: 'uppercase' + ...titleStyles }, divider: { width: '100%', diff --git a/src/pages/deck/document/slides/Slide6.tsx b/src/pages/deck/document/slides/Slide6.tsx index 6232add..2dd99c9 100644 --- a/src/pages/deck/document/slides/Slide6.tsx +++ b/src/pages/deck/document/slides/Slide6.tsx @@ -1,6 +1,6 @@ import {ReactFCC} from '../../../../utils/ReactFCC'; import {Image, Page, StyleSheet, Text, View} from '@react-pdf/renderer'; -import {bgColor, primaryColor} from '../shared'; +import {bgColor, pageFontStyles, primaryColor, subtitleStyles, titleStyles} from '../shared'; import {GetDeckResponse} from '../../../../api/deck/getDeck'; import {ExtractArray} from '../../../../utils/types'; @@ -15,14 +15,11 @@ const styles = StyleSheet.create({ alignItems: 'stretch', backgroundColor: bgColor, color: primaryColor, - fontFamily: 'Roboto', padding: '48px', + ...pageFontStyles, }, title: { - fontSize: 36, - width: '100%', - letterSpacing: 3, - textTransform: 'uppercase' + ...titleStyles }, divider: { width: '100%', @@ -36,8 +33,7 @@ const styles = StyleSheet.create({ marginBottom: 24 }, subtitle: { - width: '100%', - fontSize: '24px', + ...subtitleStyles }, }); diff --git a/src/pages/deck/document/slides/Slide7.tsx b/src/pages/deck/document/slides/Slide7.tsx index 8d6ef31..e28811c 100644 --- a/src/pages/deck/document/slides/Slide7.tsx +++ b/src/pages/deck/document/slides/Slide7.tsx @@ -1,6 +1,6 @@ import {ReactFCC} from '../../../../utils/ReactFCC'; import {Image, Page, StyleSheet, Text, View} from '@react-pdf/renderer'; -import {bgColor, primaryColor} from '../shared'; +import {bgColor, pageFontStyles, primaryColor, subtitleStyles, titleStyles} from '../shared'; import {GetDeckResponse} from '../../../../api/deck/getDeck'; import {ExtractArray} from '../../../../utils/types'; @@ -15,14 +15,11 @@ const styles = StyleSheet.create({ alignItems: 'stretch', backgroundColor: bgColor, color: primaryColor, - fontFamily: 'Roboto', padding: '48px', + ...pageFontStyles, }, title: { - fontSize: 36, - width: '100%', - letterSpacing: 3, - textTransform: 'uppercase' + ...titleStyles }, divider: { width: '100%', @@ -36,8 +33,7 @@ const styles = StyleSheet.create({ marginBottom: 24 }, subtitle: { - width: '100%', - fontSize: '24px', + ...subtitleStyles }, }); diff --git a/src/pages/deck/document/slides/Slide8.tsx b/src/pages/deck/document/slides/Slide8.tsx index dcd0033..6583265 100644 --- a/src/pages/deck/document/slides/Slide8.tsx +++ b/src/pages/deck/document/slides/Slide8.tsx @@ -1,8 +1,9 @@ import {ReactFCC} from '../../../../utils/ReactFCC'; import {Image, Page, StyleSheet, Text, View} from '@react-pdf/renderer'; -import {bgColor, primaryColor} from '../shared'; +import {bgColor, pageFontStyles, primaryColor, subtitleStyles, titleStyles} from '../shared'; import {GetDeckResponse} from '../../../../api/deck/getDeck'; import {ExtractArray} from '../../../../utils/types'; +import {currencyFormatter} from '../../../../utils/fomat'; export interface Slide8Props { data: ExtractArray['data']; @@ -16,14 +17,11 @@ const styles = StyleSheet.create({ alignItems: 'stretch', backgroundColor: bgColor, color: primaryColor, - fontFamily: 'Roboto', padding: '48px', + ...pageFontStyles }, title: { - fontSize: 36, - width: '100%', - letterSpacing: 3, - textTransform: 'uppercase' + ...titleStyles }, divider: { width: '100%', @@ -31,6 +29,9 @@ const styles = StyleSheet.create({ backgroundColor: primaryColor, margin: '8px 0 16px' }, + subtitle: { + ...subtitleStyles + }, text: { width: '100%', fontSize: '20px', @@ -55,6 +56,11 @@ export const Slide8: ReactFCC = (props) => { Финансы + + Уже получено инвестиций + {currencyFormatter.format(how_much_investments)}р. + + Финансовые индикаторы {financial_indicators} diff --git a/src/pages/deck/document/slides/Slide9.tsx b/src/pages/deck/document/slides/Slide9.tsx index 0551071..b8c0d88 100644 --- a/src/pages/deck/document/slides/Slide9.tsx +++ b/src/pages/deck/document/slides/Slide9.tsx @@ -1,8 +1,9 @@ import {ReactFCC} from '../../../../utils/ReactFCC'; import {Image, Page, StyleSheet, Text, View} from '@react-pdf/renderer'; -import {bgColor, primaryColor} from '../shared'; +import {bgColor, pageFontStyles, primaryColor, secondaryColor, titleStyles} from '../shared'; import {GetDeckResponse} from '../../../../api/deck/getDeck'; import {ExtractArray} from '../../../../utils/types'; +import {BACKEND_URL} from '../../../../config'; export interface Slide9Props { data: ExtractArray['data']; @@ -15,14 +16,11 @@ const styles = StyleSheet.create({ alignItems: 'stretch', backgroundColor: bgColor, color: primaryColor, - fontFamily: 'Roboto', padding: '48px', + ...pageFontStyles, }, title: { - fontSize: 36, - width: '100%', - letterSpacing: 3, - textTransform: 'uppercase' + ...titleStyles }, divider: { width: '100%', @@ -32,23 +30,54 @@ const styles = StyleSheet.create({ }, text: { width: '100%', - fontSize: '20px', - marginBottom: 24 + fontSize: '16px', }, + map: { + display: 'flex', + flexDirection: 'row', + flexWrap: 'wrap', + gap: 24, + marginTop: 16 + }, + item: { + display: 'flex', + flexDirection: 'column', + gap: 16, + }, + image: { + width: 200, + height: 150, + objectFit: 'cover' + } }); export const Slide9: ReactFCC = (props) => { const { data } = props; - // const how_much_investments = data.find((i) => i.slug === 'how_much_investments')?.answer as any; - // const users_metrics = data.find((i) => i.slug === 'users_metrics')?.answer as any; + const your_role = data.find((i) => i.slug === 'your_role') as any; + const url = your_role?.photos?.[0]; + const your_teammates = data.find((i) => i.slug === 'your_teammates') as any; return ( Команда - {/**/} - {/*{how_much_investments}*/} + + + + {your_teammates && your_teammates.answer?.map((i: any, index: number) => { + const url = your_teammates?.photos?.[index]; + + return ( + + {url && ( + + )} + {i} + + ) + })} + )