From 31992bda3597475b5a8735205ef7fbf693e50e11 Mon Sep 17 00:00:00 2001 From: thomasrosen Date: Tue, 3 Oct 2023 12:50:36 +0200 Subject: [PATCH] fix: write out the hashtags that are not a tag but a phrase --- src/HashtagChooser.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/HashtagChooser.js b/src/HashtagChooser.js index d682b12..63a2356 100644 --- a/src/HashtagChooser.js +++ b/src/HashtagChooser.js @@ -1,6 +1,12 @@ import { useState, useEffect, useCallback } from 'react' import { withLocalization } from './Localized.js' +const hashtagNameReplacers = { + 'IVotedFromAbroad': 'I voted from abroad!', + 'PeaceInEurope': 'Peace in Europe', + 'FriedenInEuropa': 'Frieden in Europa', +} + function HashtagChooser({ onChange, getString }) { const [frames, setFrames] = useState([]) const [choosenFrame, setChoosenFrame] = useState(null) @@ -25,8 +31,11 @@ function HashtagChooser({ onChange, getString }) { if (frame_filename !== '') { src = (await import(`./hashtags/${frame_filename}.png`)).default } + + const name = hashtagNameReplacers[frame_filename] || frame_filename + return { - name: frame_filename, + name, src } })