fix: starter screen layout (#4279)
This commit is contained in:
parent
a3b3287327
commit
0164db2139
@ -18,19 +18,24 @@ import {
|
|||||||
} from '@/helpers/atoms/App.atom'
|
} from '@/helpers/atoms/App.atom'
|
||||||
import { reduceTransparentAtom } from '@/helpers/atoms/Setting.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 reduceTransparent = useAtomValue(reduceTransparentAtom)
|
||||||
const matches = useMediaQuery('(max-width: 880px)')
|
const matches = useMediaQuery('(max-width: 880px)')
|
||||||
const showLeftPanel = useAtomValue(showLeftPanelAtom)
|
const showLeftPanel = useAtomValue(showLeftPanelAtom)
|
||||||
const showRightPanel = useAtomValue(showRightPanelAtom)
|
const showRightPanel = useAtomValue(showRightPanelAtom)
|
||||||
const mainViewState = useAtomValue(mainViewStateAtom)
|
const mainViewState = useAtomValue(mainViewStateAtom)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={twMerge('flex h-full w-full')}
|
className={twMerge('flex h-full w-full')}
|
||||||
style={{
|
style={{
|
||||||
maxWidth: matches
|
maxWidth: matches
|
||||||
? '100%'
|
? '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))`
|
? `calc(100% - (${showRightPanel ? Number(localStorage.getItem(RIGHT_PANEL_WIDTH)) : 0}px + ${showLeftPanel ? Number(localStorage.getItem(LEFT_PANEL_WIDTH)) : 0}px))`
|
||||||
: '100%',
|
: '100%',
|
||||||
}}
|
}}
|
||||||
|
|||||||
@ -40,7 +40,11 @@ import {
|
|||||||
} from '@/helpers/atoms/Model.atom'
|
} from '@/helpers/atoms/Model.atom'
|
||||||
import { selectedSettingAtom } from '@/helpers/atoms/Setting.atom'
|
import { selectedSettingAtom } from '@/helpers/atoms/Setting.atom'
|
||||||
|
|
||||||
const OnDeviceStarterScreen = () => {
|
type Props = {
|
||||||
|
isShowStarterScreen?: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
const OnDeviceStarterScreen = ({ isShowStarterScreen }: Props) => {
|
||||||
const { extensionHasSettings } = useStarterScreen()
|
const { extensionHasSettings } = useStarterScreen()
|
||||||
const [searchValue, setSearchValue] = useState('')
|
const [searchValue, setSearchValue] = useState('')
|
||||||
const [isOpen, setIsOpen] = useState(Boolean(searchValue.length))
|
const [isOpen, setIsOpen] = useState(Boolean(searchValue.length))
|
||||||
@ -103,7 +107,7 @@ const OnDeviceStarterScreen = () => {
|
|||||||
const [visibleRows, setVisibleRows] = useState(1)
|
const [visibleRows, setVisibleRows] = useState(1)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<CenterPanelContainer>
|
<CenterPanelContainer isShowStarterScreen={isShowStarterScreen}>
|
||||||
<ScrollArea className="flex h-full w-full items-center">
|
<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="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">
|
<div className="mx-auto flex h-full w-3/4 flex-col items-center justify-center py-16 text-center">
|
||||||
|
|||||||
@ -17,7 +17,7 @@ type Props = {
|
|||||||
|
|
||||||
const ThreadPanels = memo(({ isShowStarterScreen }: Props) => {
|
const ThreadPanels = memo(({ isShowStarterScreen }: Props) => {
|
||||||
return isShowStarterScreen ? (
|
return isShowStarterScreen ? (
|
||||||
<OnDeviceStarterScreen />
|
<OnDeviceStarterScreen isShowStarterScreen={isShowStarterScreen} />
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<ThreadLeftPanel />
|
<ThreadLeftPanel />
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user