Skip to content

armgit / ente

Public Imported from GitHub
0

💚 End-to-end encrypted cloud for everything.

Improve simple-icon path creation

Neeraj Guptac07e2f1387e5
diff --git a/auth/lib/ui/utils/icon_utils.dart b/auth/lib/ui/utils/icon_utils.dart
index 98806964b3..9487ac8b8d 100644
--- a/auth/lib/ui/utils/icon_utils.dart
+++ b/auth/lib/ui/utils/icon_utils.dart
@@ -74,6 +74,7 @@ class IconUtils {
title: simpleEntry.key,
type: IconType.simpleIcon,
color: simpleEntry.value,
+ slug: simpleEntry.value
);
processedIconPaths.add(simpleIconPath);
}
@@ -247,37 +248,40 @@ class CustomIconData {
CustomIconData(this.slug, this.color);
}
+final charMap = {
+ 'á': 'a',
+ 'à': 'a',
+ 'â': 'a',
+ 'ä': 'a',
+ 'é': 'e',
+ 'è': 'e',
+ 'ê': 'e',
+ 'ë': 'e',
+ 'í': 'i',
+ 'ì': 'i',
+ 'î': 'i',
+ 'ï': 'i',
+ 'ó': 'o',
+ 'ò': 'o',
+ 'ô': 'o',
+ 'ö': 'o',
+ 'ú': 'u',
+ 'ù': 'u',
+ 'û': 'u',
+ 'ü': 'u',
+ 'ç': 'c',
+ 'ñ': 'n',
+ '.': 'dot',
+ '-': '',
+ '&': 'and',
+ '+': 'plus',
+ ':': '',
+ "'": '',
+ '/': '',
+ '!': '',
+};
String normalizeSimpleIconName(String input) {
- final charMap = {
- 'á': 'a',
- 'à': 'a',
- 'â': 'a',
- 'ä': 'a',
- 'é': 'e',
- 'è': 'e',
- 'ê': 'e',
- 'ë': 'e',
- 'í': 'i',
- 'ì': 'i',
- 'î': 'i',
- 'ï': 'i',
- 'ó': 'o',
- 'ò': 'o',
- 'ô': 'o',
- 'ö': 'o',
- 'ú': 'u',
- 'ù': 'u',
- 'û': 'u',
- 'ü': 'u',
- 'ç': 'c',
- 'ñ': 'n',
- '.': 'dot',
- '-': 'dash',
- '&': 'and',
- };
-
final buffer = StringBuffer();
-
for (var char in input.characters) {
buffer.write(charMap[char] ?? char);
}