[st] design: 디자인 수정
This commit is contained in:
@@ -20,7 +20,7 @@ type BannerImageProps = {
|
||||
lnkgUrlAddr: string;
|
||||
};
|
||||
|
||||
const BannerImage = ({ atflCd, bnrSn, lnkgUrlAddr }: BannerImageProps) => {
|
||||
const BannerImage = ({ atflCd, lnkgUrlAddr }: BannerImageProps) => {
|
||||
const { data: imageUrl, isLoading } = useQuery({
|
||||
queryKey: [ENDPOINT.ATTACH_SERVICE.IMAGES, atflCd],
|
||||
queryFn: () => getImageUrlByAtflCd(atflCd),
|
||||
@@ -29,13 +29,13 @@ const BannerImage = ({ atflCd, bnrSn, lnkgUrlAddr }: BannerImageProps) => {
|
||||
|
||||
const handleClick = () => {
|
||||
if (lnkgUrlAddr) {
|
||||
window.open(lnkgUrlAddr, '_blank');
|
||||
window.open(lnkgUrlAddr, "_blank");
|
||||
}
|
||||
};
|
||||
|
||||
if (isLoading) {
|
||||
return (
|
||||
<div className="relative flex h-24 items-center justify-center bg-accent mx-auto">
|
||||
<div className="relative mx-auto flex h-24 items-center justify-center bg-accent">
|
||||
<div className="text-sm text-muted-foreground">로딩 중...</div>
|
||||
</div>
|
||||
);
|
||||
@@ -43,18 +43,22 @@ const BannerImage = ({ atflCd, bnrSn, lnkgUrlAddr }: BannerImageProps) => {
|
||||
|
||||
if (!imageUrl) {
|
||||
return (
|
||||
<div className="relative flex h-24 items-center justify-center bg-accent mx-auto">
|
||||
<div className="relative mx-auto flex h-24 items-center justify-center bg-accent">
|
||||
<div className="text-sm text-muted-foreground">이미지 없음</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
className="relative flex h-24 items-center justify-center cursor-pointer hover:opacity-80 transition-opacity mx-auto"
|
||||
<div
|
||||
className="relative mx-auto flex h-24 cursor-pointer items-center justify-center transition-opacity hover:opacity-80"
|
||||
onClick={handleClick}
|
||||
>
|
||||
<img src={imageUrl} className="object-contain w-full h-full" alt="배너 이미지" />
|
||||
<img
|
||||
src={imageUrl}
|
||||
className="h-full w-full object-contain"
|
||||
alt="배너 이미지"
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -70,25 +74,33 @@ export function Footer() {
|
||||
queryFn: () => getBannerList(siteId),
|
||||
});
|
||||
|
||||
// MAIN 타입 배너만 필터링
|
||||
const mainBanners = bannerList?.filter((banner) => banner.bnrTypeCd === "BNRFTER") ?? [];
|
||||
|
||||
// MAIN 타입 배너만 필터링
|
||||
const mainBanners =
|
||||
bannerList?.filter((banner) => banner.bnrTypeCd === "BNRFTER") ?? [];
|
||||
|
||||
const plugin = useRef(Autoplay({ delay: 2000, stopOnInteraction: true }));
|
||||
|
||||
return (
|
||||
<footer className="flex flex-col sm:flex-row w-full shrink-0 items-start border-t border-solid border-border bg-background px-3 sm:px-6 pt-4 pb-1 text-foreground">
|
||||
<div className="w-full sm:w-[55%] mb-4 sm:mb-0">
|
||||
<h6 className="mb-2 sm:mb-4 text-lg sm:text-xl md:text-2xl font-bold">{siteInfo?.siteNm ?? ""}</h6>
|
||||
<p className="my-1 text-sm sm:text-base md:text-xl opacity-60">{siteInfo?.siteAddr ?? ""}</p>
|
||||
<p className="my-1 text-sm sm:text-base md:text-xl opacity-60">
|
||||
<footer className="flex w-full shrink-0 flex-col items-start border-t border-solid border-border bg-background px-3 pb-1 pt-4 text-foreground sm:flex-row sm:px-6">
|
||||
<div className="mb-4 w-full sm:mb-0 sm:w-[55%]">
|
||||
<h6 className="mb-2 text-lg font-bold sm:mb-4 sm:text-xl md:text-2xl">
|
||||
{siteInfo?.siteNm ?? ""}
|
||||
</h6>
|
||||
<p className="my-1 text-sm opacity-60 sm:text-base md:text-xl">
|
||||
{siteInfo?.siteAddr ?? ""}
|
||||
</p>
|
||||
<p className="my-1 text-sm opacity-60 sm:text-base md:text-xl">
|
||||
전화: {siteInfo?.telNo ?? ""} / 팩스: {siteInfo?.faxNumber ?? ""}
|
||||
</p>
|
||||
<p className="my-1 text-sm sm:text-base md:text-xl opacity-60">{siteInfo?.lwndCn ?? ""}</p>
|
||||
<p className="my-1 text-sm opacity-60 sm:text-base md:text-xl">
|
||||
{siteInfo?.lwndCn ?? ""}
|
||||
</p>
|
||||
</div>
|
||||
<div className="flex w-full sm:w-[45%] flex-col">
|
||||
<div className="flex flex-wrap justify-start sm:justify-end gap-2 sm:gap-4 mb-4 sm:mb-0">
|
||||
<span className="text-sm sm:text-base md:text-xl">개인정보처리방침</span>
|
||||
<div className="flex w-full flex-col sm:w-[45%]">
|
||||
<div className="mb-4 flex flex-wrap justify-start gap-2 sm:mb-0 sm:justify-end sm:gap-4">
|
||||
<span className="text-sm sm:text-base md:text-xl">
|
||||
개인정보처리방침
|
||||
</span>
|
||||
<span className="text-sm sm:text-base md:text-xl">이용약관</span>
|
||||
<span className="text-sm sm:text-base md:text-xl">사이트맵</span>
|
||||
<span className="text-sm sm:text-base md:text-xl">고객센터</span>
|
||||
@@ -97,29 +109,34 @@ export function Footer() {
|
||||
<Carousel
|
||||
plugins={[plugin.current]}
|
||||
opts={{ loop: true }}
|
||||
className="relative my-4 sm:my-8 h-20 sm:h-24"
|
||||
className="relative my-4 h-20 sm:my-8 sm:h-24"
|
||||
>
|
||||
<CarouselContent>
|
||||
{mainBanners && mainBanners.length > 0 ? (
|
||||
mainBanners.map((banner) => (
|
||||
<CarouselItem key={`banner-${banner.bnrSn}`} className="basis-1/2 sm:basis-1/3">
|
||||
<BannerImage
|
||||
atflCd={banner.atflCd}
|
||||
bnrSn={banner.bnrSn}
|
||||
<CarouselItem
|
||||
key={`banner-${banner.bnrSn}`}
|
||||
className="basis-1/2 sm:basis-1/3"
|
||||
>
|
||||
<BannerImage
|
||||
atflCd={banner.atflCd}
|
||||
bnrSn={banner.bnrSn}
|
||||
lnkgUrlAddr={banner.lnkgUrlAddr}
|
||||
/>
|
||||
</CarouselItem>
|
||||
))
|
||||
) : (
|
||||
<CarouselItem className="basis-1/2 sm:basis-1/3">
|
||||
<div className="relative flex h-20 sm:h-24 w-full items-center justify-center bg-accent">
|
||||
<div className="text-sm text-muted-foreground">배너가 없습니다</div>
|
||||
<div className="relative flex h-20 w-full items-center justify-center bg-accent sm:h-24">
|
||||
<div className="text-sm text-muted-foreground">
|
||||
배너가 없습니다
|
||||
</div>
|
||||
</div>
|
||||
</CarouselItem>
|
||||
)}
|
||||
</CarouselContent>
|
||||
<CarouselPrevious className="absolute left-2 top-1/2 !bg-[rgba(255,255,255,0.8)] text-accent-foreground z-10" />
|
||||
<CarouselNext className="absolute right-2 top-1/2 !bg-[rgba(255,255,255,0.8)] text-accent-foreground z-10" />
|
||||
<CarouselPrevious className="absolute left-2 top-1/2 z-10 !bg-background text-accent-foreground" />
|
||||
<CarouselNext className="absolute right-2 top-1/2 z-10 !bg-background text-accent-foreground" />
|
||||
</Carousel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user