From 3a9ff75b8ffd4d12bb4a6c18c3ce4f01cdbfec64 Mon Sep 17 00:00:00 2001 From: olcxja Date: Thu, 16 Jul 2026 17:22:29 +0200 Subject: [PATCH] move icons to separate file --- android/app/src/main/assets/public/icons.js | 60 ++++++++++++ android/app/src/main/assets/public/index.html | 16 ++-- android/app/src/main/assets/public/main.js | 42 +++----- android/app/src/main/assets/public/screens.js | 95 ++++++++----------- webroot/icons.js | 60 ++++++++++++ webroot/index.html | 16 ++-- webroot/main.js | 42 +++----- webroot/screens.js | 95 ++++++++----------- 8 files changed, 238 insertions(+), 188 deletions(-) create mode 100644 android/app/src/main/assets/public/icons.js create mode 100644 webroot/icons.js diff --git a/android/app/src/main/assets/public/icons.js b/android/app/src/main/assets/public/icons.js new file mode 100644 index 00000000..2d05a6b2 --- /dev/null +++ b/android/app/src/main/assets/public/icons.js @@ -0,0 +1,60 @@ +// icons.js - Centralized SVG definitions + +const ICONS = { + _create: function(content, defaultProps, customProps = {}) { + let p = { ...defaultProps, ...customProps }; + let strokeAttrs = p.strokeWidth ? ` stroke-width="${p.strokeWidth}" stroke-linecap="${p.strokeLinecap}" stroke-linejoin="${p.strokeLinejoin}"` : ""; + let classAttr = p.className ? ` class="${p.className}"` : ""; + let styleAttr = p.style ? ` style="${p.style}"` : ""; + + return `${content}`; + }, + _material: function(content, props) { + return this._create(content, { viewBox: "0 -960 960 960", width: "1.4rem", height: "1.4rem", fill: "var(--text-color)", stroke: "none" }, props); + }, + _feather: function(content, props) { + return this._create(content, { viewBox: "0 0 24 24", width: "1.4rem", height: "1.4rem", fill: "none", stroke: "var(--text-color)", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, props); + }, + + addChat: (props) => ICONS._material(``, props), + createGroup: (props) => ICONS._material(``, props), + createSpace: (props) => ICONS._material(``, props), + joinSpace: (props) => ICONS._material(``, props), + invites: (props) => ICONS._material(``, props), + notifications: (props) => ICONS._material(``, props), + close: (props) => ICONS._material(``, props), + check: (props) => ICONS._material(``, props), + delete: (props) => ICONS._material(``, props), + menu: (props) => ICONS._material(``, props), + arrowBack: (props) => ICONS._material(``, props), + pin: (props) => ICONS._material(``, props), + call: (props) => ICONS._material(``, props), + account: (props) => ICONS._material(``, props), + settings: (props) => ICONS._material(``, props), + profile: (props) => ICONS._material(``, props), + replyAction: (props) => ICONS._material(``, props), + react: (props) => ICONS._material(``, props), + settingsProfile: (props) => ICONS._material(``, props), + + download: (props) => ICONS._feather(``, props), + camera: (props) => ICONS._feather(``, props), + image: (props) => ICONS._feather(``, props), + fileText: (props) => ICONS._feather(``, props), + poll: (props) => ICONS._feather(``, props), + send: (props) => ICONS._create(``, { viewBox: "0 0 16 16", width: "1.5rem", height: "1.5rem", fill: "none", stroke: "none" }, props), + plus: (props) => ICONS._feather(``, props), + chevronDown: (props) => ICONS._feather(``, props), + lockOpen: (props) => ICONS._feather(``, props), + cornerUpLeft: (props) => ICONS._feather(``, props), + spinner: (props) => ICONS._create(``, { viewBox: "0 0 50 50", width: "24px", height: "24px", fill: "none", stroke: "none", className: "spinner" }, props), + video: (props) => ICONS._feather(``, props), + file: (props) => ICONS._feather(``, props), + + + home: (props) => ICONS._create(``, { viewBox: "-1 -1 18 18", width: "24", height: "24", fill: "none", stroke: "none" }, props), + inbox: (props) => ICONS._material(``, props), + + avatar: function(initials, color, size) { + return `${initials}`; + } +}; diff --git a/android/app/src/main/assets/public/index.html b/android/app/src/main/assets/public/index.html index a5daae41..e30afd98 100644 --- a/android/app/src/main/assets/public/index.html +++ b/android/app/src/main/assets/public/index.html @@ -12,6 +12,7 @@ --> + @@ -26,20 +27,14 @@
@@ -48,7 +43,7 @@ @@ -89,7 +84,7 @@
@@ -114,6 +109,7 @@ + --> + @@ -26,20 +27,14 @@

@@ -48,7 +43,7 @@ @@ -89,7 +84,7 @@
@@ -114,6 +109,7 @@ +