import React from 'react'
import {ScrollView, StyleSheet, View} from 'react-native'
import {isWeb} from '#/platform/detection'
import {useColorSchemeStyle} from 'lib/hooks/useColorSchemeStyle'
import {useIsKeyboardVisible} from 'lib/hooks/useIsKeyboardVisible'
import {usePalette} from 'lib/hooks/usePalette'
import {useWebMediaQueries} from 'lib/hooks/useWebMediaQueries'
import {atoms as a} from '#/alf'
import {Text} from '../text/Text'
export const LoggedOutLayout = ({
leadin,
title,
description,
children,
scrollable,
}: React.PropsWithChildren<{
leadin: string
title: string
description: string
scrollable?: boolean
}>) => {
const {isMobile, isTabletOrMobile} = useWebMediaQueries()
const pal = usePalette('default')
const sideBg = useColorSchemeStyle(pal.viewLight, pal.view)
const contentBg = useColorSchemeStyle(pal.view, {
backgroundColor: pal.colors.background,
borderColor: pal.colors.border,
borderLeftWidth: 1,
})
const [isKeyboardVisible] = useIsKeyboardVisible()
if (isMobile) {
if (scrollable) {
return (
{children}
)
} else {
return {children}
}
}
return (
{leadin}
{title}
{description}
{scrollable ? (
{children}
) : (
{children}
)}
)
}
const styles = StyleSheet.create({
container: {
flexDirection: 'row',
// @ts-ignore web only
height: '100vh',
},
side: {
flex: 1,
paddingHorizontal: 40,
paddingBottom: 80,
justifyContent: 'center',
},
content: {
flex: 2,
paddingHorizontal: 40,
justifyContent: 'center',
},
scrollableContent: {
flex: 2,
},
scrollview: {
flex: 1,
},
scrollViewContentContainer: {
flex: 1,
paddingHorizontal: 40,
},
leadinText: {
fontSize: 36,
fontWeight: '800',
textAlign: 'right',
},
leadinTextSmall: {
fontSize: 24,
},
titleText: {
fontSize: 58,
fontWeight: '800',
textAlign: 'right',
},
titleTextSmall: {
fontSize: 36,
},
descriptionText: {
maxWidth: 400,
marginTop: 10,
marginLeft: 'auto',
textAlign: 'right',
},
contentWrapper: {
maxWidth: 600,
},
})