1
0
Fork 0
mirror of https://github.com/voltbonn/profile-picture-generator.git synced 2024-12-22 07:45:04 +00:00

fix: write out the hashtags that are not a tag but a phrase

This commit is contained in:
thomasrosen 2023-10-03 12:50:36 +02:00
parent 0664879db0
commit 31992bda35

View file

@ -1,6 +1,12 @@
import { useState, useEffect, useCallback } from 'react' import { useState, useEffect, useCallback } from 'react'
import { withLocalization } from './Localized.js' import { withLocalization } from './Localized.js'
const hashtagNameReplacers = {
'IVotedFromAbroad': 'I voted from abroad!',
'PeaceInEurope': 'Peace in Europe',
'FriedenInEuropa': 'Frieden in Europa',
}
function HashtagChooser({ onChange, getString }) { function HashtagChooser({ onChange, getString }) {
const [frames, setFrames] = useState([]) const [frames, setFrames] = useState([])
const [choosenFrame, setChoosenFrame] = useState(null) const [choosenFrame, setChoosenFrame] = useState(null)
@ -25,8 +31,11 @@ function HashtagChooser({ onChange, getString }) {
if (frame_filename !== '') { if (frame_filename !== '') {
src = (await import(`./hashtags/${frame_filename}.png`)).default src = (await import(`./hashtags/${frame_filename}.png`)).default
} }
const name = hashtagNameReplacers[frame_filename] || frame_filename
return { return {
name: frame_filename, name,
src src
} }
}) })