From 94377509d913e086d363d94da93350c554ceb482 Mon Sep 17 00:00:00 2001 From: Bastian Meissner Date: Mon, 8 Jun 2020 13:29:00 +0200 Subject: [PATCH] Added Docker-Compose and Greetings --- README.md | 15 +++++++++++++++ src/components/greeter.js | 14 ++++++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index baacdf2..6dd2d4a 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,21 @@ $ docker run -d \ phntxx/dashboard ``` +Sample Docker Compose configuration: + +``` +version: "3" + +services: + dashboard: + image: phntxx/dashboard:latest + restart: unless-stopped + volumes: + - [path to data directory]:/app/data + ports: + - 3000:3000 +``` + **Note: You might still need to clone the repository in order to get the JSON-files which are required for the app to run** diff --git a/src/components/greeter.js b/src/components/greeter.js index b72af40..52196cf 100644 --- a/src/components/greeter.js +++ b/src/components/greeter.js @@ -25,8 +25,18 @@ const DateText = styled.h3` `; const getGreeting = () => { - // Maybe add some expandability for different greetings? - return 'Hello World!'; + switch (Math.floor(new Date().getHours() / 6)) { + case 0: + return 'Goor night!'; + case 1: + return 'Good morning!'; + case 2: + return 'Good afternoon!'; + case 3: + return 'Good evening!'; + default: + break; + } }; const getExtension = day => {