From 4c8af430156fc401772484e67e0035ba60b34730 Mon Sep 17 00:00:00 2001 From: Florian Brandel Date: Wed, 23 May 2018 10:10:43 +0200 Subject: [PATCH] [TASK] Add title to new/changed flag to clarify the meaning of short 'N' and 'C' flags. --- js/components/Flag.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/js/components/Flag.js b/js/components/Flag.js index 8d8baa8..4def4ec 100644 --- a/js/components/Flag.js +++ b/js/components/Flag.js @@ -1,15 +1,20 @@ import React from 'react'; +function ucFirst(string) { + return string.charAt(0).toUpperCase() + string.slice(1); +} + export default function Flag({ item, short = false }) { if (item.flag !== 'default') { let name = item.flag.toUpperCase(); + let title = ucFirst(item.flag); if (short === true) { name = { new: 'N', changed: 'C', }[item.flag]; } - return {name}; + return {name}; } return null; }