Skip to content

Commit

Permalink
Fix: 불필요한 Link 태그 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
Nahyun-Kang committed Dec 17, 2024
1 parent e1d1f5d commit c1a32e0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
5 changes: 5 additions & 0 deletions src/app/(home)/_components/FeedLists.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ import { vars } from '@/styles/__theme.css';

export const listBackground = createVar();

export const listItemWrapper = style({
cursor: 'pointer',
});

export const wrapperOuter = style({
padding: '0 16px 84px 16px',
marginTop: '12px',
Expand Down Expand Up @@ -112,6 +116,7 @@ export const profileImageWrapper = style({
height: '30px',

position: 'relative',
cursor: 'pointer',
});

export const ownerProfileImage = style({
Expand Down
18 changes: 10 additions & 8 deletions src/app/(home)/_components/FeedLists.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Link from 'next/link';
import { useInfiniteQuery } from '@tanstack/react-query';
import { useMemo } from 'react';
import { assignInlineVars } from '@vanilla-extract/dynamic';
import { useRouter } from 'next/navigation';

import SimpleList from '@/components/SimpleList/SimpleList';
import getRecentLists from '@/app/_api/home/getRecentLists';
Expand All @@ -20,6 +21,7 @@ import NoDataButton from '@/components/NoData/NoDataButton';
import { commonLocale } from '@/components/locale';
import { useLanguage } from '@/store/useLanguage';
import { useTab } from '@/store/useTab';
import useMoveToPage from '@/hooks/useMoveToPage';

interface FeedListsType {
category?: string;
Expand All @@ -29,6 +31,7 @@ interface FeedListsType {
function FeedLists({ category, tab = 'recent' }: FeedListsType) {
const current_QueryKey = tab === 'recent' ? [QUERY_KEYS.getRecentLists, category] : [QUERY_KEYS.getFollowingLists];
const { setCurrentTab } = useTab();
const { onClickMoveToPage } = useMoveToPage();

//리스트 무한스크롤 리액트 쿼리 함수
const {
Expand Down Expand Up @@ -82,11 +85,9 @@ function FeedLists({ category, tab = 'recent' }: FeedListsType) {
{feedLists && feedLists?.length !== 0 ? (
feedLists?.map((item, index) => {
return (
<Link href={`/list/${item.id}`} key={item.id}>
<li>
<FeedListItem item={item} index={index} />
</li>
</Link>
<li key={item.id} onClick={onClickMoveToPage(`/list/${item.id}`)} className={styles.listItemWrapper}>
<FeedListItem item={item} index={index} />
</li>
);
})
) : (
Expand Down Expand Up @@ -116,6 +117,7 @@ interface FeedListItemType {

function FeedListItem({ item, index }: FeedListItemType) {
const { language } = useLanguage();
const { onClickMoveToPage } = useMoveToPage();

const COLOR_INDEX = (num: number) => num % 5;

Expand All @@ -125,8 +127,8 @@ function FeedListItem({ item, index }: FeedListItemType) {
style={assignInlineVars({ [styles.listBackground]: exploreBackgroundColors[COLOR_INDEX(index)] })}
>
<div className={styles.listTopWrapper}>
<div className={styles.ownerInformationWrapper}>
<Link href={`/user/${item.ownerId}/mylist`} className={styles.profileImageWrapper}>
<div className={styles.ownerInformationWrapper} onClick={onClickMoveToPage(`/user/${item.ownerId}/mylist`)}>
<div className={styles.profileImageWrapper}>
{item?.ownerProfileImage ? (
<Image
src={item.ownerProfileImage}
Expand All @@ -150,7 +152,7 @@ function FeedListItem({ item, index }: FeedListItemType) {
sizes="100vw 100vh"
/>
)}
</Link>
</div>
<div className={styles.ownerNicknameText}>{item.ownerNickname}</div>
</div>
<div className={styles.version}>{`업데이트 ${item.updateCount}회째`}</div>
Expand Down
3 changes: 0 additions & 3 deletions src/app/(home)/_components/RecommendedUsers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,8 @@ import * as styles from './RecommendedUsers.css';
import { UserListsSkeleton } from './Skeleton';
import { commonLocale } from '@/components/locale';
import { useLanguage } from '@/store/useLanguage';
import useBooleanOutput from '@/hooks/useBooleanOutput';

function UsersRecommendation() {
const { language } = useLanguage();
const { isOn, handleSetOn, handleSetOff } = useBooleanOutput();
//zustand로 관리하는 user정보 불러오기
const { user: userMe } = useUser();
const myId = userMe.id;
Expand Down

0 comments on commit c1a32e0

Please sign in to comment.