Skip to content

Commit

Permalink
✨ 배너 이미지 로딩 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
oaoong committed Dec 2, 2023
1 parent 34fd5f4 commit 560a968
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/app/(root)/(routes)/(home)/components/BannerSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ const BannerSection = () => {
{ url: Assets.banner3 },
]
return (
<Slider loading="eager" imageData={bannerArr} imageAspectRatio="auto" />
<Slider
loading="eager"
priority={true}
imageData={bannerArr}
imageAspectRatio="auto"
/>
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ const AvatarWithDropdown = ({ imageUrl }: { imageUrl?: string }) => {
<DropdownMenuTrigger asChild>
<Button variant={null}>
<Avatar size="md">
<AvatarImage imgUrl={imageUrl ?? DEFAULT_PROFILE_IMG} />
<AvatarImage
alt="profile"
imgUrl={imageUrl ?? DEFAULT_PROFILE_IMG}
/>
</Avatar>
</Button>
</DropdownMenuTrigger>
Expand Down
1 change: 0 additions & 1 deletion src/components/domain/header/sections/RightSide.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use client'

import React from 'react'
import Link from 'next/link'
import { useRouter } from 'next/navigation'
import Button from '@/components/ui/button'
import AppPath from '@/config/appPath'
Expand Down
3 changes: 3 additions & 0 deletions src/components/domain/slider/Slider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ type SliderProps = {
imageData: { url: string | StaticImageData }[]
imageAspectRatio: string
loading?: 'lazy' | 'eager'
priority?: boolean
}

/**
Expand All @@ -22,6 +23,7 @@ const Slider = ({
imageData,
imageAspectRatio,
loading = 'lazy',
priority = false,
}: SliderProps) => {
SwiperCore.use([Pagination, Autoplay])
return (
Expand All @@ -46,6 +48,7 @@ const Slider = ({
quality={50}
style={{ width: '100%' }}
loading={loading}
priority={priority}
/>
</SwiperSlide>
))}
Expand Down

0 comments on commit 560a968

Please sign in to comment.