mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
add new loading states
This commit is contained in:
@@ -1,27 +0,0 @@
|
||||
function formatState(str) {
|
||||
if (!str) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const formattedWords = str
|
||||
.replace(/-/g, " ")
|
||||
.split(" ")
|
||||
.map((word, index) => {
|
||||
word = word.toLowerCase();
|
||||
if (word === "ipfs" || word === "ipns") {
|
||||
return word.toUpperCase();
|
||||
} else if (index === 0) {
|
||||
return word.charAt(0).toUpperCase() + word.slice(1);
|
||||
} else {
|
||||
return word;
|
||||
}
|
||||
});
|
||||
|
||||
if (formattedWords[0] === "Failed" || formattedWords[0] === "Succeeded") {
|
||||
return formattedWords.join(" ") + ".";
|
||||
}
|
||||
|
||||
return formattedWords.join(" ") + "...";
|
||||
}
|
||||
|
||||
export default formatState;
|
||||
Reference in New Issue
Block a user