mirror of
https://github.com/spbleadersofdigtal/frontend.git
synced 2024-11-25 03:33:44 +03:00
еще раз доделал
This commit is contained in:
parent
38a38eeb40
commit
a0680fe274
|
@ -73,14 +73,17 @@ $button-border-width: 2px;
|
||||||
|
|
||||||
.Button_size_small {
|
.Button_size_small {
|
||||||
height: 32px;
|
height: 32px;
|
||||||
|
min-height: 32px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.Button_size_medium {
|
.Button_size_medium {
|
||||||
height: 40px;
|
height: 40px;
|
||||||
|
min-height: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.Button_size_large {
|
.Button_size_large {
|
||||||
height: 48px;
|
height: 48px;
|
||||||
|
min-height: 48px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.Button_variant_primary {
|
.Button_variant_primary {
|
||||||
|
|
|
@ -12,11 +12,11 @@ export interface HintProps {
|
||||||
* Дополнительный css-класс
|
* Дополнительный css-класс
|
||||||
*/
|
*/
|
||||||
className?: string;
|
className?: string;
|
||||||
children: string;
|
// children: string;
|
||||||
onClick?: () => void;
|
onClick?: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Hint: FC<HintProps> = (props) => {
|
export const Hint: ReactFCC<HintProps> = (props) => {
|
||||||
const {children, className, onClick: onClickProp} = props;
|
const {children, className, onClick: onClickProp} = props;
|
||||||
|
|
||||||
const isMobile = useIsMobile();
|
const isMobile = useIsMobile();
|
||||||
|
|
|
@ -57,7 +57,6 @@ const InputForwardedRef = React.forwardRef<HTMLDivElement, InputProps>(
|
||||||
inputRef: inputRefProp,
|
inputRef: inputRefProp,
|
||||||
style,
|
style,
|
||||||
type,
|
type,
|
||||||
value,
|
|
||||||
registration,
|
registration,
|
||||||
...inputProps
|
...inputProps
|
||||||
},
|
},
|
||||||
|
|
|
@ -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 = 'http://192.168.22.4:8000/api';
|
||||||
|
export const API_URL = 'https://ed68-77-234-219-9.ngrok-free.app/api';
|
|
@ -51,6 +51,10 @@
|
||||||
backdrop-filter: blur(10px);
|
backdrop-filter: blur(10px);
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
@include flex-col;
|
@include flex-col;
|
||||||
|
|
||||||
|
max-height: 100svh;
|
||||||
|
overflow-y: auto;
|
||||||
|
@include scrollbar;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ChatPage__skipButton {
|
.ChatPage__skipButton {
|
||||||
|
|
|
@ -26,8 +26,8 @@ export interface ChatPageProps {
|
||||||
|
|
||||||
const QUESTION_POLLING_MS = 1000;
|
const QUESTION_POLLING_MS = 1000;
|
||||||
|
|
||||||
const DEFAULT_DECK_ID = 0;
|
const DEFAULT_DECK_ID = 65;
|
||||||
const DEFAULT_QUESTION_ID = 0;
|
const DEFAULT_QUESTION_ID = 32;
|
||||||
|
|
||||||
export const ChatPage: ReactFCC<ChatPageProps> = (props) => {
|
export const ChatPage: ReactFCC<ChatPageProps> = (props) => {
|
||||||
const {className} = props;
|
const {className} = props;
|
||||||
|
|
|
@ -31,7 +31,14 @@ export const ChatFormMultipleDateDescription: ReactFCC<ChatFormMultipleDateDescr
|
||||||
{hint && hint.value && (
|
{hint && hint.value && (
|
||||||
<HintCmp
|
<HintCmp
|
||||||
className={s.ChatFormMultipleDateDescription__hint}
|
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')}
|
{Object.entries(hint.value).map(([key, val]) => `${formatDate(key)}: ${val}`).join('\n')}
|
||||||
</HintCmp>
|
</HintCmp>
|
||||||
|
@ -42,7 +49,9 @@ export const ChatFormMultipleDateDescription: ReactFCC<ChatFormMultipleDateDescr
|
||||||
{Object.entries(value).map(([date, text]: any, index, { length: arrLength }) => {
|
{Object.entries(value).map(([date, text]: any, index, { length: arrLength }) => {
|
||||||
return (
|
return (
|
||||||
<div className={s.ChatFormMultipleDateDescription__group} key={index}>
|
<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) => {
|
onChange={(e) => {
|
||||||
const newValue = { ...value };
|
const newValue = { ...value };
|
||||||
const text = newValue[date];
|
const text = newValue[date];
|
||||||
|
|
|
@ -28,8 +28,8 @@ export const ChatFormText: ReactFCC<ChatFormTextProps> = (props) => {
|
||||||
<HintsContainer isLoading={hint && !hint.value}>
|
<HintsContainer isLoading={hint && !hint.value}>
|
||||||
{hint && hint.value && (
|
{hint && hint.value && (
|
||||||
<>{Array.isArray(hint.value) ? hint.type === EntityType.cards ? (
|
<>{Array.isArray(hint.value) ? hint.type === EntityType.cards ? (
|
||||||
<HintCmp onClick={() => setValue(hint.value.map((i: any) => i.description).join('\n\n'))}>
|
<HintCmp onClick={() => setValue(hint.value.map((i: any) => i.name).join(', '))}>
|
||||||
{hint.value.map((i) => i.description).join('\n')}
|
{hint.value.map((i, index, { length: arrLength }) => <span title={i.description}>{i.name}{index !== arrLength - 1 && ', '}</span>)}
|
||||||
</HintCmp>
|
</HintCmp>
|
||||||
) : hint.value.map((item: string, index: number) => (
|
) : hint.value.map((item: string, index: number) => (
|
||||||
<HintCmp onClick={() => setValue(item)} key={index}>{item}</HintCmp>
|
<HintCmp onClick={() => setValue(item)} key={index}>{item}</HintCmp>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user