diff --git a/src/app/harbor/battles/battles.tsx b/src/app/harbor/battles/battles.tsx index a215767d..12345a04 100644 --- a/src/app/harbor/battles/battles.tsx +++ b/src/app/harbor/battles/battles.tsx @@ -34,6 +34,7 @@ interface ProjectCardProps { project: Ships onVote: () => void onReadmeClick: () => void + onReport: () => void } const notFoundImages = [ @@ -49,6 +50,7 @@ const ProjectCard: React.FC = ({ project, onVote, onReadmeClick, + onReport }) => { const notFoundImage = useMemo(() => { return notFoundImages[Math.floor(Math.random() * notFoundImages.length)] @@ -67,6 +69,8 @@ const ProjectCard: React.FC = ({ return (
+ 🏴‍☠️ + 🏴‍☠️ {project.screenshot_url && (
(null) const [cursed, setCursed] = useState(false) const [blessed, setBlessed] = useState(false) @@ -360,6 +365,7 @@ export default function Matchups({ session }: { session: HsSession }) { const handleVoteClick = (project: Ships) => { setSelectedProject(project) + setReportedProject(null) if (sessionStorage.getItem('tutorial') === 'true') { setReason( @@ -452,6 +458,11 @@ export default function Matchups({ session }: { session: HsSession }) { } } + const handleReportClick = (project: Ships)=>{ + setReportedProject(project) + setSelectedProject(null) + } + if (isReadmeView) { return (
@@ -521,6 +532,7 @@ export default function Matchups({ session }: { session: HsSession }) { project={matchup.project1} onVote={() => handleVoteClick(matchup.project1)} onReadmeClick={() => handleReadmeClick(matchup.project1)} + onReport={()=> handleReportClick(matchup.project1)} />
@@ -531,6 +543,7 @@ export default function Matchups({ session }: { session: HsSession }) { project={matchup.project2} onVote={() => handleVoteClick(matchup.project2)} onReadmeClick={() => handleReadmeClick(matchup.project2)} + onReport={()=> handleReportClick(matchup.project2)} />
@@ -601,6 +614,80 @@ export default function Matchups({ session }: { session: HsSession }) {
)} + {/* show container for report like for voting */} + {reportedProject && ( +
+
+

+ 🏴‍☠️Why are you reporting {reportedProject.title}?🏴‍☠️ +

+ +