Skip to content

Commit

Permalink
Merge pull request #103 from LikeLionHGU/hayoung_feat/#97
Browse files Browse the repository at this point in the history
feat : 다양한 기능
  • Loading branch information
Hayoung04 authored Feb 23, 2024
2 parents 4ed3752 + 9ddf513 commit 6325d8f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
10 changes: 8 additions & 2 deletions src/calendar/Calendarr.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import ko from "date-fns/locale/ko";
import DatePicker from "react-datepicker";
import "../../node_modules/react-datepicker/dist/react-datepicker.css";
import "../../node_modules/react-datepicker/dist/react-datepicker.module.css";
import { useParams } from "react-router-dom";
import { useParams, useNavigate } from "react-router-dom";

import styles from "./Calendarr.module.css";
import Header from "../header/Header";
Expand All @@ -31,6 +31,7 @@ function Calendarr() {
const [data, setData] = useState([]);
const params = useParams();
const id = params.postId;
const navigate = useNavigate();
// const [isSelected, setIsSelected] = useState(false);
useEffect(() => {
calendarRef.current.setFocus();
Expand Down Expand Up @@ -154,7 +155,12 @@ function Calendarr() {
/>
</p>
</div> */}
<button className={styles.subButton}>작성 완료</button>
<button
className={styles.subButton}
onClick={() => navigate("/")}
>
작성 완료
</button>
</div>
</span>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/grid/Grid.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function Grid() {
// API 호출
fetch("https://api.zionhann.shop/app/makeup/posts")
.then((response) => response.json())
.then((data) => setData(data.data));
.then((data) => setData(data.data.sort((a, b) => b.postId - a.postId)));
}, []);

const handleContainerClick = (postid) => {
Expand Down Expand Up @@ -60,7 +60,7 @@ function Grid() {
style={{ backgroundImage: `url(${item.imageUrl})` }}
>
<div className={styles.hoverText}>
{truncate(item.text, 12)}
# {truncate(item.title, 12)}
</div>

<img
Expand Down
3 changes: 3 additions & 0 deletions src/modal/modal.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import React, { useState } from "react";
import styles from "./Modal.module.css";
import subimg from "./Subtract.png";
import { useNavigate } from "react-router-dom";

const Modal = (props) => {
const { open, setOpen } = props;
const navigate = useNavigate();

const closeModal = () => {
setOpen(false);
navigate("/");
};

return (
Expand Down

0 comments on commit 6325d8f

Please sign in to comment.