From ec1a826ed3c4e4e1b3c82a14f21b35e1945131b5 Mon Sep 17 00:00:00 2001 From: "haitao(lj)" Date: Fri, 14 Oct 2022 10:22:07 +0800 Subject: [PATCH 01/12] refactor(root&header): optimize root and logo style --- ui/public/index.html | 2 +- ui/src/components/Actions/index.tsx | 2 +- ui/src/components/Header/index.tsx | 8 ++------ ui/src/index.scss | 4 ++++ 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ui/public/index.html b/ui/public/index.html index 5dd5d5f4..efa315fc 100644 --- a/ui/public/index.html +++ b/ui/public/index.html @@ -2,7 +2,7 @@ - + diff --git a/ui/src/components/Actions/index.tsx b/ui/src/components/Actions/index.tsx index 4f3ae240..87c35cef 100644 --- a/ui/src/components/Actions/index.tsx +++ b/ui/src/components/Actions/index.tsx @@ -45,7 +45,7 @@ const Index: FC = ({ className, data }) => { count: data?.collectCount, }); } - }, [data]); + }, []); const handleVote = (type: 'up' | 'down') => { if (!isLogin(true)) { diff --git a/ui/src/components/Header/index.tsx b/ui/src/components/Header/index.tsx index 2cfffe69..2d2ef364 100644 --- a/ui/src/components/Header/index.tsx +++ b/ui/src/components/Header/index.tsx @@ -48,13 +48,9 @@ const Header: FC = () => { return ( - + {interfaceInfo.logo ? ( - + ) : ( {siteInfo.name || 'Answer'} )} diff --git a/ui/src/index.scss b/ui/src/index.scss index e1bdbc64..7b5917f0 100644 --- a/ui/src/index.scss +++ b/ui/src/index.scss @@ -14,6 +14,10 @@ } } +:root { + overflow-y: scroll; +} + html, body { padding: 0; From 1ae90a0eea8686fd37f8de2eaddff5ea25a4dc41 Mon Sep 17 00:00:00 2001 From: fen Date: Fri, 14 Oct 2022 10:50:24 +0800 Subject: [PATCH 02/12] fix: font size style --- ui/src/pages/Questions/Detail/components/Question/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/src/pages/Questions/Detail/components/Question/index.tsx b/ui/src/pages/Questions/Detail/components/Question/index.tsx index 333c80d8..2f21865e 100644 --- a/ui/src/pages/Questions/Detail/components/Question/index.tsx +++ b/ui/src/pages/Questions/Detail/components/Question/index.tsx @@ -57,7 +57,7 @@ const Index: FC = ({ data, initPage, hasAnswer }) => { } return (
-

+

{data.title} {data.status === 2 From c2e48bd152463859de6ecb7d8dc757ebc9571fad Mon Sep 17 00:00:00 2001 From: robin Date: Fri, 14 Oct 2022 10:59:14 +0800 Subject: [PATCH 03/12] refactor: Responsive styling --- .../Comment/components/ActionBar/index.tsx | 25 ++++++++++++++++++- .../Comment/components/Form/index.tsx | 14 +++++++---- .../Comment/components/Reply/index.tsx | 8 +++--- ui/src/components/Comment/index.scss | 10 ++++++-- 4 files changed, 45 insertions(+), 12 deletions(-) diff --git a/ui/src/components/Comment/components/ActionBar/index.tsx b/ui/src/components/Comment/components/ActionBar/index.tsx index b8d75639..a801a6bb 100644 --- a/ui/src/components/Comment/components/ActionBar/index.tsx +++ b/ui/src/components/Comment/components/ActionBar/index.tsx @@ -1,5 +1,5 @@ import { memo } from 'react'; -import { Button } from 'react-bootstrap'; +import { Button, Dropdown } from 'react-bootstrap'; import { useTranslation } from 'react-i18next'; import { Link } from 'react-router-dom'; @@ -64,6 +64,29 @@ const ActionBar = ({ ); })}

+ + + + + + + {memberActions.map((action) => { + return ( + onAction(action)}> + {action.name} + + ); + })} + + ); }; diff --git a/ui/src/components/Comment/components/Form/index.tsx b/ui/src/components/Comment/components/Form/index.tsx index 7c7d9ebc..014dea46 100644 --- a/ui/src/components/Comment/components/Form/index.tsx +++ b/ui/src/components/Comment/components/Form/index.tsx @@ -31,7 +31,11 @@ const Form = ({ }; return ( -
+