Skip to content

Commit cc3ee4f

Browse files
committed
fix: remove 100vh, fix mobile layout bug
1 parent d7f44cd commit cc3ee4f

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

src/components/Send.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { addConversation, conversationMap, currentConversationId } from '@/store
66
import { loadingStateMap, streamsMap } from '@/stores/streams'
77
import { handlePrompt } from '@/logics/conversation'
88
import { globalAbortController } from '@/stores/settings'
9-
import { useI18n, useMobileScreen } from '@/hooks'
9+
import { useI18n } from '@/hooks'
1010
import Button from './ui/Button'
1111

1212
export default () => {
@@ -21,7 +21,6 @@ export default () => {
2121
const $globalAbortController = useStore(globalAbortController)
2222

2323
const [inputPrompt, setInputPrompt] = createSignal('')
24-
const [footerClass, setFooterClass] = createSignal('')
2524
const isEditing = () => inputPrompt() || $isSendBoxFocus()
2625
const currentConversation = () => {
2726
return $conversationMap()[$currentConversationId()]
@@ -33,10 +32,6 @@ export default () => {
3332
createShortcut(['Control', 'Enter'], () => {
3433
$isSendBoxFocus() && handleSend()
3534
})
36-
37-
useMobileScreen(() => {
38-
setFooterClass('sticky bottom-0 left-0 right-0 overflow-hidden')
39-
})
4035
})
4136

4237
const stateType = () => {
@@ -172,7 +167,7 @@ export default () => {
172167
}
173168

174169
return (
175-
<div class={`relative shrink-0 border-t border-base pb-[env(safe-area-inset-bottom)] transition transition-colors duration-300 ${stateRootClass()} ${footerClass()}`}>
170+
<div class={`sticky bottom-0 left-0 right-0 overflow-hidden shrink-0 border-t border-base pb-[env(safe-area-inset-bottom)] transition transition-colors duration-300 ${stateRootClass()}`}>
176171
<div class={`relative transition transition-height duration-240 ${stateHeightClass()}`}>
177172
<Switch fallback={<EmptyState />}>
178173
<Match when={stateType() === 'error'}>

src/pages/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import BuildStores from '@/components/client-only/BuildStores'
99
---
1010

1111
<Layout title="Anse">
12-
<div class="h-100vh w-screen flex">
12+
<div class="h-full w-screen flex">
1313
<Sidebar direction="left" class="hidden md:block">
1414
<ConversationSidebar client:only />
1515
</Sidebar>

unocss.config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ export default defineConfig({
8888
--c-shadow: #00000008;
8989
}
9090
91+
html,body {
92+
height: 100%;
93+
}
94+
9195
html.dark {
9296
--c-scroll: #333333;
9397
--c-scroll-hover: #555555;

0 commit comments

Comments
 (0)