From 2e6f950b4eacca1ff3653018972d63fd94103a7b Mon Sep 17 00:00:00 2001 From: hookor Date: Wed, 28 Aug 2024 16:59:14 +0900 Subject: [PATCH] Feat: set different font-size in MiniProfile depending on pages --- src/components/common/MiniProfile.tsx | 28 ++++++++++++++++++++++----- src/styles/styles.ts | 8 ++++++++ 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/src/components/common/MiniProfile.tsx b/src/components/common/MiniProfile.tsx index 6cf6f8e2..0b4a9f3c 100644 --- a/src/components/common/MiniProfile.tsx +++ b/src/components/common/MiniProfile.tsx @@ -1,12 +1,18 @@ import ImgContainer from '@/components/common/ImgContainer'; import { TEXT } from '@/constants/texts'; import { MiniProfileProps } from '@/types/types'; -import { Column, Flex, FlexCenter, Justify } from '@/styles/layout'; -import { LineH18, Semibold } from '@/styles/styles'; +import { Between, Column, Flex, FlexCenter, Justify } from '@/styles/layout'; +import { + LineH18, + Semibold, + MiniUserTitle, + PostsUserContainer +} from '@/styles/styles'; import { styled } from 'styled-system/jsx'; import { cx } from 'styled-system/css'; import { useNavigateTo } from '@/hooks/useNavigateTo'; import NoProfileImg from '@/components/common/NoProfileImg'; +import { useLocation } from 'react-router-dom'; const MiniProfile = ({ url, @@ -17,6 +23,8 @@ const MiniProfile = ({ mini = false }: MiniProfileProps) => { const toProfilePage = useNavigateTo(`/profile/${userId}`); + const { pathname } = useLocation(); + const postsTitle = pathname.startsWith('/post'); return ( <> @@ -37,8 +45,18 @@ const MiniProfile = ({ /> )} -
- +
+ {nickname}