-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
45 changed files
with
914 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
30 changes: 30 additions & 0 deletions
30
src/components/Atom/customModal/deleteModal/DeleteModal.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { useNavigate } from "react-router-dom"; | ||
import { useDeleteReview } from "src/hook/useDeleteReview"; | ||
import CustomModal from "../CustomModal"; | ||
import "./DeleteModal.css"; | ||
|
||
interface DeleteProp { | ||
target: string; // 거리, 리뷰, 댓글 | ||
targetId: number; | ||
onClose: () => void; | ||
} | ||
const DeleteModal = ({ onClose, targetId, target }: DeleteProp) => { | ||
const navigate = useNavigate(); | ||
const { handleDeleteReview } = useDeleteReview(); | ||
const handleDelete = () => { | ||
handleDeleteReview(targetId.toString()); | ||
navigate("/"); | ||
onClose(); | ||
}; | ||
return ( | ||
<> | ||
<CustomModal | ||
title={`${target} 삭제`} | ||
content={`${target}를 삭제하시겠습니까?`} | ||
onClick={handleDelete} | ||
onClose={onClose} | ||
/> | ||
</> | ||
); | ||
}; | ||
export default DeleteModal; |
29 changes: 29 additions & 0 deletions
29
src/components/Atom/customModal/reportModal/ReportModal.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { useNavigate } from "react-router-dom"; | ||
import { useReportReview } from "src/hook/useReportReview"; | ||
import CustomModal from "../CustomModal"; | ||
|
||
interface ReportProp { | ||
target: string; // 거리, 리뷰, 댓글 | ||
targetId: number; | ||
onClose: () => void; | ||
} | ||
const ReportModal = ({ onClose, targetId, target }: ReportProp) => { | ||
const navigate = useNavigate(); | ||
const { handleReportReview } = useReportReview(); | ||
const handleDelete = () => { | ||
handleReportReview(targetId.toString()); | ||
navigate("/"); | ||
onClose(); | ||
}; | ||
return ( | ||
<> | ||
<CustomModal | ||
title={`${target} 신고`} | ||
content={`${target}를 신고하시겠습니까?`} | ||
onClick={handleDelete} | ||
onClose={onClose} | ||
/> | ||
</> | ||
); | ||
}; | ||
export default ReportModal; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
.custom-select-wrapper { | ||
position: relative; | ||
height: 3rem; | ||
width: 10.3125rem; | ||
} | ||
|
||
.custom-select-header { | ||
padding: 0.5rem; | ||
cursor: pointer; | ||
border: none; | ||
border-radius: 1.25rem; | ||
background-color: #dff5ff; | ||
} | ||
|
||
.custom-select-options { | ||
position: absolute; | ||
top: 100%; | ||
left: 0; | ||
width: 100%; | ||
border: none; | ||
background-color: #dff5ff; | ||
border-radius: 1.25rem; | ||
} | ||
|
||
.custom-option { | ||
cursor: pointer; | ||
padding: 0.5rem; | ||
border-bottom: 2px solid #fff; | ||
} | ||
.custom-option:last-child { | ||
border-bottom: none; | ||
} | ||
|
||
.custom-option:hover { | ||
background-color: #f0f0f0; | ||
} | ||
.custom-option:first-child:hover { | ||
border-radius: 1.25rem 1.25rem 0 0; | ||
} | ||
.custom-option:last-child:hover { | ||
border-radius: 0 0 1.25rem 1.25rem; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { SetStateAction, useState } from "react"; | ||
import { Text } from "../text/Text"; | ||
import "./CustomSelect.css"; | ||
|
||
interface customSelectProps { | ||
options: string[]; | ||
selectedOption: string; | ||
setSelectedOption: React.Dispatch<React.SetStateAction<string>>; | ||
} | ||
const CustomSelect = ({ | ||
options, | ||
selectedOption, | ||
setSelectedOption, | ||
}: customSelectProps) => { | ||
const [isOpen, setIsOpen] = useState(false); | ||
|
||
const handleOptionClick = (option: SetStateAction<string>) => { | ||
setSelectedOption(option); | ||
setIsOpen(false); | ||
}; | ||
|
||
return ( | ||
<div className="custom-select-wrapper"> | ||
<div className="custom-select-header" onClick={() => setIsOpen(!isOpen)}> | ||
<Text color="#000" fontSize="0.9375rem" fontWeight="700"> | ||
{selectedOption} | ||
</Text> | ||
</div> | ||
{isOpen && ( | ||
<div className="custom-select-options"> | ||
{options.map((option, index) => ( | ||
<div | ||
key={index} | ||
className="custom-option" | ||
onClick={() => handleOptionClick(option)} | ||
> | ||
<Text color="#000" fontSize="0.9375rem" fontWeight="700"> | ||
{option} | ||
</Text> | ||
</div> | ||
))} | ||
</div> | ||
)} | ||
</div> | ||
); | ||
}; | ||
|
||
export default CustomSelect; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.