Skip to content
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
Binary file removed img/.DS_Store
Binary file not shown.
3 changes: 0 additions & 3 deletions img/OG_img.svg

This file was deleted.

14 changes: 0 additions & 14 deletions img/panda_logo_img.svg

This file was deleted.

Binary file removed img/root_img/.DS_Store
Binary file not shown.
15 changes: 0 additions & 15 deletions img/root_img/판다마켓텍스트로고.svg

This file was deleted.

6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"firebase": "^11.1.0",
"lodash.throttle": "^4.1.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^7.1.1",
Expand Down
4 changes: 2 additions & 2 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Outlet } from "react-router-dom";
import React from "react";
import Nav from "./components/Nav";
import Nav from "./components/common/Layout/Nav";
import styled from "styled-components";

const Contents = styled.div`
Expand All @@ -10,7 +10,7 @@ const Contents = styled.div`
function App() {
return (
<div>
<Nav></Nav>
<Nav />
<Contents>
<Outlet />
</Contents>
Expand Down
30 changes: 15 additions & 15 deletions src/Hooks/useWindowSize.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
import { useState, useEffect } from "react";

const useWindowSize = () => {
import throttle from "lodash.throttle";
export default function useWindowSize() {
const [deviceType, setDeviceType] = useState("desktop");
const handleResize = () => {
if (window.matchMedia("(max-width: 767px)").matches) {
setDeviceType("mobile");
} else if (window.matchMedia("(max-width: 1199px)").matches) {
setDeviceType("tablet");
} else {
setDeviceType("desktop");
}
};

//
useEffect(() => {
const handleResize = throttle(() => {
if (window.matchMedia("(max-width: 375px)").matches) {
setDeviceType("mobile");
return;
}
if (window.matchMedia("(max-width: 768px)").matches) {
setDeviceType("tablet");
return;
}
setDeviceType("desktop");
}, 2000);
handleResize();
window.addEventListener("resize", handleResize);
return () => {
window.removeEventListener("resize", handleResize);
};
}, []);
return deviceType;
};

export default useWindowSize;
}
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
14 changes: 14 additions & 0 deletions src/assets/Logo/pandaLogo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
10 changes: 0 additions & 10 deletions src/assets/ic_google.svg

This file was deleted.

Loading
Loading