From d49c93a2cfb0ec847ce9a5de0e8fdf61bc7b11d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1nos=20Veres?= Date: Sun, 7 Apr 2024 09:39:25 +0200 Subject: [PATCH] feat: allow override for gitgraphjs options --- packages/ogre-react/OgreGraph.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/ogre-react/OgreGraph.tsx b/packages/ogre-react/OgreGraph.tsx index 7102fcd..1976952 100644 --- a/packages/ogre-react/OgreGraph.tsx +++ b/packages/ogre-react/OgreGraph.tsx @@ -2,12 +2,17 @@ import React, { useEffect, useState } from "react"; import { formatGit2Json, RepositoryObject } from "@dotinc/ogre"; import { Gitgraph } from "@gitgraph/react"; +import { GitgraphOptions } from "@gitgraph/core/src/gitgraph"; export interface OgreGraphProps { repository: RepositoryObject; + options: GitgraphOptions | undefined; } -export const OgreGraph: React.FC = ({ repository }) => { +export const OgreGraph: React.FC = ({ + repository, + options, +}) => { const [graphData, setGraphData] = useState(undefined); useEffect(() => { @@ -18,7 +23,7 @@ export const OgreGraph: React.FC = ({ repository }) => { }, [repository]); return !graphData ? null : ( - + {(gitgraph) => { gitgraph.import(graphData); }}