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",
|
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
|
||||||
monospace;
|
monospace;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#root {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
10
src/index.js
10
src/index.js
@ -25,11 +25,11 @@ const [repo, sha, path] = getParams();
|
|||||||
const root = document.getElementById("root");
|
const root = document.getElementById("root");
|
||||||
if (!repo) {
|
if (!repo) {
|
||||||
// show docs
|
// 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 {
|
} else {
|
||||||
// show loading
|
// 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)
|
getHistory(repo, sha, path)
|
||||||
.then(commits => {
|
.then(commits => {
|
||||||
@ -37,11 +37,11 @@ if (!repo) {
|
|||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
if (error.status === 403) {
|
if (error.status === 403) {
|
||||||
root.innerText =
|
root.innerHTML =
|
||||||
"GitHub API rate limit exceeded for your IP (60 requests per hour). I need to add authentication.";
|
"<p>GitHub API rate limit exceeded for your IP (60 requests per hour).</p><p>I need to add authentication.</p>";
|
||||||
} else {
|
} else {
|
||||||
console.error(error);
|
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