Skip to content

Commit

Permalink
fix: 기존 썸네일 컴포넌트 사용처 수정
Browse files Browse the repository at this point in the history
#preview
  • Loading branch information
Miensoap committed Dec 2, 2024
1 parent a142d82 commit 4f50db4
Show file tree
Hide file tree
Showing 12 changed files with 44 additions and 39 deletions.
4 changes: 2 additions & 2 deletions frontend/src/components/Map/MapDetailBoard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import SideContainer from '@/components/common/SideContainer';
import Marker from '@/components/Marker/Marker';
import DeleteMapButton from './DeleteMapButton';
import EditMapButton from './EditMapButton';
import MapThumbnail from './MapThumbnail';
import ListItemThumbnail from '@/components/common/List/ListItemThumbnail';

type MapDetailBoardProps = {
mapData: Map;
Expand Down Expand Up @@ -54,7 +54,7 @@ const MapDetailBoard = ({ mapData }: MapDetailBoardProps) => {
)}

{mapData.thumbnailUrl.startsWith('https://example') ? (
<MapThumbnail className="h-full w-full" />
<ListItemThumbnail className="h-full w-full" />
) : (
<img src={mapData.thumbnailUrl} className="object-cover"></img>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ const CourseListPanel: React.FC<CourseListPanelProps> = ({ query }) => {
<InfiniteListPanel
data={courseItems}
ref={ref}
renderItem={(course) => <CourseItem key={course.id} courseItem={course} />}
renderItem={(course) => (
<CourseItem key={course.id} courseItem={course} />
)}
className="max-h-[700px] p-5"
/>
);
Expand Down
26 changes: 14 additions & 12 deletions frontend/src/components/common/List/ListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,22 @@ type ListItemProps<T> = {
linkPrefix: string;
};

const ListItem = <T extends {
id: number;
title: string;
thumbnailUrl: string;
user: { profileImageUrl: string; nickname: string };
pinCount: number
}>({
item,
linkPrefix,
}: ListItemProps<T>) => {
const ListItem = <
T extends {
id: number;
title: string;
thumbnailUrl: string;
user: { profileImageUrl: string; nickname: string };
pinCount: number;
},
>({
item,
linkPrefix,
}: ListItemProps<T>) => {
return (
<Link to={`/${linkPrefix}/${item.id}`}>
<div className="flex h-50 flex-col gap-2 rounded-md border-[1.5px] border-gray-200 p-3">
<div className="w-full aspect-[4/3] overflow-hidden rounded-md bg-gray-100">
<div className="h-50 flex flex-col gap-2 rounded-md border-[1.5px] border-gray-200 p-3">
<div className="aspect-[4/3] w-full overflow-hidden rounded-md bg-gray-100">
{item.thumbnailUrl.startsWith('https://example') ? (
<ListItemThumbnail className="h-full w-full object-cover" />
) : (
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/common/List/ListItemThumbnail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ type ListItemThumbnailProps = {
};

const ListItemThumbnail = ({
thumbnailUrl = `https://kr.object.ncloudstorage.com/ogil-public/uploads/default_thumbnail/default_3.webp`,
className,
}: ListItemThumbnailProps) => {
thumbnailUrl = `https://kr.object.ncloudstorage.com/ogil-public/uploads/default_thumbnail/default_3.webp`,
className,
}: ListItemThumbnailProps) => {
return (
<div className={className}>
<img src={thumbnailUrl} alt="썸네일" />
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/components/common/List/ListToggleButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ interface ToggleButtonProps {
}

const ToggleButton: React.FC<ToggleButtonProps> = ({
options,
selected,
onSelect,
}) => {
options,
selected,
onSelect,
}) => {
return (
<div className="relative flex h-[45px] w-[700px] rounded-md bg-gray-200 shadow-inner">
<div
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/components/common/SearchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ const SearchBar: React.FC<SearchBarProps> = ({ onSearch, query }) => {
};

return (
<div
className="relative flex h-12 w-[500px] items-center justify-between overflow-hidden rounded-md border-[1.33px] border-c_brand_BLUE bg-[#f9f9f9] px-4">
<div className="relative flex h-12 w-[500px] items-center justify-between overflow-hidden rounded-md border-[1.33px] border-c_brand_BLUE bg-[#f9f9f9] px-4">
<input
type="text"
placeholder={query || '검색어를 입력해주세요'}
Expand Down
15 changes: 8 additions & 7 deletions frontend/src/pages/HomePage/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ const Header = () => {
return (
<header className="bg-white shadow-md">
<div className="container mx-auto flex items-center justify-between px-6 py-4">
<img src={logo}
alt="Logo"
className="h-8 w-auto cursor-pointer"
onClick={() => {
window.location.href = '/';
}}>
</img>
<img
src={logo}
alt="Logo"
className="h-8 w-auto cursor-pointer"
onClick={() => {
window.location.href = '/';
}}
></img>
<Suspense fallback={<div>Loading...</div>}>
<LoginButtons />
</Suspense>
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/pages/HomePage/LogOutButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ const LogOutButton = () => {
};
return (
<button
className="bg-c_bg_blue text-white rounded-md p-2 px-4 h-12 w-36"
onClick={onClick}>
className="h-12 w-36 rounded-md bg-c_bg_blue p-2 px-4 text-white"
onClick={onClick}
>
로그아웃
</button>
);
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/pages/HomePage/LoginButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ const LoginButtons = () => {
{!isLogged ? (
<div className="flex justify-between gap-5">
<button
className="bg-c_bg_blue text-white rounded-md p-2 px-4 h-12 w-36"
onClick={handleLogin}>
className="h-12 w-36 rounded-md bg-c_bg_blue p-2 px-4 text-white"
onClick={handleLogin}
>
구글 로그인
</button>
</div>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/HomePage/MainListPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const MainListPanel = () => {
onSelect={(value) => setListTab(value as CreateMapType)}
/>

<div className="w-[1200px] mt-1">
<div className="mt-1 w-[1200px]">
{listTab === 'MAP' ? <MapListPanel /> : <CourseListPanel />}
</div>
</div>
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/pages/HomePage/UserProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ type UserProfileProps = {

const UserProfile = ({ user }: UserProfileProps) => {
return (
<div
className="flex items-center justify-between gap-4 rounded-lg border-[1px] border-c_button_gray p-2 px-4 h-12 w-36">
<div className="flex h-12 w-36 items-center justify-between gap-4 rounded-lg border-[1px] border-c_button_gray p-2 px-4">
<img
alt={`${user.nickname}님의 프로필 사진`}
className="h-8 w-8 rounded-full"
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/SearchPage/SearchListPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const SearchListPanel: React.FC<SearchListPanelProps> = ({ query }) => {
onSelect={(value) => setListTab(value as CreateMapType)}
/>

<div className="w-[1200px] mt-1">
<div className="mt-1 w-[1200px]">
{listTab === 'MAP' ? (
<MapListPanel query={query} />
) : (
Expand Down

0 comments on commit 4f50db4

Please sign in to comment.