import { Money } from "@styled-icons/boxicons-regular"; import { Home as HomeIcon, PlusCircle, Compass, Megaphone, Group, Cog, RightArrowCircle, } from "@styled-icons/boxicons-solid"; import { observer } from "mobx-react-lite"; import { Link } from "react-router-dom"; import styled, { css } from "styled-components"; import styles from "./Home.module.scss"; import "./snow.scss"; import { Text } from "preact-i18n"; import { useContext, useMemo } from "preact/hooks"; import { isTouchscreenDevice } from "../../lib/isTouchscreenDevice"; import { useApplicationState } from "../../mobx/State"; import { SIDEBAR_CHANNELS } from "../../mobx/stores/Layout"; import { AppContext } from "../../context/revoltjs/RevoltClient"; import wideSVG from "../../../public/assets/wide.svg"; import Tooltip from "../../components/common/Tooltip"; import Header from "../../components/ui/Header"; import CategoryButton from "../../components/ui/fluent/CategoryButton"; const IconConainer = styled.div` cursor: pointer; color: var(--secondary-foreground); ${!isTouchscreenDevice && css` &:hover { color: var(--foreground); } `} `; const Overlay = styled.div` display: grid; height: 100%; > * { grid-area: 1 / 1; } .content { z-index: 1; } `; export default observer(() => { const client = useContext(AppContext); const state = useApplicationState(); const toggleChannelSidebar = () => { if (isTouchscreenDevice) { return; } state.layout.toggleSectionState(SIDEBAR_CHANNELS, true); }; const toggleSeasonalTheme = () => state.settings.set( "appearance:seasonal", !state.settings.get("appearance:seasonal"), ); const seasonalTheme = state.settings.get("appearance:seasonal") ?? true; const isDecember = new Date().getMonth() === 11; const snowflakes = useMemo(() => { const flakes = []; // Disable outside of December if (!isDecember) return []; for (let i = 0; i < 15; i++) { flakes.push("❄️"); flakes.push("❄"); } for (let i = 0; i < 2; i++) { flakes.push("🎄"); flakes.push("☃️"); flakes.push("⛄"); } return flakes; }, []); return (
{seasonalTheme && (
{snowflakes.map((emoji, index) => (
{emoji}
))}
)}


} description={ "Invite all of your friends, some cool bots, and throw a big party." }> Create a group } description={ "Find a community based on your hobbies or interests." }> Join a community {client.servers.get( "01F7ZSBSFHQ8TA81725KQCSDDP", ) ? ( } description={ "You can report issues and discuss improvements with us directly here." }> ) : ( } description={ "You can report issues and discuss improvements with us directly here." }> )} } description={ "Let us know how we can improve our app by giving us feedback." }> }> }> }>
{isDecember && ( Turn {seasonalTheme ? "off" : "on"} homescreen effects )}
{" "}
); });