Skip to content

Commit

Permalink
refactor: 검색 결과에 따른 컴포넌트 렌더링
Browse files Browse the repository at this point in the history
  • Loading branch information
HongBoogie committed Dec 5, 2024
1 parent 6d25cc8 commit 8d600e3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
4 changes: 2 additions & 2 deletions client/src/app/(domain)/search/feature/SearchContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { getSearchResult } from '@libs/actions';
import { Broadcast, User2 } from '@libs/internalTypes';
import { useSearchParams } from 'next/navigation';
import React, { useState, useEffect, useContext, createContext, PropsWithChildren, use } from 'react';
import React, { useState, useEffect } from 'react';
import Lives from '@components/livesGrid/Lives';
import clsx from 'clsx';
import no_result from '@assets/no_result.png';
Expand Down Expand Up @@ -38,7 +38,7 @@ const SearchController = ({ children }: Props) => {

useEffect(() => {
getSearchResults();
}, []);
}, [query]);

return (
<div className="flex w-full flex-col items-center">
Expand Down
15 changes: 0 additions & 15 deletions client/src/app/components/studio/StudioMoodDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,9 @@ type MoodProps = {

const StudioMoodDropdown = ({ setData, data, placeHolder }: MoodProps) => {
const moods = Object.values(MOODS_CATEGORY);
// const [selectedKey, setSelectedKey] = useState<string | null>(''); // <-
// const [selectedMoodCode, setSelectedMoodCode] = useState<MoodsCategoryKey>('unknown');

// const selectMood = (key: string) => {
// setSelectedKey(key);
// setData(key);
// };

const selectedMood = moods.find((m) => m.CODE === data);

// useEffect(() => {
// console.log(data);
// setSelectedKey(data);
// setSelectedMoodCode(moods.find((m) => m.CODE === data)?.CODE || 'unknown');
// }, [data]);

return (
<StudioDropdown>
{({ inputRef, inputValue, isFocused, handleChangeInput, handleFocusInput, blurDropdown }) => (
Expand All @@ -47,10 +34,8 @@ const StudioMoodDropdown = ({ setData, data, placeHolder }: MoodProps) => {
<StudioDropdown.Item
key={idx}
onClick={() => {
// selectMood(m.CODE);
setData(m.CODE);
blurDropdown();
// setSelectedMoodCode(m.CODE);
}}
>
<span>{m.NAME}</span>
Expand Down

0 comments on commit 8d600e3

Please sign in to comment.