From 71e9263b5dcc8d902b76dc3431c406e5c0defea8 Mon Sep 17 00:00:00 2001 From: Rodrigo Pombo Date: Mon, 4 Feb 2019 22:22:48 -0300 Subject: [PATCH] Add flex --- public/index.html | 7 +++++++ src/index.js | 10 +++++----- 2 files changed, 12 insertions(+), 5 deletions(-) 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.

`; } }); }