From b06880be1549d70ee86b921a7955c82de3cdceff Mon Sep 17 00:00:00 2001 From: lebaudantoine Date: Sat, 16 Nov 2024 19:29:46 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84(frontend)=20enhance=20home=20page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I've totally rework the homepage, heavily inspired by GMeet. Goal: make it more pro, and polished. --- .../src/features/home/routes/Home.tsx | 266 +++++++++++++----- src/frontend/src/locales/en/home.json | 4 +- src/frontend/src/locales/fr/home.json | 4 +- 3 files changed, 201 insertions(+), 73 deletions(-) diff --git a/src/frontend/src/features/home/routes/Home.tsx b/src/frontend/src/features/home/routes/Home.tsx index 83cd0d38..cf0459ff 100644 --- a/src/frontend/src/features/home/routes/Home.tsx +++ b/src/frontend/src/features/home/routes/Home.tsx @@ -1,10 +1,9 @@ import { useTranslation } from 'react-i18next' import { DialogTrigger, MenuItem, Menu as RACMenu } from 'react-aria-components' -import { Button, Menu, Text } from '@/primitives' -import { HStack } from '@/styled-system/jsx' +import { Button, Menu } from '@/primitives' +import { HStack, styled } from '@/styled-system/jsx' import { navigateTo } from '@/navigation/navigateTo' import { Screen } from '@/layout/Screen' -import { Centered } from '@/layout/Centered' import { generateRoomId } from '@/features/rooms' import { useUser, UserAware } from '@/features/auth' import { JoinMeetingDialog } from '../components/JoinMeetingDialog' @@ -14,7 +13,125 @@ import { usePersistentUserChoices } from '@livekit/components-react' import { menuItemRecipe } from '@/primitives/menuItemRecipe' import { RiAddLine, RiLink } from '@remixicon/react' import { LaterMeetingDialog } from '@/features/home/components/LaterMeetingDialog' -import { useState } from 'react' +import { IntroSlider } from '@/features/home/components/IntroSlider' +import { MoreLink } from '@/features/home/components/MoreLink' +import { ReactNode, useState } from 'react' + +import { css } from '@/styled-system/css' + +const Columns = ({ children }: { children?: ReactNode }) => { + return ( +
+ {children} +
+ ) +} + +const LeftColumn = ({ children }: { children?: ReactNode }) => { + return ( +
+ {children} +
+ ) +} + +const RightColumn = ({ children }: { children?: ReactNode }) => { + return ( +
+ {children} +
+ ) +} + +const Separator = styled('div', { + base: { + borderBottom: '1px solid', + borderColor: '#747775', + marginTop: '2.5rem', + maxWidth: '30rem', + width: '100%', + }, +}) + +const Heading = styled('h1', { + base: { + fontSize: '3rem', + lineHeight: '3.2rem', + letterSpacing: '0', + fontWeight: '500', + fontStyle: 'normal', + fontStretch: 'normal', + fontOpticalSizing: 'auto', + marginBottom: 0, + paddingBottom: '0.75rem', + }, +}) + +const IntroText = styled('div', { + base: { + marginBottom: '3rem', + fontSize: '1.375rem', + lineHeight: '1.8rem', + textWrap: 'pretty', + maxWidth: '28rem', + }, +}) export const Home = () => { const { t } = useTranslation('home') @@ -30,72 +147,83 @@ export const Home = () => { return ( - - - {t('heading')} - - - {t('intro')} - - {!isLoggedIn && ( - - {t('loginToCreateMeeting')} - - )} - - {isLoggedIn ? ( - - + + { + const slug = generateRoomId() + createRoom({ slug, username }).then((data) => + navigateTo('room', data.slug, { + state: { create: true, initialRoomData: data }, + }) + ) + }} + data-attr="create-option-instant" + > + + {t('createMenu.instantOption')} + + { + const slug = generateRoomId() + createRoom({ slug, username }).then((data) => + setLaterRoomId(data.slug) + ) + }} + data-attr="create-option-later" + > + + {t('createMenu.laterOption')} + + + + ) : ( + + )} + + - - { - const slug = generateRoomId() - createRoom({ slug, username }).then((data) => - navigateTo('room', data.slug, { - state: { create: true, initialRoomData: data }, - }) - ) - }} - data-attr="create-option-instant" - > - - {t('createMenu.instantOption')} - - { - const slug = generateRoomId() - createRoom({ slug, username }).then((data) => - setLaterRoomId(data.slug) - ) - }} - data-attr="create-option-later" - > - - {t('createMenu.laterOption')} - - - - ) : ( - - )} - - - - - - + + + + +
+ +
+ + + +
+ +
+
+ setLaterRoomId(null)} diff --git a/src/frontend/src/locales/en/home.json b/src/frontend/src/locales/en/home.json index ff664c3c..f4eb76da 100644 --- a/src/frontend/src/locales/en/home.json +++ b/src/frontend/src/locales/en/home.json @@ -1,7 +1,7 @@ { "createMeeting": "Create a meeting", - "heading": "Welcome in Visio", - "intro": "Work easily, from anywhere.", + "heading": "Simple and Secure Video Conferencing", + "intro": "Communicate and work with ease, without compromising your sovereignty", "joinInputError": "Use a meeting link or code. Examples:", "joinInputExample": "URL or 10-letter code", "joinInputLabel": "Meeting link", diff --git a/src/frontend/src/locales/fr/home.json b/src/frontend/src/locales/fr/home.json index 58369326..423af386 100644 --- a/src/frontend/src/locales/fr/home.json +++ b/src/frontend/src/locales/fr/home.json @@ -1,7 +1,7 @@ { "createMeeting": "Créer une réunion", - "heading": "Visio", - "intro": "Collaborez en toute simplicité, où que vous soyez.", + "heading": "Visioconférences simples et sécurisées", + "intro": "Communiquez et travaillez en toute simplicité, sans compromis sur votre souveraineté", "joinInputError": "Saisissez un lien ou un code de réunion. Exemples :", "joinInputExample": "Un code de réunion ressemble à ceci : abc-defg-hij", "joinInputLabel": "Lien complet ou code de la réunion",