diff --git a/src/app/api/battles/matchups/route.ts b/src/app/api/battles/matchups/route.ts index d329f0e8..1da320e8 100644 --- a/src/app/api/battles/matchups/route.ts +++ b/src/app/api/battles/matchups/route.ts @@ -54,6 +54,8 @@ export async function GET() { repo_url: matchup.project1.repo_url, deploy_url: matchup.project1.deploy_url, rating: matchup.project1.rating, + ship_type: matchup.project1.ship_type, + update_description: matchup.project1.update_description, }, project2: { id: matchup.project2.id, @@ -63,6 +65,8 @@ export async function GET() { repo_url: matchup.project2.repo_url, deploy_url: matchup.project2.deploy_url, rating: matchup.project2.rating, + ship_type: matchup.project2.ship_type, + update_description: matchup.project2.update_description, }, signature: matchup.signature, ts: matchup.ts, diff --git a/src/app/harbor/battles/battles.tsx b/src/app/harbor/battles/battles.tsx index 3a4787e9..3e2a7862 100644 --- a/src/app/harbor/battles/battles.tsx +++ b/src/app/harbor/battles/battles.tsx @@ -56,6 +56,13 @@ const ProjectCard: React.FC = ({ backgroundImage: `url(${notFoundImage})`, backgroundSize: 'cover', } + const [showFullText, setShowFullText] = useState(false) + + const toggleReadMore = () => { + setShowFullText((prev) => !prev) + } + + const truncatedText = project.update_description?.slice(0, 50) return (
@@ -73,10 +80,19 @@ const ProjectCard: React.FC = ({

{project.title} + {project.ship_type === 'update' ? ( +

+ {' '} + +

+ ) : null}

- {/*

- Hours: {project.hours} -

*/} +
{project.repo_url && ( = ({ )}
+ {project.update_description && ( +

+ {showFullText + ? project.update_description + : truncatedText + + (project.update_description.length > 50 ? '...' : '')} + {project.update_description.length > 50 && ( + + )} +

+ )}