From a0680fe27498ace1d0916c909491551500bd69bd Mon Sep 17 00:00:00 2001 From: Pavel Torbeev Date: Sat, 26 Aug 2023 18:56:28 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B5=D1=89=D0=B5=20=D1=80=D0=B0=D0=B7=20?= =?UTF-8?q?=D0=B4=D0=BE=D0=B4=D0=B5=D0=BB=D0=B0=D0=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Button/Button.module.scss | 3 +++ src/components/Hint/Hint.tsx | 4 ++-- src/components/Input/Input.tsx | 1 - src/config.ts | 5 +++-- src/pages/chat/ChatPage.module.scss | 4 ++++ src/pages/chat/ChatPage.tsx | 4 ++-- .../ChatFormMultipleDateDescription.tsx | 13 +++++++++++-- .../components/ChatFormText/ChatFormText.tsx | 4 ++-- 8 files changed, 27 insertions(+), 11 deletions(-) diff --git a/src/components/Button/Button.module.scss b/src/components/Button/Button.module.scss index 41e8167..5e44b86 100644 --- a/src/components/Button/Button.module.scss +++ b/src/components/Button/Button.module.scss @@ -73,14 +73,17 @@ $button-border-width: 2px; .Button_size_small { height: 32px; + min-height: 32px; } .Button_size_medium { height: 40px; + min-height: 40px; } .Button_size_large { height: 48px; + min-height: 48px; } .Button_variant_primary { diff --git a/src/components/Hint/Hint.tsx b/src/components/Hint/Hint.tsx index 200732c..e85b908 100644 --- a/src/components/Hint/Hint.tsx +++ b/src/components/Hint/Hint.tsx @@ -12,11 +12,11 @@ export interface HintProps { * Дополнительный css-класс */ className?: string; - children: string; + // children: string; onClick?: () => void; } -export const Hint: FC = (props) => { +export const Hint: ReactFCC = (props) => { const {children, className, onClick: onClickProp} = props; const isMobile = useIsMobile(); diff --git a/src/components/Input/Input.tsx b/src/components/Input/Input.tsx index b91dc7a..f65c4fb 100644 --- a/src/components/Input/Input.tsx +++ b/src/components/Input/Input.tsx @@ -57,7 +57,6 @@ const InputForwardedRef = React.forwardRef( inputRef: inputRefProp, style, type, - value, registration, ...inputProps }, diff --git a/src/config.ts b/src/config.ts index d32ec8e..261c59c 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,2 +1,3 @@ -export const API_URL = 'http://192.168.83.181:8000/api'; -// export const API_URL = 'http://192.168.22.4:8000/api'; \ No newline at end of file +// 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 diff --git a/src/pages/chat/ChatPage.module.scss b/src/pages/chat/ChatPage.module.scss index 58ce3b1..6e0a1d4 100644 --- a/src/pages/chat/ChatPage.module.scss +++ b/src/pages/chat/ChatPage.module.scss @@ -51,6 +51,10 @@ backdrop-filter: blur(10px); z-index: 2; @include flex-col; + + max-height: 100svh; + overflow-y: auto; + @include scrollbar; } .ChatPage__skipButton { diff --git a/src/pages/chat/ChatPage.tsx b/src/pages/chat/ChatPage.tsx index c73de6c..576f015 100644 --- a/src/pages/chat/ChatPage.tsx +++ b/src/pages/chat/ChatPage.tsx @@ -26,8 +26,8 @@ export interface ChatPageProps { const QUESTION_POLLING_MS = 1000; -const DEFAULT_DECK_ID = 0; -const DEFAULT_QUESTION_ID = 0; +const DEFAULT_DECK_ID = 65; +const DEFAULT_QUESTION_ID = 32; export const ChatPage: ReactFCC = (props) => { const {className} = props; diff --git a/src/pages/chat/components/ChatForm/components/ChatFormMultipleDateDescription/ChatFormMultipleDateDescription.tsx b/src/pages/chat/components/ChatForm/components/ChatFormMultipleDateDescription/ChatFormMultipleDateDescription.tsx index 389fbd0..fa0cd0d 100644 --- a/src/pages/chat/components/ChatForm/components/ChatFormMultipleDateDescription/ChatFormMultipleDateDescription.tsx +++ b/src/pages/chat/components/ChatForm/components/ChatFormMultipleDateDescription/ChatFormMultipleDateDescription.tsx @@ -31,7 +31,14 @@ export const ChatFormMultipleDateDescription: ReactFCC setValue({ ...hint.value })} + onClick={() => { + const newValue: any = {}; + for (const date in hint.value) { + newValue[format(new Date(date),'yyyy-MM-dd')] = hint.value[date] + } + console.log(hint.value); + setValue({ ...hint.value }) + }} > {Object.entries(hint.value).map(([key, val]) => `${formatDate(key)}: ${val}`).join('\n')} @@ -42,7 +49,9 @@ export const ChatFormMultipleDateDescription: ReactFCC { return (
- { const newValue = { ...value }; const text = newValue[date]; diff --git a/src/pages/chat/components/ChatForm/components/ChatFormText/ChatFormText.tsx b/src/pages/chat/components/ChatForm/components/ChatFormText/ChatFormText.tsx index 6c76919..23fa3c6 100644 --- a/src/pages/chat/components/ChatForm/components/ChatFormText/ChatFormText.tsx +++ b/src/pages/chat/components/ChatForm/components/ChatFormText/ChatFormText.tsx @@ -28,8 +28,8 @@ export const ChatFormText: ReactFCC = (props) => { {hint && hint.value && ( <>{Array.isArray(hint.value) ? hint.type === EntityType.cards ? ( - setValue(hint.value.map((i: any) => i.description).join('\n\n'))}> - {hint.value.map((i) => i.description).join('\n')} + setValue(hint.value.map((i: any) => i.name).join(', '))}> + {hint.value.map((i, index, { length: arrLength }) => {i.name}{index !== arrLength - 1 && ', '})} ) : hint.value.map((item: string, index: number) => ( setValue(item)} key={index}>{item}