Skip to content

Commit 9ad92bb

Browse files
fix: 포스트헤더 레이아웃 padding 대신 flex 사용해서 가운데 정렬
1 parent 0130a3b commit 9ad92bb

2 files changed

Lines changed: 47 additions & 43 deletions

File tree

app/entities/common/Profile.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ interface Props {
99

1010
const Profile = ({ profileThumbnail, username }: Props) => {
1111
return (
12-
<div className={'flex items-center text-nowrap'}>
12+
<div className={'flex items-center text-nowrap mr-2 sm:mr-0'}>
1313
<div
1414
className={
1515
'w-8 h-8 aspect-square rounded-full bg-gray-300 overflow-hidden'

app/entities/post/detail/PostHeader.tsx

Lines changed: 46 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -62,50 +62,54 @@ const PostHeader = ({
6262
/>
6363
</div>
6464
)}
65-
<div className="relative h-full z-20 bg-gray-400/40 px-6">
66-
<h1
67-
className={
68-
'font-bold mb-4 pt-10 md:pt-20 text-3xl md:text-5xl z-10 px-2 break-keep'
69-
}
70-
>
71-
<TypingText
72-
title={title}
73-
delay={50}
74-
onComplete={() => setIsTypingComplete(true)}
75-
/>
76-
</h1>
77-
<h2
78-
className={`md:text-2xl font-bold mb-4 transition-opacity duration-500 ${
79-
isTypingComplete ? 'opacity-100' : 'opacity-0'
80-
}`}
81-
>
82-
{subTitle}
83-
</h2>
84-
<div
85-
className={`pb-10 inline-flex items-center transition-opacity duration-500 ${
86-
isTypingComplete ? 'opacity-100' : 'opacity-0'
87-
}`}
88-
>
89-
<div className={'items-center post-author flex'}>
90-
<Profile
91-
profileThumbnail={'/images/profile/profile.jpg'}
92-
username={author}
65+
<div className="relative flex justify-center items-center h-full z-20 bg-gray-400/40 px-6">
66+
<div>
67+
<h1
68+
className={
69+
'font-bold mb-4 text-3xl md:text-5xl z-10 px-2 break-keep'
70+
}
71+
>
72+
<TypingText
73+
title={title}
74+
delay={50}
75+
onComplete={() => setIsTypingComplete(true)}
9376
/>
94-
</div>
95-
<span className={'post-date'}>
96-
{new Date(date).toLocaleDateString('ko-KR')}
97-
</span>
98-
<span
99-
className={'post-time-to-read mx-2 inline-flex items-center gap-2'}
77+
</h1>
78+
<h2
79+
className={`md:text-2xl font-bold mb-4 transition-opacity duration-500 ${
80+
isTypingComplete ? 'opacity-100' : 'opacity-0'
81+
}`}
10082
>
101-
<FaBook />
102-
{timeToRead} min read
103-
</span>
104-
{isAdmin && (
105-
<button onClick={handleEditClick}>
106-
<span className="underline">Edit</span>
107-
</button>
108-
)}
83+
{subTitle}
84+
</h2>
85+
<div
86+
className={`inline-flex items-center transition-opacity duration-500 ${
87+
isTypingComplete ? 'opacity-100' : 'opacity-0'
88+
}`}
89+
>
90+
<div className={'items-center post-author flex'}>
91+
<Profile
92+
profileThumbnail={'/images/profile/profile.jpg'}
93+
username={author}
94+
/>
95+
</div>
96+
<span className={'post-date'}>
97+
{new Date(date).toLocaleDateString('ko-KR')}
98+
</span>
99+
<span
100+
className={
101+
'post-time-to-read mx-2 inline-flex items-center gap-2'
102+
}
103+
>
104+
<FaBook />
105+
{timeToRead} min read
106+
</span>
107+
{isAdmin && (
108+
<button onClick={handleEditClick}>
109+
<span className="underline">Edit</span>
110+
</button>
111+
)}
112+
</div>
109113
</div>
110114
</div>
111115
</div>

0 commit comments

Comments
 (0)