Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions app/routes/business/proposal/sent-campaign-content.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useState, useEffect } from "react";
import { useSearchParams, useNavigate } from "react-router-dom";
import { getProposalDetail, type ProposalDetail } from "./api/proposal";
import { axiosInstance } from "../../../api/axios";
import { getBrandSummary, type BrandSummary } from "./api/brand";
import Header from "../../../components/layout/Header";
import CampaignBrandCard from "../components/CampaignBrandCard";
Expand All @@ -19,6 +20,8 @@ export default function SentCampaignContent() {

const [data, setData] = useState<ProposalDetail | null>(null);
const [brand, setBrand] = useState<BrandSummary | null>(null);
const [brandUserId, setBrandUserId] = useState<string | null>(null);
const [brandCategory, setBrandCategory] = useState<string | null>(null);
const [isLoading, setIsLoading] = useState(true);

const proposalId = searchParams.get("proposalId");
Expand All @@ -38,6 +41,11 @@ export default function SentCampaignContent() {
if (proposalResult.brandId) {
const brandResult = await getBrandSummary(proposalResult.brandId);
setBrand(brandResult);
const brandDetailRes = await axiosInstance.get(`/v1/brands/${proposalResult.brandId}`);
const brandDetail = brandDetailRes.data?.result?.[0];
setBrandUserId(brandDetail?.brandUserId ?? null);
const category = brandDetail?.beautyResponse ? "beauty" : brandDetail?.fashionResponse ? "fashion" : null;
setBrandCategory(category);
}
} catch (error) {
console.error("캠페인 상세 조회 실패:", error);
Expand Down Expand Up @@ -67,6 +75,8 @@ export default function SentCampaignContent() {
brandTags={brand?.brandTags || []}
brandImageUrl={brand?.brandImageUrl}
matchingRate={brand?.matchingRate}
brandId={data.brandId}
category={brandCategory ?? undefined}
/>

<div className="flex justify-between items-center">
Expand All @@ -76,7 +86,7 @@ export default function SentCampaignContent() {
</div>
{/* 채팅하기 버튼 */}
<button
onClick={() => navigate(`/chat/${data.brandId}`)}
onClick={() => brandUserId && navigate(`/rooms/brand/${brandUserId}`)}
className="flex items-center gap-1.5 px-4 py-2 bg-bluegray-2 rounded-lg text-text-gray1 text-caption1 active:bg-bluegray-3 transition-colors"
>
<img src={chatIcon} alt="chat" className="w-4 h-4" />
Expand Down Expand Up @@ -111,15 +121,16 @@ export default function SentCampaignContent() {
}
>
<div className="flex flex-col gap-4">
{/* 설명 - 닫혔을 때는 2줄 미리보기, 열리면 전체 */}
<div className="flex flex-col gap-2">
<p className="text-caption2 text-text-gray3">설명</p>
<div className="w-full p-4 bg-bg-w border border-text-gray5 rounded-xl text-body1 leading-relaxed text-text-gray1">
<div className={`w-full p-4 bg-bg-w border border-text-gray5 rounded-xl text-body1 leading-relaxed text-text-gray1 ${!isContentOpen ? "line-clamp-2" : ""}`}>
{data.description}
</div>
</div>

{isContentOpen && (
<div className="grid grid-cols-2 gap-4 animate-slide-up">
<div className="grid grid-cols-2 gap-4">
<div className="col-span-2">
<ContentItem label="형식" value={getTagNames(data.contentTags.formats)} />
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/routes/room/components/Bubbles/MatchingMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default function MatchedCampaignMessage({
].join(" ")}
>
<div className="p-[1px] rounded-[12px] bg-gradient-to-r from-[#CBCBF5] via-[#6666E5] to-[#CBCBF5]">
<div className="w-[240px] rounded-[12px] bg-[#FFFFFF] px-[10px] py-[10px] flex flex-col gap-[8px]">
<div className="max-w-[240px] w-full rounded-[12px] bg-[#FFFFFF] px-[10px] py-[10px] flex flex-col gap-[8px]">
<div className="text-[12px] leading-[16px] style-Medium text-[#6666E5]">
매칭된 캠페인
</div>
Expand Down
4 changes: 2 additions & 2 deletions app/routes/room/components/Bubbles/ProposalMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export default function ProposalMessage(props: Props) {
</div>
) : null}

<div className="w-[214px] rounded-[10px] bg-[#B7B7F380] px-[10px] py-[10px] text-left break-words whitespace-pre-line gap-[10px] flex flex-col">
<div className="max-w-[214px] w-full rounded-[10px] bg-[#B7B7F380] px-[10px] py-[10px] text-left break-words whitespace-pre-line gap-[10px] flex flex-col">
<div className="gap-[2px]">
<div className="text-[10px] leading-[14px] style-Medium text-[#6666E5]">
{kind === "RE_PROPOSAL_CARD" ? "재제안" : "제안"}
Expand Down Expand Up @@ -242,7 +242,7 @@ export default function ProposalMessage(props: Props) {
{/* bubble + time */}
<div className="flex items-end gap-[8px] max-w-[calc(100%-48px)]">
{/* 왼쪽 제안 카드 */}
<div className="w-[240px] rounded-[10px] bg-[#FFFFFFCC] px-[10px] py-[10px] text-left break-words whitespace-pre-line gap-[10px] flex flex-col">
<div className="max-w-[240px] w-full rounded-[10px] bg-[#FFFFFFCC] px-[10px] py-[10px] text-left break-words whitespace-pre-line gap-[10px] flex flex-col">
<div className="gap-[2px]">
<div className="text-[10px] leading-[14px] style-Medium text-[#6666E5]">
제안
Expand Down
2 changes: 1 addition & 1 deletion app/routes/room/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export default function ChattingRoom({ roomId }: Props) {
}

return (
<div className="h-screen-full bg-gradient-to-b from-[#F6F6FF] via-[#F3F3FA] to-[#E8E8FB]">
<div className="h-screen-full bg-gradient-to-b from-[#F6F6FF] via-[#F3F3FA] to-[#E8E8FB] overflow-x-hidden">
<input
ref={imageInputRef}
type="file"
Expand Down
Loading