mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
fix broken welcome page mobile layout
This commit is contained in:
@@ -13,9 +13,20 @@ import { SiGithub, SiTwitter } from "react-icons/si"
|
|||||||
import { TbClock, TbKey, TbMoon, TbSettings, TbSun, TbUserPlus } from "react-icons/tb"
|
import { TbClock, TbKey, TbMoon, TbSettings, TbSun, TbUserPlus } from "react-icons/tb"
|
||||||
import { PageTitle } from "./PageTitle"
|
import { PageTitle } from "./PageTitle"
|
||||||
|
|
||||||
|
const iconSize = 18
|
||||||
|
|
||||||
export function WelcomePage() {
|
export function WelcomePage() {
|
||||||
|
const serverInfos = useAppSelector(state => state.server.serverInfos)
|
||||||
const { colorScheme } = useMantineColorScheme()
|
const { colorScheme } = useMantineColorScheme()
|
||||||
|
const dispatch = useAppDispatch()
|
||||||
const image = colorScheme === "light" ? welcome_page_light : welcome_page_dark
|
const image = colorScheme === "light" ? welcome_page_light : welcome_page_dark
|
||||||
|
|
||||||
|
const login = useAsyncCallback(client.user.login, {
|
||||||
|
onSuccess: () => {
|
||||||
|
dispatch(redirectToRootCategory())
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Container>
|
<Container>
|
||||||
<Header />
|
<Header />
|
||||||
@@ -24,6 +35,18 @@ export function WelcomePage() {
|
|||||||
<Title order={3}>Bloat-free feed reader</Title>
|
<Title order={3}>Bloat-free feed reader</Title>
|
||||||
</Center>
|
</Center>
|
||||||
|
|
||||||
|
{serverInfos?.demoAccountEnabled && (
|
||||||
|
<Center>
|
||||||
|
<ActionButton
|
||||||
|
label={<Trans>Try the demo!</Trans>}
|
||||||
|
icon={<TbClock size={iconSize} />}
|
||||||
|
variant="outline"
|
||||||
|
onClick={() => login.execute({ name: "demo", password: "demo" })}
|
||||||
|
showLabelOnMobile
|
||||||
|
/>
|
||||||
|
</Center>
|
||||||
|
)}
|
||||||
|
|
||||||
<Divider my="xl" />
|
<Divider my="xl" />
|
||||||
|
|
||||||
<Image src={image} />
|
<Image src={image} />
|
||||||
@@ -58,30 +81,14 @@ function Header() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function Buttons() {
|
function Buttons() {
|
||||||
const iconSize = 18
|
|
||||||
const serverInfos = useAppSelector(state => state.server.serverInfos)
|
const serverInfos = useAppSelector(state => state.server.serverInfos)
|
||||||
const { colorScheme, toggleColorScheme } = useMantineColorScheme()
|
const { colorScheme, toggleColorScheme } = useMantineColorScheme()
|
||||||
const { isBrowserExtensionPopup, openSettingsPage } = useBrowserExtension()
|
const { isBrowserExtensionPopup, openSettingsPage } = useBrowserExtension()
|
||||||
const dispatch = useAppDispatch()
|
const dispatch = useAppDispatch()
|
||||||
const dark = colorScheme === "dark"
|
const dark = colorScheme === "dark"
|
||||||
|
|
||||||
const login = useAsyncCallback(client.user.login, {
|
|
||||||
onSuccess: () => {
|
|
||||||
dispatch(redirectToRootCategory())
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Group spacing={14}>
|
<Group spacing={14}>
|
||||||
{serverInfos?.demoAccountEnabled && (
|
|
||||||
<ActionButton
|
|
||||||
label={<Trans>Try the demo!</Trans>}
|
|
||||||
icon={<TbClock size={iconSize} />}
|
|
||||||
variant="outline"
|
|
||||||
onClick={() => login.execute({ name: "demo", password: "demo" })}
|
|
||||||
showLabelOnMobile
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
<ActionButton
|
<ActionButton
|
||||||
label={<Trans>Log in</Trans>}
|
label={<Trans>Log in</Trans>}
|
||||||
icon={<TbKey size={iconSize} />}
|
icon={<TbKey size={iconSize} />}
|
||||||
|
|||||||
Reference in New Issue
Block a user