Skip to content

Commit 8028434

Browse files
committed
✨ feat: Add usage instructions through component
1 parent ecb2a2c commit 8028434

File tree

4 files changed

+104
-1
lines changed

4 files changed

+104
-1
lines changed

repo-img/component-structure.png

9.73 KB
Loading

src/components/App/App.jsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import CommitSelector from "../CommitSelector/CommitSelector";
66
import Loader from "../Loader/Loader";
77
import RawDataDisplay from "../RawDataDisplay/RawDataDisplay";
88
import BackToTop from "../BackToTop/BackToTop";
9+
import IntroMsg from "../IntroMsg/IntroMsg";
910
import getObjects from "../../util/generateObjects";
1011
import formatObjects from "../../util/formatObjects";
1112
import getConnections from "../../util/generateConnections";
@@ -203,7 +204,7 @@ function App() {
203204
objectData={objectData}
204205
sendRawObjDetails={handleRawDataObjDetails}
205206
/>
206-
) : null}
207+
) : isLoading ? null : <IntroMsg />}
207208

208209
{showCommitSelector && (
209210
<CommitSelector

src/components/IntroMsg/IntroMsg.css

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
.intro-msg {
2+
margin: 5em 1em;
3+
}
4+
5+
.intro-msg p {
6+
margin-bottom: 1em;
7+
}
8+
9+
.intro-msg li {
10+
margin-bottom: 1em;
11+
list-style: inside;
12+
padding-left: 0.5em;
13+
}
14+
15+
.intro-msg h2 {
16+
margin: 1.5em 0 1em 0;
17+
}
18+
19+
.intro-msg ul ul {
20+
margin-left: 3em;
21+
margin-top: 1em;
22+
}
23+
24+
.intro-msg ul ul li {
25+
list-style: circle;
26+
}

src/components/IntroMsg/IntroMsg.jsx

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
import "./IntroMsg.css";
2+
3+
const IntroMsg = () => {
4+
return (
5+
<div className="intro-msg">
6+
<p>
7+
A visualizer for the Directed Acyclic Graph that Git creates to
8+
connect{" "}
9+
<a
10+
href="https://git.harshkapadia.me/#_git_objects"
11+
target="_blank"
12+
rel="noreferrer"
13+
>
14+
Commit, Tree and Blob objects
15+
</a>{" "}
16+
internally.
17+
</p>
18+
<p>
19+
<a
20+
href="https://www.youtube.com/watch?v=sLDDaPDXB8s"
21+
target="_blank"
22+
rel="noreferrer"
23+
>
24+
Learn the internals of Git.
25+
</a>
26+
</p>
27+
28+
<h2>Usage Instructions</h2>
29+
<ul>
30+
<li>
31+
Select the <code>.git</code> directory of a repository for
32+
the graph to render.
33+
</li>
34+
<li>
35+
Once the graph is rendered, one can
36+
<ul>
37+
<li>
38+
Use the Commit Selector to highlight one or more
39+
Commits and their corresponding Trees and Blobs.
40+
</li>
41+
<li>
42+
Hover over the objects and click on the 'Raw' button
43+
to view the contents of that Git Object.
44+
</li>
45+
</ul>
46+
</li>
47+
</ul>
48+
49+
<h2>Note</h2>
50+
<ul>
51+
<li>
52+
If the <code>.git</code> directory is not visible in the
53+
directory picker, please enable hidden file viewing on the
54+
local machine.
55+
</li>
56+
<li>
57+
Extremely huge repositories might not load due to browser
58+
memory constraints.
59+
</li>
60+
<li>
61+
Please report errors and bugs by{" "}
62+
<a
63+
href="https://github.com/HarshKapadia2/git-graph/issues"
64+
target="_blank"
65+
rel="noreferrer"
66+
>
67+
raising issues
68+
</a>
69+
.
70+
</li>
71+
</ul>
72+
</div>
73+
);
74+
};
75+
76+
export default IntroMsg;

0 commit comments

Comments
 (0)