Skip to content

Comments

검색페이지 whereFrom, 팔로우/팔로잉페이지 isFollower persist설정 삭제#136

Open
gangpyono wants to merge 9 commits intodevfrom
gangpyo
Open

검색페이지 whereFrom, 팔로우/팔로잉페이지 isFollower persist설정 삭제#136
gangpyono wants to merge 9 commits intodevfrom
gangpyo

Conversation

@gangpyono
Copy link
Member

기존에 persist를 사용하여 어떤 페이지로부터 왔는지에대한 정보를 담은 변수들을 제거하고 path주소에 변수를 설정하여 페이지를 유지시키는방식으로 변경했습니다.
최근검색목록도 로컬 스토리지에서 관리중인데 이건 서버분들이랑 api설계 떄문에 우선은 기존방식으로 설정해놓았습니다.

component={UserPageFollowList}
/>
<PrivateRoute path="/searchmain" component={SearchMain} />
<PrivateRoute path="/searchmain/:wherefrom" component={SearchMain} />
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

검색페이지를 담당하는 컴포넌트의 path주소마지막에 변수를 설정해준다.

<SearchIcon
onClick={() => {
history.push("/searchmain");
history.push("/searchmain/cafeboard");
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

카페 후기메인페이지에서 이동했을떄.

<SearchIcon
onClick={() => {
history.push("/Searchmain");
history.push("/Searchmain/bulletinboard");
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

자유게시판 후기메인페이지에서 이동했을떄.

const [popUp, setPopUp] = useState(false);

// 검색페이지를올떄 자유게시판에서 왔는지, 카페 후기게시판에서왔는지를 판단하기위함.
const whereFrom = useParams().wherefrom;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useParans훅을 이용하여 해당하는 값을 받아올 수 있어, 이를 활용하여 분기처리시의 기준값으로 설정해줌.

@khakaa
Copy link
Member

khakaa commented Jan 18, 2022

확인했습니다!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants