From a02582cc9033734bbdc03905348e0095e861920b Mon Sep 17 00:00:00 2001 From: tzhangchi Date: Thu, 1 Sep 2022 15:51:55 +0800 Subject: [PATCH 1/6] feat(venus): use AFFiNE header stanard header --- apps/venus/src/app/AboutUs.tsx | 62 ++-------------------- apps/venus/src/app/App.tsx | 71 +------------------------ apps/venus/src/app/Common.tsx | 94 ++++++++++++++++++++++++++++++++-- 3 files changed, 95 insertions(+), 132 deletions(-) diff --git a/apps/venus/src/app/AboutUs.tsx b/apps/venus/src/app/AboutUs.tsx index 19dfbd4a8a..b20420a556 100644 --- a/apps/venus/src/app/AboutUs.tsx +++ b/apps/venus/src/app/AboutUs.tsx @@ -1,18 +1,13 @@ import { useTranslation } from 'react-i18next'; import { useNavigate } from 'react-router-dom'; -import { Box, Button, Grid, Typography } from '@mui/joy'; -import Option from '@mui/joy/Option'; -import Select from '@mui/joy/Select'; +import { Box, Grid, Typography } from '@mui/joy'; // eslint-disable-next-line no-restricted-imports import { useMediaQuery } from '@mui/material'; - import 'github-markdown-css'; import AboutText from './about.mdx'; -import { AFFiNEFooter, AFFiNEImage } from './Common'; -import { options } from './i18n'; +import { AFFiNEFooter, AFFiNEHeader, AFFiNEImage } from './Common'; import KeepUpdate from './keeupdate.png'; - export const AboutUs = () => { const matches = useMediaQuery('(max-width: 1024px)'); const navigate = useNavigate(); @@ -23,58 +18,7 @@ export const AboutUs = () => { }; return ( <> - - - - - - - - - + - - - - - - - - - - - + ); }; + +export const AFFiNEHeader = () => { + const matches = useMediaQuery('(max-width: 1024px)'); + const navigate = useNavigate(); + const { i18n } = useTranslation(); + + const changeLanguage = (event: any) => { + i18n.changeLanguage(event); + }; + return ( + + + + + + + + + + + + ); +}; From f4e2bead89a88a1fd3525523c87e249f88259a95 Mon Sep 17 00:00:00 2001 From: tzhangchi Date: Thu, 1 Sep 2022 15:55:15 +0800 Subject: [PATCH 2/6] feat(venus): add responsive --- apps/venus/src/app/Common.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/venus/src/app/Common.tsx b/apps/venus/src/app/Common.tsx index 7adb206a56..87347f4fa1 100644 --- a/apps/venus/src/app/Common.tsx +++ b/apps/venus/src/app/Common.tsx @@ -350,6 +350,7 @@ export const AFFiNEHeader = () => { const changeLanguage = (event: any) => { i18n.changeLanguage(event); }; + const matchesIPAD = useMediaQuery('(max-width: 768px)'); return ( { > About Us - {options.map(option => (