Merge pull request #74 from feedingaliencat/588-chores-starting-with-digit
ChoreCard: Fix rendering of chores names starting with a digit
This commit is contained in:
@@ -78,7 +78,7 @@ const ChoreCard = ({
|
|||||||
const getName = name => {
|
const getName = name => {
|
||||||
const split = Array.from(chore.name)
|
const split = Array.from(chore.name)
|
||||||
// if the first character is emoji then remove it from the name
|
// if the first character is emoji then remove it from the name
|
||||||
if (/\p{Emoji}/u.test(split[0])) {
|
if (isNaN(Number(split[0])) && /\p{Emoji}/u.test(split[0])) {
|
||||||
return split.slice(1).join('').trim()
|
return split.slice(1).join('').trim()
|
||||||
}
|
}
|
||||||
return name
|
return name
|
||||||
|
|||||||
Reference in New Issue
Block a user