Used the new getChatWidth function in ChatForm
This commit is contained in:
parent
33d8d0f461
commit
dccfcc02eb
|
|
@ -7,7 +7,7 @@
|
||||||
ChatFormHelperText,
|
ChatFormHelperText,
|
||||||
ChatFormTextarea
|
ChatFormTextarea
|
||||||
} from '$lib/components/app';
|
} from '$lib/components/app';
|
||||||
import { MAX_WIDTH_CLASSES, DEFAULT_MAX_WIDTH_CLASS } from '$lib/constants/width-classes';
|
import { getChatWidth } from '$lib/utils/chat-width';
|
||||||
import { INPUT_CLASSES } from '$lib/constants/input-classes';
|
import { INPUT_CLASSES } from '$lib/constants/input-classes';
|
||||||
import { config } from '$lib/stores/settings.svelte';
|
import { config } from '$lib/stores/settings.svelte';
|
||||||
import { FileTypeCategory, MimeTypeApplication } from '$lib/enums/files';
|
import { FileTypeCategory, MimeTypeApplication } from '$lib/enums/files';
|
||||||
|
|
@ -63,8 +63,8 @@
|
||||||
let previousIsLoading = $state(isLoading);
|
let previousIsLoading = $state(isLoading);
|
||||||
let recordingSupported = $state(false);
|
let recordingSupported = $state(false);
|
||||||
let textareaRef: ChatFormTextarea | undefined = $state(undefined);
|
let textareaRef: ChatFormTextarea | undefined = $state(undefined);
|
||||||
let maxWidthClass = $derived(
|
let widthConfig = $derived(
|
||||||
currentConfig.responsiveChatWidth ? MAX_WIDTH_CLASSES : DEFAULT_MAX_WIDTH_CLASS
|
getChatWidth(currentConfig.autoChatWidth, currentConfig.customChatWidth)
|
||||||
);
|
);
|
||||||
|
|
||||||
function getAcceptStringForFileType(fileType: FileTypeCategory): string {
|
function getAcceptStringForFileType(fileType: FileTypeCategory): string {
|
||||||
|
|
@ -234,7 +234,8 @@
|
||||||
|
|
||||||
<form
|
<form
|
||||||
onsubmit={handleSubmit}
|
onsubmit={handleSubmit}
|
||||||
class="{INPUT_CLASSES} border-radius-bottom-none mx-auto {maxWidthClass} overflow-hidden rounded-3xl backdrop-blur-md {className}"
|
class="{INPUT_CLASSES} border-radius-bottom-none mx-auto {widthConfig.class} overflow-hidden rounded-3xl backdrop-blur-md {className}"
|
||||||
|
style={widthConfig.style}
|
||||||
>
|
>
|
||||||
<ChatAttachmentsList
|
<ChatAttachmentsList
|
||||||
bind:uploadedFiles
|
bind:uploadedFiles
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue