Added name capitalization to token and map upload

This commit is contained in:
Mitchell McCaffrey
2020-10-09 13:10:30 +11:00
parent 9314e0c609
commit f851b01f47
2 changed files with 6 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
import React, { useRef, useContext, useState } from "react";
import { Flex, Label, Button } from "theme-ui";
import shortid from "shortid";
import Case from "case";
import EditTokenModal from "./EditTokenModal";
import EditGroupModal from "./EditGroupModal";
@@ -80,6 +81,8 @@ function SelectTokensModal({ isOpen, onRequestClose }) {
// Clean string
name = name.replace(/ +/g, " ");
name = name.trim();
// Capitalize and remove underscores
name = Case.capital(name);
}
let image = new Image();
setImageLoading(true);