Skip to content

Commit

Permalink
feat: allow override for gitgraphjs options
Browse files Browse the repository at this point in the history
  • Loading branch information
nadilas committed Apr 7, 2024
1 parent a254347 commit d49c93a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/ogre-react/OgreGraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<any>;
options: GitgraphOptions | undefined;
}

export const OgreGraph: React.FC<OgreGraphProps> = ({ repository }) => {
export const OgreGraph: React.FC<OgreGraphProps> = ({
repository,
options,
}) => {
const [graphData, setGraphData] = useState<any[] | undefined>(undefined);

useEffect(() => {
Expand All @@ -18,7 +23,7 @@ export const OgreGraph: React.FC<OgreGraphProps> = ({ repository }) => {
}, [repository]);

return !graphData ? null : (
<Gitgraph>
<Gitgraph options={options}>
{(gitgraph) => {
gitgraph.import(graphData);
}}
Expand Down

0 comments on commit d49c93a

Please sign in to comment.