еще раз доделал

This commit is contained in:
Pavel Torbeev 2023-08-26 18:56:28 +03:00
parent 38a38eeb40
commit a0680fe274
8 changed files with 27 additions and 11 deletions

View File

@ -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 {

View File

@ -12,11 +12,11 @@ export interface HintProps {
* Дополнительный css-класс
*/
className?: string;
children: string;
// children: string;
onClick?: () => void;
}
export const Hint: FC<HintProps> = (props) => {
export const Hint: ReactFCC<HintProps> = (props) => {
const {children, className, onClick: onClickProp} = props;
const isMobile = useIsMobile();

View File

@ -57,7 +57,6 @@ const InputForwardedRef = React.forwardRef<HTMLDivElement, InputProps>(
inputRef: inputRefProp,
style,
type,
value,
registration,
...inputProps
},

View File

@ -1,2 +1,3 @@
export const API_URL = 'http://192.168.83.181:8000/api';
// 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';

View File

@ -51,6 +51,10 @@
backdrop-filter: blur(10px);
z-index: 2;
@include flex-col;
max-height: 100svh;
overflow-y: auto;
@include scrollbar;
}
.ChatPage__skipButton {

View File

@ -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<ChatPageProps> = (props) => {
const {className} = props;

View File

@ -31,7 +31,14 @@ export const ChatFormMultipleDateDescription: ReactFCC<ChatFormMultipleDateDescr
{hint && hint.value && (
<HintCmp
className={s.ChatFormMultipleDateDescription__hint}
onClick={() => 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')}
</HintCmp>
@ -42,7 +49,9 @@ export const ChatFormMultipleDateDescription: ReactFCC<ChatFormMultipleDateDescr
{Object.entries(value).map(([date, text]: any, index, { length: arrLength }) => {
return (
<div className={s.ChatFormMultipleDateDescription__group} key={index}>
<Input className={s.ChatFormMultipleDateDescription__input} type={'date'} value={format(new Date(date),'yyyy-MM-dd')}
<Input className={s.ChatFormMultipleDateDescription__input}
type={'date'}
value={format(new Date(date),'yyyy-MM-dd')}
onChange={(e) => {
const newValue = { ...value };
const text = newValue[date];

View File

@ -28,8 +28,8 @@ export const ChatFormText: ReactFCC<ChatFormTextProps> = (props) => {
<HintsContainer isLoading={hint && !hint.value}>
{hint && hint.value && (
<>{Array.isArray(hint.value) ? hint.type === EntityType.cards ? (
<HintCmp onClick={() => setValue(hint.value.map((i: any) => i.description).join('\n\n'))}>
{hint.value.map((i) => i.description).join('\n')}
<HintCmp onClick={() => setValue(hint.value.map((i: any) => i.name).join(', '))}>
{hint.value.map((i, index, { length: arrLength }) => <span title={i.description}>{i.name}{index !== arrLength - 1 && ', '}</span>)}
</HintCmp>
) : hint.value.map((item: string, index: number) => (
<HintCmp onClick={() => setValue(item)} key={index}>{item}</HintCmp>