diff --git a/public/index.html b/public/index.html index 06a4461..9c9c0b9 100755 --- a/public/index.html +++ b/public/index.html @@ -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; + }
diff --git a/src/index.js b/src/index.js index 1b9af7b..2f0b7a2 100755 --- a/src/index.js +++ b/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 = `URL should be something like https://github-history.netlify.com/user/repo/commits/master/path/to/file.js
`; } else { // show loading - root.innerHTML = `Loading ${repo} ${path} history...`; + root.innerHTML = `Loading ${repo} ${path} history...
`; 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 = + "GitHub API rate limit exceeded for your IP (60 requests per hour).
I need to add authentication.
"; } else { console.error(error); - root.innerText = `Unexpected error. Check the console.`; + root.innerHTML = `Unexpected error. Check the console.
`; } }); }