Skip to content

Commit

Permalink
Fix: 다른 시리즈에 속한 메모 필터링, 검색 반복하면 여러개 메모카드 추가되는 문제 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
dongree committed Oct 17, 2023
1 parent c1ad2a0 commit 567c1a0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/app/create/series/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import { ACCESS_TOKEN, REFRESH_TOKEN } from '@/utils/const';
import { cookies } from 'next/headers';

export default async function CreateSeriesPage() {
const accessToken = cookies().get(ACCESS_TOKEN)?.value;
const accessToken =
'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiI2OTciLCJhdXRoIjoiIiwiZXhwIjoxNjk3NTIxMjgzfQ.7UQz_iUKsIkYyAvmBOv4aGA2Wa7Qzvld5uWs9EVlMUvCUxctqJ4PsXJX9caPn4FIWa9Fl-buWXhg9MLrkfJpGg';
const refreshToken = cookies().get(REFRESH_TOKEN)?.value;
const cookie = `${ACCESS_TOKEN}=${accessToken}; ${REFRESH_TOKEN}=${refreshToken}`;

Expand Down
1 change: 1 addition & 0 deletions src/components/create/series/AddMemoContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export default function AddMemoContainer({
return;
}
setMemos(res);
setSelectedMemos([]);
}
);
}, [realSearchString]);
Expand Down
13 changes: 10 additions & 3 deletions src/components/create/series/SelectCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type Props = {

export default function SelectCard({ memo, onClick }: Props) {
const [selected, setSelected] = useState(false);
const { memoTitle, memoDescription, memoColor } = memo;
const { memoTitle, memoDescription, memoColor, seriesId } = memo;

const handleClick = () => {
setSelected((pre) => !pre);
Expand All @@ -20,7 +20,9 @@ export default function SelectCard({ memo, onClick }: Props) {
<article
className={`flex flex-col relative rounded-md shadow-md aspect-square p-2 ${
selected ? 'brightness-75' : ''
} ${
}
${seriesId ? 'pointer-events-none brightness-50' : ''}
${
{
white: 'bg-soma-white',
yellow: 'bg-memo-yellow',
Expand All @@ -35,12 +37,17 @@ export default function SelectCard({ memo, onClick }: Props) {
onClick={handleClick}
>
<div className="self-end text-soma-blue-40">
{selected ? (
{seriesId ? (
<div className="text-xs h-5 font font-medium">
다른 시리즈에 속한 메모
</div>
) : selected ? (
<AiFillCheckCircle className="w-5 h-5" />
) : (
<AiOutlineCheckCircle className="w-5 h-5" />
)}
</div>

<div className="w-full flex-1">
<h2 className="text-xl text-soma-grey-70 font-extrabold my-3 line-clamp-2 break-all h-14">
{memoTitle}
Expand Down

0 comments on commit 567c1a0

Please sign in to comment.