diff --git a/src/api/fetchData.tsx b/src/api/fetchData.tsx
index b3afa69..e9f14fa 100644
--- a/src/api/fetchData.tsx
+++ b/src/api/fetchData.tsx
@@ -5,7 +5,13 @@ const API_BASE_URL = "http://3.35.123.253/api";
export const fetchData = async (endpoint: string) => {
const storedAuth = localStorage.getItem("auth");
const auth = storedAuth ? JSON.parse(storedAuth) : null;
- const majorId = auth ? auth.major_id : null;
+ let majorId = auth ? auth.major_id : null;
+
+ if (!majorId) {
+ const selectedMajorId = localStorage.getItem("selected_major_id");
+ majorId = selectedMajorId ? parseInt(selectedMajorId) : null;
+ }
+
try {
const response = await axios.get(`${API_BASE_URL}/${majorId}${endpoint}`);
return response.data;
@@ -14,6 +20,32 @@ export const fetchData = async (endpoint: string) => {
}
};
+export const fetchNoMajorData = async (endpoint: string) => {
+ try {
+ const response = await axios.get(`${API_BASE_URL}${endpoint}`);
+ return response.data;
+ } catch (error) {
+ console.log(error);
+ }
+};
+
+export const fetchNoMajorTokenData = async (endpoint: string) => {
+ const storedAuth = localStorage.getItem("auth");
+ const auth = storedAuth ? JSON.parse(storedAuth) : null;
+ const accessToken = auth ? auth.access_token : null;
+
+ try {
+ const response = await axios.get(`${API_BASE_URL}${endpoint}`, {
+ headers: {
+ Authorization: `Bearer ${accessToken}`,
+ },
+ });
+ return response.data;
+ } catch (error) {
+ console.log(error);
+ }
+};
+
export const fetchTokenData = async (endpoint: string) => {
const storedAuth = localStorage.getItem("auth");
const auth = storedAuth ? JSON.parse(storedAuth) : null;
diff --git a/src/api/postData.tsx b/src/api/postData.tsx
index a3cfcca..bf35fc2 100644
--- a/src/api/postData.tsx
+++ b/src/api/postData.tsx
@@ -5,11 +5,12 @@ const API_BASE_URL = "http://3.35.123.253/api";
export const postData = async (endpoint: string, data: any) => {
try {
const response = await axios.post(`${API_BASE_URL}${endpoint}`, data);
- console.log("서버로부터의 응답:", response.data);
+ // console.log("서버로부터의 응답:", response.data);
return response.data;
- } catch (error) {
- console.log(error);
- console.log(data);
+ } catch (error: any) {
+ // console.log(error);
+ // console.log(data);
+ return error;
}
};
diff --git a/src/assets/icon/nobook.svg b/src/assets/icon/nobook.svg
new file mode 100644
index 0000000..51650e6
--- /dev/null
+++ b/src/assets/icon/nobook.svg
@@ -0,0 +1,3 @@
+
diff --git a/src/components/community/CommunityMain.tsx b/src/components/community/CommunityMain.tsx
index 39bfebb..2568bd1 100644
--- a/src/components/community/CommunityMain.tsx
+++ b/src/components/community/CommunityMain.tsx
@@ -23,8 +23,11 @@ const CommunityMain = () => {
endpoint = `/boards/posts/search/?keyword=${searchKeyword}`;
}
const data = await fetchData(endpoint);
- if (data) {
- setCommunityData(data.sort((a: any, b: any) => b.id - a.id));
+ // if (data) {
+ // setCommunityData(data.sort((a: any, b: any) => b.id - a.id));
+ // }
+ if (Array.isArray(data)) {
+ setCommunityData(data.sort((a, b) => b.id - a.id));
}
};
@@ -42,7 +45,8 @@ const CommunityMain = () => {
setSearchKeyword(event.target.value);
};
- const handleSearchClick = () => {
+ const handleSearchClick = (event: React.FormEvent) => {
+ event.preventDefault();
setIsSearching(true);
};
@@ -56,15 +60,17 @@ const CommunityMain = () => {
return (
-
+
+
+
- {
대외활동
- setSelectedCategory("우리학교는")}
- className={selectedCategory === "우리학교는" ? "selected" : ""}
+ onClick={() => setSelectedCategory("학교이야기")}
+ className={selectedCategory === "학교이야기" ? "selected" : ""}
>
- 우리학교는
+ 학교이야기
diff --git a/src/components/home/HomeLogin.tsx b/src/components/home/HomeLogin.tsx
index bc283d4..cf26480 100644
--- a/src/components/home/HomeLogin.tsx
+++ b/src/components/home/HomeLogin.tsx
@@ -7,6 +7,7 @@ import { useAuth } from "../../hooks/useAuth";
const HomeLogin = () => {
const [username, setUsername] = useState("");
const [password, setPassword] = useState("");
+ const [errorMessage, setErrorMessage] = useState("");
const navigate = useNavigate();
const { login } = useAuth();
@@ -26,23 +27,32 @@ const HomeLogin = () => {
password,
};
- const response = await postData("/login/", loginData);
+ try {
+ const response = await postData("/login/", loginData);
- if (response) {
- const data = await response.token;
- login(
- data.access,
- data.refresh,
- data.user_name,
- data.school_name,
- data.major_name,
- data.admission_date,
- data.user_id,
- data.major_id
+ if (response) {
+ const data = await response.token;
+ login(
+ data.access,
+ data.refresh,
+ data.user_name,
+ data.school_name,
+ data.major_name,
+ data.admission_date,
+ data.user_id,
+ data.major_id,
+ data.major_category_name
+ );
+ // alert("로그인에 성공하였습니다.");
+ navigate("/main");
+ window.location.reload();
+ } else {
+ throw new Error("Invalid response");
+ }
+ } catch (error) {
+ setErrorMessage(
+ "로그인에 실패했습니다. 아이디와 비밀번호를 확인해주세요."
);
- alert("로그인에 성공하였습니다.");
- navigate("/main");
- window.location.reload();
}
};
@@ -69,6 +79,7 @@ const HomeLogin = () => {
value={password}
onChange={handleInputChange}
/>
+ {errorMessage &&
{errorMessage}
}
diff --git a/src/components/home/HomeSearch.tsx b/src/components/home/HomeSearch.tsx
index fe72cb3..7fd47b8 100644
--- a/src/components/home/HomeSearch.tsx
+++ b/src/components/home/HomeSearch.tsx
@@ -1,10 +1,25 @@
-import "../../styles/home/HomeSearch.scss";
import { ReactComponent as SearchIcon } from "../../assets/icon/search.svg";
+import "../../styles/home/HomeSearch.scss";
import { useNavigate } from "react-router-dom";
+import { useState, useEffect } from "react";
+import { fetchNoMajorData } from "../../api/fetchData";
+import { MajorData } from "../../types/Types";
const HomeSearch = () => {
+ const [majorData, setMajorData] = useState([]);
const navigate = useNavigate();
- const goMain = () => {
+
+ useEffect(() => {
+ const fetchMajorData = async () => {
+ const data = await fetchNoMajorData("/majors/");
+ if (data) {
+ setMajorData(data);
+ }
+ };
+ fetchMajorData();
+ }, []);
+ const goMain = (majorId: number) => {
+ localStorage.setItem("selected_major_id", majorId.toString());
navigate("/main");
};
return (
@@ -14,32 +29,16 @@ const HomeSearch = () => {
-
-
IT
-
- 컴퓨터공학, 소프트웨어, 정보통신, 정보보호, IT융합, 멀티미디어
-
-
-
-
경영경제
-
경영, 회계, 마케팅, 금융, 경제
-
-
-
인문사회과학
-
국어국문, 영어영문, 사회학, 심리학, 정치외교, 사학,
-
-
-
공과
-
전자공학, 기계공학, 화학공학, 건축공학, 신소재공학
-
-
-
자연과학
-
물리학, 화학, 생물학, 지구과학, 수학, 통계학
-
-
-
예술대학
-
미술, 패션디자인, 음악, 연극영화, 무용
-
+ {majorData.map((item, index) => (
+
goMain(item.id)}
+ >
+
{item.major_category_name}
+
{item.major}
+
+ ))}
);
};
diff --git a/src/components/login/LoginForm.tsx b/src/components/login/LoginForm.tsx
index c0d85af..64fb8d2 100644
--- a/src/components/login/LoginForm.tsx
+++ b/src/components/login/LoginForm.tsx
@@ -8,6 +8,7 @@ import { useAuth } from "../../hooks/useAuth";
const LoginForm = () => {
const [username, setUsername] = useState("");
const [password, setPassword] = useState("");
+ const [errorMessage, setErrorMessage] = useState("");
const navigate = useNavigate();
const { login } = useAuth();
@@ -27,23 +28,32 @@ const LoginForm = () => {
password,
};
- const response = await postData("/login/", loginData);
+ try {
+ const response = await postData("/login/", loginData);
- if (response) {
- const data = await response.token;
- login(
- data.access,
- data.refresh,
- data.user_name,
- data.school_name,
- data.major_name,
- data.admission_date,
- data.user_id,
- data.major_id
+ if (response && response.token) {
+ const data = response.token;
+ login(
+ data.access,
+ data.refresh,
+ data.user_name,
+ data.school_name,
+ data.major_name,
+ data.admission_date,
+ data.user_id,
+ data.major_id,
+ data.major_category_name
+ );
+ // alert("로그인에 성공하였습니다.");
+ navigate("/main");
+ window.location.reload();
+ } else {
+ throw new Error("Invalid response");
+ }
+ } catch (error) {
+ setErrorMessage(
+ "로그인에 실패했습니다. 아이디와 비밀번호를 확인해주세요."
);
- alert("로그인에 성공하였습니다.");
- navigate("/main");
- window.location.reload();
}
};
@@ -79,6 +89,7 @@ const LoginForm = () => {
+ {errorMessage && {errorMessage}
}
diff --git a/src/components/mypage/MyInfo.tsx b/src/components/mypage/MyInfo.tsx
index f841f48..af6b490 100644
--- a/src/components/mypage/MyInfo.tsx
+++ b/src/components/mypage/MyInfo.tsx
@@ -5,7 +5,7 @@ import { ReactComponent as SchoolIcon } from "../../assets/icon/school.svg";
import { ReactComponent as EmailIcon } from "../../assets/icon/email.svg";
import "../../styles/mypage/MyInfo.scss";
import { useState, useEffect } from "react";
-import { fetchTokenData } from "../../api/fetchData";
+import { fetchNoMajorTokenData } from "../../api/fetchData";
import { UserInfo } from "../../types/Types";
const MyInfo = () => {
@@ -16,7 +16,7 @@ const MyInfo = () => {
const storedAuth = localStorage.getItem("auth");
const auth = storedAuth ? JSON.parse(storedAuth) : null;
const userId = auth ? auth.user_id : null;
- const data = await fetchTokenData(`/profile/users/${userId}/`);
+ const data = await fetchNoMajorTokenData(`/profile/users/${userId}/`);
if (data) {
setUserData(data);
}
diff --git a/src/components/mypage/MyPost.tsx b/src/components/mypage/MyPost.tsx
index 3d7eee3..f12a064 100644
--- a/src/components/mypage/MyPost.tsx
+++ b/src/components/mypage/MyPost.tsx
@@ -6,7 +6,7 @@ import "../../styles/mypage/MyPost.scss";
import { useState, useEffect } from "react";
import { useNavigate } from "react-router-dom";
import { StudyData, CommunityData } from "../../types/Types";
-import { fetchTokenData } from "../../api/fetchData";
+import { fetchNoMajorTokenData } from "../../api/fetchData";
const MyPost = () => {
const [selectedSection, setSelectedSection] = useState("study");
@@ -15,7 +15,7 @@ const MyPost = () => {
const navigate = useNavigate();
const fetchData = async (endpoint: string) => {
- const response = await fetchTokenData(endpoint);
+ const response = await fetchNoMajorTokenData(endpoint);
const data = response ? response.sort((a: any, b: any) => b.id - a.id) : [];
return data;
};
@@ -43,11 +43,11 @@ const MyPost = () => {
};
const handleStudyItemClick = (studyId: number) => {
- navigate(`/study/${studyId}`);
+ navigate(`/main/study/${studyId}`);
};
const handleCommunityItemClick = (contentId: number) => {
- navigate(`/community/${contentId}`);
+ navigate(`/main/community/${contentId}`);
};
return (
diff --git a/src/components/mypage/MyTrade.tsx b/src/components/mypage/MyTrade.tsx
index ffaffd7..81fdda8 100644
--- a/src/components/mypage/MyTrade.tsx
+++ b/src/components/mypage/MyTrade.tsx
@@ -5,7 +5,7 @@ import { ReactComponent as ChatIcon } from "../../assets/icon/chat-color.svg";
import "../../styles/mypage/MyTrade.scss";
import { useState, useEffect } from "react";
import { useNavigate } from "react-router-dom";
-import { fetchTokenData } from "../../api/fetchData";
+import { fetchNoMajorTokenData } from "../../api/fetchData";
import { BookData } from "../../types/Types";
import { postSold } from "../../api/postData";
@@ -19,7 +19,9 @@ const MyTrade = () => {
const storedAuth = localStorage.getItem("auth");
const auth = storedAuth ? JSON.parse(storedAuth) : null;
const userId = auth ? auth.user_id : null;
- const data = await fetchTokenData(`/profile/usedbooktrades/${userId}/`);
+ const data = await fetchNoMajorTokenData(
+ `/profile/usedbooktrades/${userId}/`
+ );
if (data) {
setTradeData(data);
}
@@ -38,7 +40,7 @@ const MyTrade = () => {
const navigate = useNavigate();
const goTradeItemClick = (tradeId: number) => {
- navigate(`/trade/${tradeId}`);
+ navigate(`/main/trade/${tradeId}`);
};
return (
diff --git a/src/components/navbar/Header.tsx b/src/components/navbar/Header.tsx
index 6722c8a..5384c50 100644
--- a/src/components/navbar/Header.tsx
+++ b/src/components/navbar/Header.tsx
@@ -7,6 +7,9 @@ import { useAuth } from "../../hooks/useAuth";
const Header = () => {
const navigate = useNavigate();
const { auth, logout } = useAuth();
+ const storedAuth = localStorage.getItem("auth");
+ const localAuth = storedAuth ? JSON.parse(storedAuth) : null;
+ const majorName = localAuth ? localAuth.major_category_name : null;
const goHome = () => {
navigate("/");
@@ -26,7 +29,7 @@ const Header = () => {
>
-
IT
+
{majorName}
MajorIn
diff --git a/src/components/signup/SchoolInfo.tsx b/src/components/signup/SchoolInfo.tsx
index c14edbd..321bddf 100644
--- a/src/components/signup/SchoolInfo.tsx
+++ b/src/components/signup/SchoolInfo.tsx
@@ -90,7 +90,11 @@ const SchoolInfo: React.FC<{ moveToNextStep: () => void }> = ({
>
-
+
+
+
+
+
diff --git a/src/components/signup/SignUpBtn.tsx b/src/components/signup/SignUpBtn.tsx
index c675cec..39ce9c2 100644
--- a/src/components/signup/SignUpBtn.tsx
+++ b/src/components/signup/SignUpBtn.tsx
@@ -23,7 +23,7 @@ const SignUpBtn: React.FC<{ moveToBeforeStep: () => void }> = ({
const handleSubmit = async (e: React.MouseEvent) => {
e.preventDefault();
- console.log(studentData);
+ // console.log(studentData);
const responseData = await postSignUpData("/users/register/", studentData);
if (responseData === "성공") {
setModalMessage("회원가입 성공");
diff --git a/src/components/study/StudySearch.tsx b/src/components/study/StudySearch.tsx
index 7e22e59..a194b44 100644
--- a/src/components/study/StudySearch.tsx
+++ b/src/components/study/StudySearch.tsx
@@ -21,7 +21,8 @@ const StudySearch: React.FC = ({
setSearchText(event.target.value);
};
- const handleSearch = () => {
+ const handleSearch = (event: React.FormEvent) => {
+ event.preventDefault();
if (searchText.trim() !== "") {
setRecentSearches([searchText, ...recentSearches]);
onSearchChange(searchText);
@@ -67,7 +68,7 @@ const StudySearch: React.FC = ({
-
+
+
+
최근 검색어
diff --git a/src/components/study/StudyWrite.tsx b/src/components/study/StudyWrite.tsx
index 18c1094..c951a58 100644
--- a/src/components/study/StudyWrite.tsx
+++ b/src/components/study/StudyWrite.tsx
@@ -63,6 +63,10 @@ const StudyWrite = () => {
setHashtags(updatedHashtags);
};
+ const goBack = () => {
+ navigate("/main/study");
+ };
+
const handleSubmit = async (event: React.FormEvent) => {
event.preventDefault();
const postData = {
@@ -71,10 +75,8 @@ const StudyWrite = () => {
hashtags,
};
- console.log(postData);
const response = await postTextData("/studys/posts/create/", postData);
if (response) {
- console.log("성공");
alert("글 등록에 성공하였습니다.");
navigate("/main/study");
}
@@ -119,7 +121,7 @@ const StudyWrite = () => {
/>
-
+
diff --git a/src/components/trade/BookSearch.tsx b/src/components/trade/BookSearch.tsx
index f5d31c9..5decadf 100644
--- a/src/components/trade/BookSearch.tsx
+++ b/src/components/trade/BookSearch.tsx
@@ -2,10 +2,10 @@ import { ReactComponent as SearchIcon } from "../../assets/icon/search.svg";
import { ReactComponent as PriceIcon } from "../../assets/icon/price.svg";
import { ReactComponent as BookIcon } from "../../assets/icon/book-search.svg";
import "../../styles/trade/TradeWrite.scss";
-import { useState, useEffect } from "react";
+import { useState, useEffect, ChangeEvent, KeyboardEvent } from "react";
import { useRecoilState } from "recoil";
import { bookState } from "../../data/recoilAtoms";
-import { fetchData } from "../../api/fetchData";
+import { fetchNoMajorData } from "../../api/fetchData";
import { BookSearchData } from "../../types/Types";
const BookSearch: React.FC = () => {
@@ -16,7 +16,7 @@ const BookSearch: React.FC = () => {
const fetchSearchData = async (word: string) => {
const decodedWord = decodeURIComponent(word);
- const data = await fetchData(
+ const data = await fetchNoMajorData(
`/usedbooktrades/book/search/?book_title=${decodedWord}`
);
setSearchBook(data.book_data_list);
@@ -26,16 +26,17 @@ const BookSearch: React.FC = () => {
setSearchWord(event.target.value);
};
- // const handleKeyPress = (event: React.KeyboardEvent
) => {
- // if (event.key === "Enter") {
- // fetchSearchData(searchWord);
- // }
- // };
-
const handleSearchClick = () => {
fetchSearchData(searchWord);
};
+ const handleKeyDown = (event: KeyboardEvent) => {
+ if (event.key === "Enter") {
+ event.preventDefault();
+ handleSearchClick();
+ }
+ };
+
const handleSelectBook = (
book: BookSearchData,
event: React.MouseEvent
@@ -63,7 +64,7 @@ const BookSearch: React.FC = () => {
placeholder="판매할 교재의 제목을 검색하세요."
value={searchWord}
onChange={handleInputChange}
- // onKeyPress={handleKeyPress}
+ onKeyDown={handleKeyDown}
/>
diff --git a/src/components/trade/TradeSearch.tsx b/src/components/trade/TradeSearch.tsx
index 100d987..bbd3480 100644
--- a/src/components/trade/TradeSearch.tsx
+++ b/src/components/trade/TradeSearch.tsx
@@ -4,7 +4,7 @@ import styled from "styled-components";
import { useState } from "react";
import { useNavigate } from "react-router-dom";
-const SearchBox = styled.div`
+const SearchBox = styled.form`
width: 100%;
height: 7vh;
border-radius: 5px;
@@ -16,6 +16,11 @@ const SearchBox = styled.div`
margin-bottom: 20px;
`;
+const SearchButton = styled.button`
+ margin: 0;
+ padding: 0;
+`;
+
const RegisterBtn = styled.button`
border-radius: 5px;
background: #1b1c3a;
@@ -41,7 +46,8 @@ const TradeSearch: React.FC = ({ onSearchChange }) => {
setSearchText(event.target.value);
};
- const handleSearch = () => {
+ const handleSearch = (event: React.FormEvent) => {
+ event.preventDefault();
if (searchText.trim() !== "") {
onSearchChange(searchText);
}
@@ -53,15 +59,18 @@ const TradeSearch: React.FC = ({ onSearchChange }) => {
return (
-
+
-
+
+
+
책 판매하기
diff --git a/src/components/trade/TradeToday.tsx b/src/components/trade/TradeToday.tsx
index dbb9d97..78a5fa5 100644
--- a/src/components/trade/TradeToday.tsx
+++ b/src/components/trade/TradeToday.tsx
@@ -1,6 +1,7 @@
import { ReactComponent as PriceIcon } from "../../assets/icon/price.svg";
import { ReactComponent as SalerIcon } from "../../assets/icon/saler.svg";
import { ReactComponent as ChatIcon } from "../../assets/icon/chat-color.svg";
+import { ReactComponent as BookIcon } from "../../assets/icon/nobook.svg";
import "../../styles/trade/TradeToday.scss";
import { useNavigate } from "react-router-dom";
import { useState, useEffect } from "react";
@@ -14,7 +15,13 @@ const TradeToday = () => {
const fetchBookData = async () => {
const data = await fetchData("/usedbooktrades/posts/");
if (data) {
- setBookData(data.sort((a: any, b: any) => b.id - a.id));
+ const today = new Date().toISOString().slice(0, 10);
+ const todayBooks = data.filter(
+ (item: any) =>
+ new Date(item.post_date).toISOString().slice(0, 10) === today
+ );
+ setBookData(todayBooks.sort((a: any, b: any) => b.id - a.id));
+ // setBookData(data.sort((a: any, b: any) => b.id - a.id));
}
};
fetchBookData();
@@ -27,47 +34,54 @@ const TradeToday = () => {
📚 오늘 등록된 교재
- {bookData.map((item, index) => (
-
goTradeItemClick(item.id)}
- >
-
-
-
-
-
- {item.is_sold ? "판매완료" : "판매중"}
-
-
{item.title}
-
{item.author}
-
{item.publisher}
-
-
-
{item.price.toLocaleString()}원
+ {bookData.length > 0 ? (
+ bookData.map((item, index) => (
+
goTradeItemClick(item.id)}
+ >
+
+
-
-
-
- {item.school_name} {item.major_name}{" "}
- {String(item.admission_date).slice(-2)}학번
-
+
+
+ {item.is_sold ? "판매완료" : "판매중"}
+
+
{item.title}
+
{item.author}
+
{item.publisher}
+
+
+
{item.price.toLocaleString()}원
+
+
+
+
+ {item.school_name} {item.major_name}{" "}
+ {String(item.admission_date).slice(-2)}학번
+
+
+
-
+ ))
+ ) : (
+
- ))}
+ )}
);
diff --git a/src/data/recoilAtoms.tsx b/src/data/recoilAtoms.tsx
index e40246f..bb97fc4 100644
--- a/src/data/recoilAtoms.tsx
+++ b/src/data/recoilAtoms.tsx
@@ -30,6 +30,7 @@ export const loginState = atom({
admission_date: null as number | null,
user_id: null as number | null,
major_id: null as number | null,
+ major_category_name: null as string | null,
},
});
diff --git a/src/hooks/useAuth.ts b/src/hooks/useAuth.ts
index 0431464..8221a4a 100644
--- a/src/hooks/useAuth.ts
+++ b/src/hooks/useAuth.ts
@@ -22,7 +22,8 @@ export const useAuth = () => {
major_name: string,
admission_date: number,
user_id: number,
- major_id: number
+ major_id: number,
+ major_category_name: string
) => {
setAuth({
isLoggedIn: true,
@@ -34,6 +35,7 @@ export const useAuth = () => {
admission_date,
user_id,
major_id,
+ major_category_name,
});
localStorage.setItem(
"auth",
@@ -46,8 +48,10 @@ export const useAuth = () => {
major_name,
user_id,
major_id,
+ major_category_name,
})
);
+ localStorage.removeItem("selected_major_id");
};
const logout = () => {
@@ -61,6 +65,7 @@ export const useAuth = () => {
admission_date: null,
user_id: null,
major_id: null,
+ major_category_name: null,
});
localStorage.removeItem("auth");
localStorage.removeItem("access_token");
@@ -70,6 +75,7 @@ export const useAuth = () => {
localStorage.removeItem("major_name");
localStorage.removeItem("user_id");
localStorage.removeItem("major_id");
+ localStorage.removeItem("major_category_name");
alert("로그아웃 되었습니다.");
navigate("/login");
window.location.reload();
diff --git a/src/styles/community/CommunityMain.scss b/src/styles/community/CommunityMain.scss
index 95731fb..2a28ab3 100644
--- a/src/styles/community/CommunityMain.scss
+++ b/src/styles/community/CommunityMain.scss
@@ -9,6 +9,15 @@
justify-content: space-between;
align-items: center;
padding-right: 20px;
+
+ input {
+ width: 100%;
+ }
+
+ button {
+ padding: 0;
+ margin: 0;
+ }
}
.community-filtering {
display: flex;
diff --git a/src/styles/home/HomeLogin.scss b/src/styles/home/HomeLogin.scss
index 0371c58..9e696ad 100644
--- a/src/styles/home/HomeLogin.scss
+++ b/src/styles/home/HomeLogin.scss
@@ -19,6 +19,13 @@
background: #fafafa;
}
+ .error-message {
+ color: #ff8c8c;
+ font-size: 0.7rem;
+ margin-top: 5px;
+ text-align: center;
+ }
+
input[type="button"] {
background: #cccccc;
font-weight: 700;
diff --git a/src/styles/login/LoginForm.scss b/src/styles/login/LoginForm.scss
index ceab153..0afcf48 100644
--- a/src/styles/login/LoginForm.scss
+++ b/src/styles/login/LoginForm.scss
@@ -46,6 +46,12 @@
font-weight: 600;
font-size: 0.8rem;
}
+
+ .error-message {
+ color: #f42c2c;
+ font-size: 0.8rem;
+ margin-top: 5px;
+ }
input[type="submit"] {
outline: none;
border: none;
diff --git a/src/styles/mypage/MyInfo.scss b/src/styles/mypage/MyInfo.scss
index b2fec8c..8cadefe 100644
--- a/src/styles/mypage/MyInfo.scss
+++ b/src/styles/mypage/MyInfo.scss
@@ -4,7 +4,8 @@
border-radius: 15px;
.myinfo-modify {
- display: flex;
+ display: none;
+ //display: flex;
justify-content: flex-end;
align-items: center;
gap: 5px;
diff --git a/src/styles/mypage/MyPost.scss b/src/styles/mypage/MyPost.scss
index c87e59e..db7e3cb 100644
--- a/src/styles/mypage/MyPost.scss
+++ b/src/styles/mypage/MyPost.scss
@@ -96,7 +96,8 @@
}
.modify {
- display: flex;
+ display: none;
+ // display: flex;
justify-content: flex-end;
gap: 3px;
cursor: pointer;
diff --git a/src/styles/study/StudySearch.scss b/src/styles/study/StudySearch.scss
index 2ea41b5..acaba45 100644
--- a/src/styles/study/StudySearch.scss
+++ b/src/styles/study/StudySearch.scss
@@ -30,6 +30,11 @@
input {
width: 90%;
}
+
+ button {
+ padding: 0;
+ margin: 0;
+ }
}
.recent-search {
diff --git a/src/styles/trade/TradeToday.scss b/src/styles/trade/TradeToday.scss
index c4a4fe7..5856ee8 100644
--- a/src/styles/trade/TradeToday.scss
+++ b/src/styles/trade/TradeToday.scss
@@ -99,3 +99,20 @@
}
}
}
+
+.no-trade {
+ width: 100%;
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+ gap: 15px;
+ background: #ffffff;
+ border-radius: 5px;
+ padding: 80px 0;
+
+ p {
+ color: #1b1c3a;
+ font-weight: 600;
+ }
+}
diff --git a/src/styles/trade/TradeWrite.scss b/src/styles/trade/TradeWrite.scss
index e1fef76..c6ce74d 100644
--- a/src/styles/trade/TradeWrite.scss
+++ b/src/styles/trade/TradeWrite.scss
@@ -31,6 +31,11 @@
input {
width: 90%;
}
+
+ button {
+ margin: 0;
+ padding: 0;
+ }
}
.search-output {
diff --git a/src/types/Types.ts b/src/types/Types.ts
index f5c76a1..3d1d5a5 100644
--- a/src/types/Types.ts
+++ b/src/types/Types.ts
@@ -131,3 +131,9 @@ export interface UserInfo {
user_comment_count: number;
user_bookmark_count: number;
}
+
+export interface MajorData {
+ id: number;
+ major: string;
+ major_category_name: string;
+}