Skip to content

Commit

Permalink
fix: starter screen layout
Browse files Browse the repository at this point in the history
  • Loading branch information
urmauur committed Dec 17, 2024
1 parent c166f7c commit 15ffb52
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
9 changes: 7 additions & 2 deletions web/containers/CenterPanelContainer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,24 @@ import {
} from '@/helpers/atoms/App.atom'
import { reduceTransparentAtom } from '@/helpers/atoms/Setting.atom'

const CenterPanelContainer = ({ children }: PropsWithChildren) => {
type Props = {
isShowStarterScreen?: boolean
} & PropsWithChildren

const CenterPanelContainer = ({ children, isShowStarterScreen }: Props) => {
const reduceTransparent = useAtomValue(reduceTransparentAtom)
const matches = useMediaQuery('(max-width: 880px)')
const showLeftPanel = useAtomValue(showLeftPanelAtom)
const showRightPanel = useAtomValue(showRightPanelAtom)
const mainViewState = useAtomValue(mainViewStateAtom)

return (
<div
className={twMerge('flex h-full w-full')}
style={{
maxWidth: matches
? '100%'
: mainViewState === MainViewState.Thread
: mainViewState === MainViewState.Thread && !isShowStarterScreen
? `calc(100% - (${showRightPanel ? Number(localStorage.getItem(RIGHT_PANEL_WIDTH)) : 0}px + ${showLeftPanel ? Number(localStorage.getItem(LEFT_PANEL_WIDTH)) : 0}px))`
: '100%',
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ import {
} from '@/helpers/atoms/Model.atom'
import { selectedSettingAtom } from '@/helpers/atoms/Setting.atom'

const OnDeviceStarterScreen = () => {
type Props = {
isShowStarterScreen?: boolean
}

const OnDeviceStarterScreen = ({ isShowStarterScreen }: Props) => {
const { extensionHasSettings } = useStarterScreen()
const [searchValue, setSearchValue] = useState('')
const [isOpen, setIsOpen] = useState(Boolean(searchValue.length))
Expand Down Expand Up @@ -103,7 +107,7 @@ const OnDeviceStarterScreen = () => {
const [visibleRows, setVisibleRows] = useState(1)

return (
<CenterPanelContainer>
<CenterPanelContainer isShowStarterScreen={isShowStarterScreen}>
<ScrollArea className="flex h-full w-full items-center">
<div className="relative mt-4 flex h-full w-full flex-col items-center justify-center">
<div className="mx-auto flex h-full w-3/4 flex-col items-center justify-center py-16 text-center">
Expand Down
2 changes: 1 addition & 1 deletion web/screens/Thread/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type Props = {

const ThreadPanels = memo(({ isShowStarterScreen }: Props) => {
return isShowStarterScreen ? (
<OnDeviceStarterScreen />
<OnDeviceStarterScreen isShowStarterScreen={isShowStarterScreen} />
) : (
<>
<ThreadLeftPanel />
Expand Down

0 comments on commit 15ffb52

Please sign in to comment.