diff --git a/src/api/getProducts.js b/src/api/getProducts.js index f30d059..8af029c 100644 --- a/src/api/getProducts.js +++ b/src/api/getProducts.js @@ -1,8 +1,4 @@ -<<<<<<< HEAD -const BASE_URL = 'https://panda-market-api.vercel.app/products'; -======= const BASE_URL = "https://backend-c2ut.onrender.com"; ->>>>>>> 0f1a9c4 (refactor: sprint5 코멘트 반영) export async function getProducts( @@ -10,23 +6,13 @@ export async function getProducts( offset = 0, limit = 10, page = 1, -<<<<<<< HEAD - pageSize = 10, - sort = 'recent', -======= sort = "recent", ->>>>>>> 0f1a9c4 (refactor: sprint5 코멘트 반영) keyword = "", } ) { const query = `offset=${offset}&limit=${limit}&page=${page}&pageSize=${pageSize}&orderBy=${sort}&keyword=${keyword}`; const response = await fetch(`${BASE_URL}?${query}`); const data = await response.json(); -<<<<<<< HEAD - - console.log("Fetched products:", data); -======= ->>>>>>> 0f1a9c4 (refactor: sprint5 코멘트 반영) return data; } diff --git a/src/components/App.js b/src/components/App.js index 5c1014a..747278d 100644 --- a/src/components/App.js +++ b/src/components/App.js @@ -1,14 +1,3 @@ -<<<<<<< HEAD:src/components/App.js -import './App.css'; -import NavBar from './NavBar'; -import Footer from './Footer'; -import BestProducts from './BestProducts'; -import { OnSaleProducts } from './OnSaleProducts'; -import { useState } from 'react'; -import SearchBar from './SearchBar'; -import Pagination from './Pagination'; -import DropDown from './DropDown'; -======= import "../styles/ItemPage.css"; import NavBar from "../components/NavBar"; import Footer from "../components/Footer"; @@ -19,7 +8,6 @@ import SearchBar from "../components/SearchBar"; import Pagination from "../components/Pagination"; import DropDown from "../components/DropDown"; import { NavLink } from "react-router-dom"; ->>>>>>> 0f1a9c4 (refactor: sprint5 코멘트 반영):src/pages/ItemPage.js function App() { diff --git a/src/components/BestProducts.js b/src/components/BestProducts.js index c6b5a1d..52b991a 100644 --- a/src/components/BestProducts.js +++ b/src/components/BestProducts.js @@ -1,16 +1,9 @@ import { useEffect, useState } from "react"; import "./BestProducts.css"; import { getProducts } from "../api/getProducts"; -<<<<<<< HEAD -import "./BestProducts.css"; -import "../images/empty_heart.png"; -import IsImage from "./IsImage"; -import "../images/no-image-available.png"; -======= import "../images/emptyHeart.png"; import IsImage from "../utils/image.helper"; import "../images/noImageAvailable.png"; ->>>>>>> 0f1a9c4 (refactor: sprint5 코멘트 반영) export function BestProducts() { diff --git a/src/components/DropDown.js b/src/components/DropDown.js index 8607c7e..7f9bf6c 100644 --- a/src/components/DropDown.js +++ b/src/components/DropDown.js @@ -1,12 +1,7 @@ -<<<<<<< HEAD -import React, { useState } from 'react'; -import './DropDown.css'; -======= import React, { useState } from "react"; import "../styles/DropDown.css"; import DropdownToggle from "./DropdownToggle"; import DropdownContent from "./DropdownContent"; ->>>>>>> 0f1a9c4 (refactor: sprint5 코멘트 반영) function DropDown({ options = [], onSelect }) { const [isOpen, setIsOpen] = useState(false); diff --git a/src/components/Footer.js b/src/components/Footer.js index 4124817..0cf631c 100644 --- a/src/components/Footer.js +++ b/src/components/Footer.js @@ -1,16 +1,8 @@ -<<<<<<< HEAD -import instagram from '../images/ic_instagram.png'; -import facebook from '../images/ic_facebook.png'; -import twitter from '../images/ic_twitter.png'; -import youtube from '../images/ic_youtube.png'; -import './Footer.css'; -======= import instagram from "../images/ic_instagram.png"; import facebook from "../images/ic_facebook.png"; import twitter from "../images/ic_twitter.png"; import youtube from "../images/ic_youtube.png"; import "../styles/Footer.css"; ->>>>>>> 0f1a9c4 (refactor: sprint5 코멘트 반영) export function Footer() { return ( diff --git a/src/components/OnSaleProducts.js b/src/components/OnSaleProducts.js index 5441e6a..0c31a7f 100644 --- a/src/components/OnSaleProducts.js +++ b/src/components/OnSaleProducts.js @@ -1,12 +1,7 @@ // import Product from "./ProductList"; import "../images/search.png"; -<<<<<<< HEAD -import "./OnSaleProducts.css"; -import "../images/empty_heart.png"; -======= import "../styles/OnSaleProducts.css"; import "../images/emptyHeart.png"; ->>>>>>> 0f1a9c4 (refactor: sprint5 코멘트 반영) import { useState, useEffect } from "react"; import getProducts from "../api/getProducts"; import IsImage from "../utils/image.helper"; @@ -25,12 +20,6 @@ export function OnSaleProducts({ sort, page, keyword }) { const pageSize = input ? 10000 : 10; getProducts({ page, pageSize, sort: sortingType, keyword: input }) .then((data) => { -<<<<<<< HEAD - setOnSaleProducts(data.list); - data.list.forEach(product => { - if (!IsImage(String(product.images))) { - product.images = no_image_available; -======= if (!data.products || !Array.isArray(data.products)) { throw new Error("Invalid products data"); } @@ -39,7 +28,6 @@ export function OnSaleProducts({ sort, page, keyword }) { data.products.forEach(product => { if (!product.images || !IsImage(product.images)) { product.images = noImageAvailable; ->>>>>>> 0f1a9c4 (refactor: sprint5 코멘트 반영) } }); }) @@ -68,13 +56,8 @@ export function OnSaleProducts({ sort, page, keyword }) { { filteredProducts.length > 0 ? ( filteredProducts.map((product) => ( -<<<<<<< HEAD -
{product.price.toLocaleString()}원
diff --git a/src/components/Pagination.js b/src/components/Pagination.js index 0ebd2a1..61720c7 100644 --- a/src/components/Pagination.js +++ b/src/components/Pagination.js @@ -1,10 +1,5 @@ -<<<<<<< HEAD -import { useState, useEffect } from 'react'; -import './Pagination.css'; -======= import { useState, useEffect } from "react"; import "../styles/Pagination.css"; ->>>>>>> 0f1a9c4 (refactor: sprint5 코멘트 반영) export function Pagination({ onPageChange }) { diff --git a/src/components/RegistrationForm.js b/src/components/RegistrationForm.js index d7862d7..2731221 100644 --- a/src/components/RegistrationForm.js +++ b/src/components/RegistrationForm.js @@ -1,4 +1,3 @@ -import React, { useState } from "react"; import "../styles/RegistrationForm.css"; import { useNavigate } from "react-router-dom";