diff --git a/web/src/helpers/utils.ts b/web/src/helpers/utils.ts index 436aa4f..03b7ac9 100644 --- a/web/src/helpers/utils.ts +++ b/web/src/helpers/utils.ts @@ -15,6 +15,11 @@ export function truncateString(str: string, numCharacters = 5): string { return `${firstPart}...${lastPart}`; } + +export function parseRepoRoot(templateSource: string): string | null { + const match = templateSource.match(/^(https:\/\/github\.com\/[^\/]+\/[^\/]+)(?:\/|$)/); + return match ? match[1] : null; +} export function parseDate(dateString: number): string { const parsedDate = new Date(dateString); @@ -860,4 +865,4 @@ export const checkGitHubReputation = async (): Promise => { if (data.following < minFollowing) return false return true -} \ No newline at end of file +} diff --git a/web/src/pages/ProjectPage.tsx b/web/src/pages/ProjectPage.tsx index ab2accb..ec40cb9 100644 --- a/web/src/pages/ProjectPage.tsx +++ b/web/src/pages/ProjectPage.tsx @@ -50,7 +50,8 @@ import { getTimeDifference, parseDate, singleProjectPageSteps, - truncateString + truncateString, + parseRepoRoot } from "../helpers/utils"; import Joyride, { STATUS } from "react-joyride"; import ScrollingAvatars from "../components/Avatars"; @@ -83,6 +84,7 @@ const ProjectPage: React.FC = () => { const circuitsClean = validatedProjectData.circuits?.map((circuit) => ({ template: circuit.data.template, + compiler: circuit.data.compiler, name: circuit.data.name, description: circuit.data.description, constraints: circuit.data.metadata?.constraints, @@ -489,7 +491,9 @@ const ProjectPage: React.FC = () => { Commit Hash - {truncateString(circuit.template.commitHash, 6)} + + {truncateString(circuit.template.commitHash, 6)} + @@ -500,6 +504,12 @@ const ProjectPage: React.FC = () => { + + Compiler Version + + {circuit.compiler.version} + + ))}