diff --git a/src/components/common/Card.jsx b/src/components/common/Card.jsx
index ba14a30..47e76cb 100644
--- a/src/components/common/Card.jsx
+++ b/src/components/common/Card.jsx
@@ -10,6 +10,7 @@ const Card = ({
createdAt,
writerNickname,
likeCount = 0,
+ onClick,
}) => {
// 날짜 가공
const formattedDate = new Date(createdAt).toLocaleDateString("ko-KR", {
@@ -22,6 +23,7 @@ const Card = ({
 => {
const [modal, setModal] = React.useState(false);
- const handleKakaoLogin = () => {
- window.location.href =
- )
{
+ // window.location.href =
+ // "https://codingcare.site/api/oauth2/authorization/kakao";
+ // };
+ // const handleGithubLogin = () => {
+ // window.location.href =
+ // "https://codingcare.site/api/oauth2/authorization/github";
+ // };
const handleOpenModal = () => {
setModal(true);
};
@@ -51,7 +55,8 @@ const Header = () => {
width: 400,
bgcolor: "background.paper",
boxShadow: 24,
- p: 4,
+ paddingY: 3,
+ paddingX: 4,
borderRadius: "8px",
}}
>
@@ -62,11 +67,16 @@ const Header = () => {
>
-
-
로그인 모달
-
소셜 계정으로 로그인
-
-
+
+
로그인
+
소셜 계정으로 로그인
+
+
+
diff --git a/src/components/common/TabBar.jsx b/src/components/common/TabBar.jsx
index 2dd41d8..6fb5c5f 100644
--- a/src/components/common/TabBar.jsx
+++ b/src/components/common/TabBar.jsx
@@ -7,12 +7,8 @@ import {
} from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
-const TabBar = () => {
- const [value, setValue] = React.useState("total");
+const TabBar = ({ value, handleChange }) => {
- const handleChange = (event, newValue) => {
- setValue(newValue);
- };
return (
diff --git a/src/components/mypage/SubTabBar.jsx b/src/components/mypage/SubTabBar.jsx
index a4172c7..edf9f36 100644
--- a/src/components/mypage/SubTabBar.jsx
+++ b/src/components/mypage/SubTabBar.jsx
@@ -7,7 +7,7 @@ import {
} from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
-const SubTabBar = ({ value, handleChange, tabData }) => {
+const SubTabBar = ({ value, handleChange }) => {
return (
{
- const [token, setToken] = React.useState("");
+ const [selectedTab, setSelectedTab] = useState("total");
+
const [posts, setPosts] = React.useState(null);
- console.log(posts);
+ const navigate = useNavigate();
+
+ const handleTabChange = (event, newValue) => {
+ setSelectedTab(newValue);
+ };
useEffect(() => {
setCookie(
"accessToken",
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJuYW1lIjoi7J207Zqo7JuQIiwic29jaWFsIjoia2FrYW8iLCJlbWFpbCI6InltajA3MTY4QG5hdmVyLmNvbSIsInByb2ZpbGVJbWFnZSI6Imh0dHA6Ly9rLmtha2FvY2RuLm5ldC9kbi9kZkFXemcvYnRzSm43bVlmZm8vYzdhZ3Frb2NZTjQ1Zjd4SEIyMXN2Sy9pbWdfNjQweDY0MC5qcGciLCJyb2xlIjoiTUVNQkVSIiwiaWF0IjoxNzI5NjgwMDIwLCJleHAiOjE3Mjk2ODM2MjB9.u2lfSAabfwXrCeuMH-lr0FAGVq4ZNM2PlqAe6qwBZ1o"
);
-
getTIL({ pageNumber: 0 }).then((res) => setPosts(res.data.content));
}, []);
return (
-
-
- {posts?.map((item) => (
-
- ))}
-
-
- {Array(9)
- .fill(0)
- .map((item) => (
-
+
+ {selectedTab === "total" && (
+
+ {posts?.map((item) => (
+ navigate(`posts/${item.tilId}`)}
+ />
))}
-
+
+ )}
+ {selectedTab === "challenge" && (
+
+ {Array(9)
+ .fill(0)
+ .map((item) => (
+
+ ))}
+
+ )}
);
};