Skip to content

Commit

Permalink
refactor: conflicts 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
CisThard committed Dec 9, 2024
1 parent c8dccb3 commit 18b2804
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 69 deletions.
14 changes: 0 additions & 14 deletions src/api/getProducts.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,18 @@
<<<<<<< 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(
{
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;
}
Expand Down
12 changes: 0 additions & 12 deletions src/components/App.js
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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() {

Expand Down
7 changes: 0 additions & 7 deletions src/components/BestProducts.js
Original file line number Diff line number Diff line change
@@ -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() {

Expand Down
5 changes: 0 additions & 5 deletions src/components/DropDown.js
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
8 changes: 0 additions & 8 deletions src/components/Footer.js
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down
17 changes: 0 additions & 17 deletions src/components/OnSaleProducts.js
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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");
}
Expand All @@ -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 코멘트 반영)
}
});
})
Expand Down Expand Up @@ -68,13 +56,8 @@ export function OnSaleProducts({ sort, page, keyword }) {
{
filteredProducts.length > 0 ? (
filteredProducts.map((product) => (
<<<<<<< HEAD
<div className="on-sale-product-card" key={product.id}>
<img className="on-sale-product-image" src={product.images || no_image_available} alt={product.name} />
=======
<div className="on-sale-product-card" key={product._id}>
<img className="on-sale-product-image" src={product.images || noImageAvailable} alt={product.name} />
>>>>>>> 0f1a9c4 (refactor: sprint5 코멘트 반영)
<div className="on-sale-product-info">
<h3>{product.name}</h3>
<p>{product.price.toLocaleString()}</p>
Expand Down
5 changes: 0 additions & 5 deletions src/components/Pagination.js
Original file line number Diff line number Diff line change
@@ -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 }) {
Expand Down
1 change: 0 additions & 1 deletion src/components/RegistrationForm.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React, { useState } from "react";
import "../styles/RegistrationForm.css";
import { useNavigate } from "react-router-dom";

Expand Down

0 comments on commit 18b2804

Please sign in to comment.