Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

결과페이지 첫 방문시에만 Tooltip 보이도록 수정 #458

Merged
merged 2 commits into from
Nov 7, 2023
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
1 change: 1 addition & 0 deletions src/constants/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ export const LOCAL_STORAGE_KEY = {
reviewShortQuestionMessages: 'nlasq',
surveyCustomQuestions: 'nlascq',
surveyCreateSurveyRequest: 'nlascsr',
resultRevisit: 'nlarv',
Copy link
Member

Choose a reason for hiding this comment

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

👍 👍 👍

} as const;
12 changes: 6 additions & 6 deletions src/pages/result/SurveyIdLoaded.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import Pill, { type Color } from '~/components/pill/Pill';
import Toast from '~/components/toast/Toast';
import useToast from '~/components/toast/useToast';
import { defaultEasing } from '~/constants/motions';
import { LOCAL_STORAGE_KEY } from '~/constants/storage';
import CollaborationCounter from '~/features/feedback/CollaborationCounter';
import Feedback from '~/features/feedback/Feedback';
import NewFeedbackCopyButton from '~/features/feedback/NewFeedbackCopyButton';
Expand All @@ -34,6 +35,8 @@ import useGetReviewersSummaryBySurveyId from '~/hooks/api/reviewers/useGetReview
import useBoolean from '~/hooks/common/useBoolean';
import useScrollLock from '~/hooks/common/useScrollLock';
import { useScrollSpy } from '~/hooks/common/useScrollSpy';
import useWillUnmount from '~/hooks/lifeCycle/useWillUnmount';
import useLocalStorage from '~/hooks/storage/useLocalStorage';
import { BODY_2_REGULAR, HEAD_1, HEAD_2_BOLD } from '~/styles/typo';

interface Props {
Expand All @@ -44,6 +47,8 @@ const PILL_COLORS: Color[] = ['bluegreen', 'pink', 'skyblue', 'yellowgreen', 'pu

const SurveyIdLoaded = ({ surveyId }: Props) => {
const { fireToast } = useToast();
const [isRevisit, setIsRevisit] = useLocalStorage<boolean>(LOCAL_STORAGE_KEY.resultRevisit, false);
useWillUnmount(() => !isRevisit && setIsRevisit(true));

const { isLoading: isFeedbackSummaryLoading, data: feedbackSummaryData } = useGetFeedbackSummaryBySurveyId(surveyId);
const { isLoading: isReviewersSummaryLoading, data: reviewersSummaryData } =
Expand Down Expand Up @@ -248,7 +253,7 @@ const SurveyIdLoaded = ({ surveyId }: Props) => {
reviewer={feedback.reviewer}
is_bookmarked={feedback.bookmark.is_bookmarked}
isBookmarkable={true}
withBookmarkTooltip={index === 0 ? true : false}
withBookmarkTooltip={index === 0 && !isRevisit ? true : false}
/>
))}
</div>
Expand Down Expand Up @@ -282,7 +287,6 @@ const emptyFeedbackWrapperCss = css`

const emptyTextCss = (theme: Theme) => css`
${HEAD_2_BOLD};

color: ${theme.colors.gray_400};
`;

Expand Down Expand Up @@ -340,23 +344,20 @@ const ResearchMoveAnchorCss = (innerWidth: number) => css`

const titleCss = css`
${HEAD_1}

margin: 16px 0;
`;

const choiceQuestionTitleCss = css`
display: flex;
gap: 12px;
${HEAD_1}

margin: 16px 0;
`;

const shortQuestionTitleCss = css`
display: flex;
gap: 12px;
${HEAD_1}

margin: 16px 7px;
`;

Expand Down Expand Up @@ -403,7 +404,6 @@ const floatingKeyframes = keyframes`

const bubbleSpanCss = (theme: Theme) => css`
${BODY_2_REGULAR};

position: absolute;
top: -100%;
left: 50%;
Expand Down
Loading