Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Allignment issue in the blog page #1029

Merged
merged 12 commits into from
Oct 26, 2024
60 changes: 53 additions & 7 deletions pages/blog/index.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -286,14 +286,34 @@ export default function StaticMarkdownPage({
/>
</div>
</div>
<div className='flex flex-row items-center'>
<div className='flex flex-row pl-2 mr-2'>
<div
className={`
flex
flex-row
items-center
`}
>
<div
className={`
flex
flex-row
pl-2
mr-2
`}
>
{(frontmatter.authors || []).map(
(author: any, index: number) => {
return (
<div
key={index}
className='bg-slate-50 h-[44px] w-[44px] rounded-full -ml-3 bg-cover bg-center border-2 border-white'
className={`bg-slate-50
${frontmatter.authors.length > 2 ? 'h-[32px] w-[32px]' : 'h-[44px] w-[44px]'}
Ritesh2351235 marked this conversation as resolved.
Show resolved Hide resolved
rounded-full
-ml-3
bg-cover
bg-center
border-2
border-white`}
style={{
backgroundImage: `url(${author.photo})`,
zIndex: 10 - index,
Expand All @@ -304,11 +324,37 @@ export default function StaticMarkdownPage({
)}
</div>

<div className='flex flex-col items-start'>
<div
className={`
flex
flex-col
items-start
`}
>
<div className='text-sm font-semibold'>
{frontmatter.authors
.map((author: any) => author.name)
.join(' & ')}
{frontmatter.authors.length > 2 ? (
<>
{frontmatter.authors
.slice(0, 2)
.map((author: any, index: number) => (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use the correct data type in place of any

<span key={author.name}>
{author.name}
{index === 0 && ' & '}
</span>
))}
{'...'}
</>
) : (
frontmatter.authors.map(
(author: any, index: number) => (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here please use the correct data type in place of any

<span key={author.name}>
{author.name}
{index < frontmatter.authors.length - 1 &&
' & '}
</span>
),
)
)}
</div>

<div className='text-slate-500 text-sm dark:text-slate-300'>
Expand Down