From ba2450afc4ed7b94312fce31535414b9d1576a33 Mon Sep 17 00:00:00 2001 From: shuai Date: Fri, 14 Oct 2022 17:22:25 +0800 Subject: [PATCH] fix: question detail page styles change --- ui/src/components/UserCard/index.tsx | 23 +++++++++++++++---- .../Detail/components/Answer/index.tsx | 4 ++-- .../Detail/components/Question/index.tsx | 11 +++++---- ui/src/pages/Questions/Detail/index.scss | 8 +++++++ ui/src/pages/Questions/Detail/index.tsx | 5 ++-- 5 files changed, 37 insertions(+), 14 deletions(-) diff --git a/ui/src/components/UserCard/index.tsx b/ui/src/components/UserCard/index.tsx index 65e6eaf6..259ab8c5 100644 --- a/ui/src/components/UserCard/index.tsx +++ b/ui/src/components/UserCard/index.tsx @@ -1,6 +1,8 @@ import { memo, FC } from 'react'; import { Link } from 'react-router-dom'; +import classnames from 'classnames'; + import { Avatar, FormatTime } from '@answer/components'; import { formatCount } from '@/utils'; @@ -9,20 +11,31 @@ interface Props { data: any; time: number; preFix: string; + className?: string; } -const Index: FC = ({ data, time, preFix }) => { +const Index: FC = ({ data, time, preFix, className = '' }) => { return ( -
+
{data?.status !== 'deleted' ? ( - + + + ) : ( )} -
-
+
+
{data?.status !== 'deleted' ? ( {data?.display_name} diff --git a/ui/src/pages/Questions/Detail/components/Answer/index.tsx b/ui/src/pages/Questions/Detail/components/Answer/index.tsx index ebc9ddf2..b7bd25d8 100644 --- a/ui/src/pages/Questions/Detail/components/Answer/index.tsx +++ b/ui/src/pages/Questions/Detail/components/Answer/index.tsx @@ -102,7 +102,7 @@ const Index: FC = ({
- + = ({ callback={callback} /> - + {data.update_user_info?.username !== data.user_info?.username ? ( = ({ data, initPage, hasAnswer }) => { : ''} -
+ +
= ({ data, initPage, hasAnswer }) => { {followed ? 'Following' : 'Follow'}
-
+
{data?.tags?.map((item: any) => { return ( = ({ data, initPage, hasAnswer }) => {
= ({ data, initPage, hasAnswer }) => { /> - + = ({ data, initPage, hasAnswer }) => { callback={initPage} /> - + {data.update_user_info?.username !== data.user_info?.username ? ( { return ( <> - + - + {question?.operation?.operation_type && ( )} @@ -154,6 +154,7 @@ const Index = () => { />
)} + {!question?.operation?.operation_type && (