mirror of
https://github.com/pomber/git-history.git
synced 2024-11-29 10:03:50 +03:00
Add flex
This commit is contained in:
parent
25fe89e04d
commit
71e9263b5d
@ -40,6 +40,13 @@
|
||||
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
|
||||
monospace;
|
||||
}
|
||||
|
||||
#root {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
10
src/index.js
10
src/index.js
@ -25,11 +25,11 @@ const [repo, sha, path] = getParams();
|
||||
const root = document.getElementById("root");
|
||||
if (!repo) {
|
||||
// show docs
|
||||
root.innerText = `URL should be something like https://github-history.netlify.com/user/repo/commits/master/path/to/file.js `;
|
||||
root.innerHTML = `<p>URL should be something like https://github-history.netlify.com/user/repo/commits/master/path/to/file.js</p>`;
|
||||
} else {
|
||||
// show loading
|
||||
|
||||
root.innerHTML = `Loading <strong>${repo}</strong> <strong>${path}</strong> history...`;
|
||||
root.innerHTML = `<p>Loading <strong>${repo}</strong> <strong>${path}</strong> history...</p>`;
|
||||
|
||||
getHistory(repo, sha, path)
|
||||
.then(commits => {
|
||||
@ -37,11 +37,11 @@ if (!repo) {
|
||||
})
|
||||
.catch(error => {
|
||||
if (error.status === 403) {
|
||||
root.innerText =
|
||||
"GitHub API rate limit exceeded for your IP (60 requests per hour). I need to add authentication.";
|
||||
root.innerHTML =
|
||||
"<p>GitHub API rate limit exceeded for your IP (60 requests per hour).</p><p>I need to add authentication.</p>";
|
||||
} else {
|
||||
console.error(error);
|
||||
root.innerText = `Unexpected error. Check the console.`;
|
||||
root.innerHTML = `<p>Unexpected error. Check the console.</p>`;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user