Skip to content

Commit

Permalink
fix: remove 100vh, fix mobile layout bug
Browse files Browse the repository at this point in the history
  • Loading branch information
yzh990918 committed Jun 20, 2023
1 parent d7f44cd commit cc3ee4f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
9 changes: 2 additions & 7 deletions src/components/Send.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { addConversation, conversationMap, currentConversationId } from '@/store
import { loadingStateMap, streamsMap } from '@/stores/streams'
import { handlePrompt } from '@/logics/conversation'
import { globalAbortController } from '@/stores/settings'
import { useI18n, useMobileScreen } from '@/hooks'
import { useI18n } from '@/hooks'
import Button from './ui/Button'

export default () => {
Expand All @@ -21,7 +21,6 @@ export default () => {
const $globalAbortController = useStore(globalAbortController)

const [inputPrompt, setInputPrompt] = createSignal('')
const [footerClass, setFooterClass] = createSignal('')
const isEditing = () => inputPrompt() || $isSendBoxFocus()
const currentConversation = () => {
return $conversationMap()[$currentConversationId()]
Expand All @@ -33,10 +32,6 @@ export default () => {
createShortcut(['Control', 'Enter'], () => {
$isSendBoxFocus() && handleSend()
})

useMobileScreen(() => {
setFooterClass('sticky bottom-0 left-0 right-0 overflow-hidden')
})
})

const stateType = () => {
Expand Down Expand Up @@ -172,7 +167,7 @@ export default () => {
}

return (
<div class={`relative shrink-0 border-t border-base pb-[env(safe-area-inset-bottom)] transition transition-colors duration-300 ${stateRootClass()} ${footerClass()}`}>
<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()}`}>
<div class={`relative transition transition-height duration-240 ${stateHeightClass()}`}>
<Switch fallback={<EmptyState />}>
<Match when={stateType() === 'error'}>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import BuildStores from '@/components/client-only/BuildStores'
---

<Layout title="Anse">
<div class="h-100vh w-screen flex">
<div class="h-full w-screen flex">
<Sidebar direction="left" class="hidden md:block">
<ConversationSidebar client:only />
</Sidebar>
Expand Down
4 changes: 4 additions & 0 deletions unocss.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ export default defineConfig({
--c-shadow: #00000008;
}
html,body {
height: 100%;
}
html.dark {
--c-scroll: #333333;
--c-scroll-hover: #555555;
Expand Down

0 comments on commit cc3ee4f

Please sign in to comment.