From 843d75e92c3847143d64d84dd4111016706f2492 Mon Sep 17 00:00:00 2001 From: Nicola Benaglia Date: Fri, 30 May 2025 07:42:05 +0200 Subject: [PATCH 01/15] Fix typo --- src/components/Apps/AppsPrivate.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Apps/AppsPrivate.tsx b/src/components/Apps/AppsPrivate.tsx index 3fe611b..a353b82 100644 --- a/src/components/Apps/AppsPrivate.tsx +++ b/src/components/Apps/AppsPrivate.tsx @@ -575,7 +575,7 @@ export const AppsPrivate = ({ myName }) => { From 3a77600f6a41d951b70111bf21e0415939dea503 Mon Sep 17 00:00:00 2001 From: Nicola Benaglia Date: Fri, 30 May 2025 07:50:37 +0200 Subject: [PATCH 02/15] Refactor --- src/i18n/locales/it/core.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/i18n/locales/it/core.json b/src/i18n/locales/it/core.json index 213a415..cccba97 100644 --- a/src/i18n/locales/it/core.json +++ b/src/i18n/locales/it/core.json @@ -114,7 +114,7 @@ "apps_dashboard": "dashboard delle app", "apps_official": "app ufficiali", "attachment": "allegato", - "balance": "bilancia:", + "balance": "bilancio:", "basic_tabs_example": "esempio di schede base", "category": "categoria", "category_other": "categorie", From f445bcd5b14b2b39ad49f4d2de02cafb2dc359d3 Mon Sep 17 00:00:00 2001 From: Nicola Benaglia Date: Fri, 30 May 2025 08:07:36 +0200 Subject: [PATCH 03/15] Set key for list in direct messages --- src/components/Group/Group.tsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/components/Group/Group.tsx b/src/components/Group/Group.tsx index 641132b..105f258 100644 --- a/src/components/Group/Group.tsx +++ b/src/components/Group/Group.tsx @@ -1726,6 +1726,7 @@ export const Group = ({ > {directs.map((direct: any) => ( Date: Fri, 30 May 2025 08:16:31 +0200 Subject: [PATCH 04/15] Refactor property names --- src/assets/Icons/NavCloseTab.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/assets/Icons/NavCloseTab.tsx b/src/assets/Icons/NavCloseTab.tsx index 6062175..b8f295a 100644 --- a/src/assets/Icons/NavCloseTab.tsx +++ b/src/assets/Icons/NavCloseTab.tsx @@ -30,14 +30,14 @@ export const NavCloseTab: React.FC = ({ From 5215e7ad5bb0c56fc4ec0c35d6b53594a0116a3b Mon Sep 17 00:00:00 2001 From: Nicola Benaglia Date: Fri, 30 May 2025 08:16:49 +0200 Subject: [PATCH 05/15] Sort properties --- src/components/Apps/AppsDesktop.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/Apps/AppsDesktop.tsx b/src/components/Apps/AppsDesktop.tsx index 98dfe6d..37d7648 100644 --- a/src/components/Apps/AppsDesktop.tsx +++ b/src/components/Apps/AppsDesktop.tsx @@ -524,12 +524,12 @@ export const AppsDesktop = ({ } return ( ); })} @@ -539,20 +539,20 @@ export const AppsDesktop = ({ From 9727711b04d52402ce77f5496d28016ede6fe0dc Mon Sep 17 00:00:00 2001 From: Nicola Benaglia Date: Fri, 30 May 2025 08:17:05 +0200 Subject: [PATCH 06/15] Set src value or undefined --- src/components/Apps/AppViewer.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Apps/AppViewer.tsx b/src/components/Apps/AppViewer.tsx index 38cfe71..98a0b8a 100644 --- a/src/components/Apps/AppViewer.tsx +++ b/src/components/Apps/AppViewer.tsx @@ -278,7 +278,7 @@ export const AppViewer = forwardRef( width: '100%', }} id="browser-iframe" - src={defaultUrl} + src={defaultUrl || undefined} sandbox="allow-scripts allow-same-origin allow-forms allow-downloads allow-modals" allow="fullscreen; clipboard-read; clipboard-write" > From d45e9557b34ab189edfbaa0052327049dc0b7214 Mon Sep 17 00:00:00 2001 From: Nicola Benaglia Date: Fri, 30 May 2025 08:57:53 +0200 Subject: [PATCH 07/15] Refactor selectedTab --- src/components/Apps/AppsNavBarDesktop.tsx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/components/Apps/AppsNavBarDesktop.tsx b/src/components/Apps/AppsNavBarDesktop.tsx index 2eeecc6..74e0ca0 100644 --- a/src/components/Apps/AppsNavBarDesktop.tsx +++ b/src/components/Apps/AppsNavBarDesktop.tsx @@ -67,7 +67,7 @@ export function saveToLocalStorage(key, subKey, newValue) { export const AppsNavBarDesktop = ({ disableBack }) => { const [tabs, setTabs] = useState([]); - const [selectedTab, setSelectedTab] = useState(null); + const [selectedTab, setSelectedTab] = useState(0); const [navigationController, setNavigationController] = useAtom( navigationControllerAtom ); @@ -125,7 +125,7 @@ export const AppsNavBarDesktop = ({ disableBack }) => { const setTabsToNav = (e) => { const { tabs, selectedTab, isNewTabWindow } = e.detail?.data; setTabs([...tabs]); - setSelectedTab(!selectedTab ? null : { ...selectedTab }); + setSelectedTab(!selectedTab ? 0 : { ...selectedTab }); setIsNewTabWindow(isNewTabWindow); }; @@ -190,9 +190,7 @@ export const AppsNavBarDesktop = ({ disableBack }) => { { maxHeight: `275px`, // Ensure the tabs container fits within the available space overflow: 'hidden', // Prevents overflow on small screens }} + value={false} > {tabs?.map((tab) => ( { > { - setSelectedTab(null); + setSelectedTab(0); executeEvent('newTabWindow', {}); }} > From 2c9eee8404e483f8d5d619927d2c1672bada033e Mon Sep 17 00:00:00 2001 From: Nicola Benaglia Date: Fri, 30 May 2025 08:58:07 +0200 Subject: [PATCH 08/15] Sort --- src/components/Apps/AppViewerContainer.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Apps/AppViewerContainer.tsx b/src/components/Apps/AppViewerContainer.tsx index 38c017b..ae05788 100644 --- a/src/components/Apps/AppViewerContainer.tsx +++ b/src/components/Apps/AppViewerContainer.tsx @@ -40,11 +40,11 @@ const AppViewerContainer = forwardRef( }} > ); From 0b0f5e0c073121f70a78e3a7cd7d2cf7e6b51b3b Mon Sep 17 00:00:00 2001 From: Nicola Benaglia Date: Fri, 30 May 2025 08:58:17 +0200 Subject: [PATCH 09/15] Refactor CustomButtonAccept --- src/App.tsx | 8 ++++---- src/components/GlobalActions/JoinGroup.tsx | 8 ++++---- src/styles/App-styles.ts | 23 +++++++++++----------- 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index b898a14..92e0965 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -3848,8 +3848,8 @@ function App() { }} > { disabled={isInGroup} > { ({ })); interface CustomButtonProps { - bgColor?: string; - color?: string; + customBgColor?: string; + customColor?: string; } -export const CustomButtonAccept = styled(Box)( - ({ bgColor, color, theme }) => ({ +export const CustomButtonAccept = styled(Box)((props) => { + const { customBgColor, customColor, theme } = props; + return { alignItems: 'center', - backgroundColor: bgColor || theme.palette.background.default, + backgroundColor: customBgColor || theme.palette.background.default, borderColor: theme.palette.background.paper, borderRadius: 5, borderStyle: 'solid', borderWidth: '0.5px', boxSizing: 'border-box', - color: color || theme.palette.background.default, + color: customColor || theme.palette.background.default, cursor: 'pointer', display: 'inline-flex', filter: 'drop-shadow(1px 4px 10.5px rgba(0,0,0,0.3))', @@ -163,16 +164,16 @@ export const CustomButtonAccept = styled(Box)( width: 'fit-content', '&:hover': { opacity: 1, - backgroundColor: bgColor || theme.palette.background.default, - color: color || '#fff', + backgroundColor: customBgColor || theme.palette.background.default, + color: customColor || '#fff', svg: { path: { - fill: color || '#fff', + fill: customColor || '#fff', }, }, }, - }) -); + }; +}); export const CustomInput = styled(TextField)(({ theme }) => ({ backgroundColor: theme.palette.background.default, From be5c3af318967c2b70dd056b9c34605604e221dd Mon Sep 17 00:00:00 2001 From: Nicola Benaglia Date: Fri, 30 May 2025 09:12:00 +0200 Subject: [PATCH 10/15] Add comment (temporary) --- src/components/Apps/AppViewer.tsx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/components/Apps/AppViewer.tsx b/src/components/Apps/AppViewer.tsx index 98a0b8a..9c82ebd 100644 --- a/src/components/Apps/AppViewer.tsx +++ b/src/components/Apps/AppViewer.tsx @@ -36,6 +36,11 @@ export const AppViewer = forwardRef( if (app?.isPreview) return; if (isDevMode) { setUrl(app?.url + `?theme=${themeMode}&lang=${currentLang}`); + console.log( + 'AAAAAAAAAAA---->' + + app.url + + `&theme=${themeMode}&lang=${currentLang}` + ); // TODO remove comment return; } let hasQueryParam = false; @@ -52,8 +57,14 @@ export const AppViewer = forwardRef( if (app?.isPreview && app?.url) { resetHistory(); setUrl(app.url + `&theme=${themeMode}&lang=${currentLang}`); + console.log( + 'AAAAAAAAAAA---->' + + app.url + + `&theme=${themeMode}&lang=${currentLang}` + ); // TODO remove comment } }, [app?.url, app?.isPreview]); + const defaultUrl = useMemo(() => { return url; }, [url, isDevMode]); @@ -68,6 +79,12 @@ export const AppViewer = forwardRef( app?.url + `?time=${Date.now()}&theme=${themeMode}&lang=${currentLang}` ); + + console.log( + 'AAAAAAAAAAA---->' + + app?.url + + `?time=${Date.now()}&theme=${themeMode}&lang=${currentLang}` + ); // TODO remove comment } return; } @@ -89,6 +106,7 @@ export const AppViewer = forwardRef( if (!iframe) return; try { + console.log('THEME_CHANGED---->' + iframe.src); // TODO remove comment const targetOrigin = new URL(iframe.src).origin; iframe.contentWindow?.postMessage( { action: 'THEME_CHANGED', theme: themeMode, requestedHandler: 'UI' }, @@ -104,6 +122,7 @@ export const AppViewer = forwardRef( if (!iframe) return; try { + console.log('LANGUAGE_CHANGED---->' + iframe.src); // TODO remove comment const targetOrigin = new URL(iframe.src).origin; iframe.contentWindow?.postMessage( { From 1f5a604932b1bd1bcee8acae2fd99f965c204c35 Mon Sep 17 00:00:00 2001 From: Nicola Benaglia Date: Fri, 30 May 2025 09:22:07 +0200 Subject: [PATCH 11/15] Add types --- src/components/Apps/AppViewer.tsx | 9 ++- src/components/Apps/AppViewerContainer.tsx | 74 ++++++++++++---------- 2 files changed, 50 insertions(+), 33 deletions(-) diff --git a/src/components/Apps/AppViewer.tsx b/src/components/Apps/AppViewer.tsx index 9c82ebd..606f80a 100644 --- a/src/components/Apps/AppViewer.tsx +++ b/src/components/Apps/AppViewer.tsx @@ -7,7 +7,14 @@ import { useQortalMessageListener } from '../../hooks/useQortalMessageListener'; import { useThemeContext } from '../Theme/ThemeContext'; import { useTranslation } from 'react-i18next'; -export const AppViewer = forwardRef( +type AppViewerProps = { + app: any; + hide: boolean; + isDevMode: boolean; + skipAuth?: boolean; +}; + +export const AppViewer = forwardRef( ({ app, hide, isDevMode, skipAuth }, iframeRef) => { const { window: frameWindow } = useFrame(); const { path, history, changeCurrentIndex, resetHistory } = diff --git a/src/components/Apps/AppViewerContainer.tsx b/src/components/Apps/AppViewerContainer.tsx index ae05788..e26eb4a 100644 --- a/src/components/Apps/AppViewerContainer.tsx +++ b/src/components/Apps/AppViewerContainer.tsx @@ -2,15 +2,26 @@ import { forwardRef } from 'react'; import { AppViewer } from './AppViewer'; import Frame from 'react-frame-component'; -const AppViewerContainer = forwardRef( - ({ app, isSelected, hide, isDevMode, customHeight, skipAuth }, ref) => { - return ( - - - - } - style={{ - border: 'none', - height: customHeight || '100vh', - left: (!isSelected || hide) && '-200vw', - overflow: 'hidden', - position: (!isSelected || hide) && 'fixed', - width: '100%', - }} - > - - - ); - } -); + + + } + style={{ + border: 'none', + height: customHeight || '100vh', + left: (!isSelected || hide) && '-200vw', + overflow: 'hidden', + position: (!isSelected || hide) && 'fixed', + width: '100%', + }} + > + + + ); +}); export default AppViewerContainer; From 1de84262b1fbcefe6f8fecc5f5cf1de0d5067c94 Mon Sep 17 00:00:00 2001 From: Nicola Benaglia Date: Fri, 30 May 2025 09:31:27 +0200 Subject: [PATCH 12/15] Add optional --- src/components/Apps/AppsNavBarDesktop.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Apps/AppsNavBarDesktop.tsx b/src/components/Apps/AppsNavBarDesktop.tsx index 74e0ca0..70aeade 100644 --- a/src/components/Apps/AppsNavBarDesktop.tsx +++ b/src/components/Apps/AppsNavBarDesktop.tsx @@ -204,7 +204,7 @@ export const AppsNavBarDesktop = ({ disableBack }) => { > {tabs?.map((tab) => ( Date: Fri, 30 May 2025 13:34:33 +0200 Subject: [PATCH 13/15] Remove comments --- src/components/Apps/AppViewer.tsx | 18 ------------------ src/components/Apps/AppViewerContainer.tsx | 2 +- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/src/components/Apps/AppViewer.tsx b/src/components/Apps/AppViewer.tsx index 606f80a..0cdad98 100644 --- a/src/components/Apps/AppViewer.tsx +++ b/src/components/Apps/AppViewer.tsx @@ -43,11 +43,6 @@ export const AppViewer = forwardRef( if (app?.isPreview) return; if (isDevMode) { setUrl(app?.url + `?theme=${themeMode}&lang=${currentLang}`); - console.log( - 'AAAAAAAAAAA---->' + - app.url + - `&theme=${themeMode}&lang=${currentLang}` - ); // TODO remove comment return; } let hasQueryParam = false; @@ -64,11 +59,6 @@ export const AppViewer = forwardRef( if (app?.isPreview && app?.url) { resetHistory(); setUrl(app.url + `&theme=${themeMode}&lang=${currentLang}`); - console.log( - 'AAAAAAAAAAA---->' + - app.url + - `&theme=${themeMode}&lang=${currentLang}` - ); // TODO remove comment } }, [app?.url, app?.isPreview]); @@ -86,12 +76,6 @@ export const AppViewer = forwardRef( app?.url + `?time=${Date.now()}&theme=${themeMode}&lang=${currentLang}` ); - - console.log( - 'AAAAAAAAAAA---->' + - app?.url + - `?time=${Date.now()}&theme=${themeMode}&lang=${currentLang}` - ); // TODO remove comment } return; } @@ -113,7 +97,6 @@ export const AppViewer = forwardRef( if (!iframe) return; try { - console.log('THEME_CHANGED---->' + iframe.src); // TODO remove comment const targetOrigin = new URL(iframe.src).origin; iframe.contentWindow?.postMessage( { action: 'THEME_CHANGED', theme: themeMode, requestedHandler: 'UI' }, @@ -129,7 +112,6 @@ export const AppViewer = forwardRef( if (!iframe) return; try { - console.log('LANGUAGE_CHANGED---->' + iframe.src); // TODO remove comment const targetOrigin = new URL(iframe.src).origin; iframe.contentWindow?.postMessage( { diff --git a/src/components/Apps/AppViewerContainer.tsx b/src/components/Apps/AppViewerContainer.tsx index e26eb4a..5f6e30d 100644 --- a/src/components/Apps/AppViewerContainer.tsx +++ b/src/components/Apps/AppViewerContainer.tsx @@ -3,7 +3,7 @@ import { AppViewer } from './AppViewer'; import Frame from 'react-frame-component'; type AppViewerContainerProps = { - app: any; // Replace `any` with the correct type of `tab` if available + app: any; isSelected: boolean; hide: boolean; isDevMode: boolean; From f5294d6ea103c27dd91c240149e0b7f9dde57109 Mon Sep 17 00:00:00 2001 From: Nicola Benaglia Date: Fri, 30 May 2025 13:40:37 +0200 Subject: [PATCH 14/15] Remove undefined --- src/components/Apps/AppViewer.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Apps/AppViewer.tsx b/src/components/Apps/AppViewer.tsx index 0cdad98..75b468b 100644 --- a/src/components/Apps/AppViewer.tsx +++ b/src/components/Apps/AppViewer.tsx @@ -286,7 +286,7 @@ export const AppViewer = forwardRef( width: '100%', }} id="browser-iframe" - src={defaultUrl || undefined} + src={defaultUrl} sandbox="allow-scripts allow-same-origin allow-forms allow-downloads allow-modals" allow="fullscreen; clipboard-read; clipboard-write" > From b26c6ea7db20c587cf8a01e03247bd3cab7d0666 Mon Sep 17 00:00:00 2001 From: Nicola Benaglia Date: Fri, 30 May 2025 13:53:46 +0200 Subject: [PATCH 15/15] Add refresh action as key --- src/components/Apps/AppsNavBarDesktop.tsx | 5 ++-- src/i18n/locales/en/core.json | 1 + src/i18n/locales/es/core.json | 29 ++++++++++++----------- src/i18n/locales/fr/core.json | 1 + src/i18n/locales/it/core.json | 1 + src/i18n/locales/ja/core.json | 1 + src/i18n/locales/ru/core.json | 1 + src/i18n/locales/zh/core.json | 1 + 8 files changed, 24 insertions(+), 16 deletions(-) diff --git a/src/components/Apps/AppsNavBarDesktop.tsx b/src/components/Apps/AppsNavBarDesktop.tsx index 70aeade..b26391f 100644 --- a/src/components/Apps/AppsNavBarDesktop.tsx +++ b/src/components/Apps/AppsNavBarDesktop.tsx @@ -407,7 +407,6 @@ export const AppsNavBarDesktop = ({ disableBack }) => { tabId: selectedTab?.tabId, }); } - handleClose(); }} > @@ -433,7 +432,9 @@ export const AppsNavBarDesktop = ({ disableBack }) => { color: theme.palette.text.primary, }, }} - primary="Refresh" + primary={t('core:action.refresh', { + postProcess: 'capitalizeFirstChar', + })} /> diff --git a/src/i18n/locales/en/core.json b/src/i18n/locales/en/core.json index aa6f209..6695e9c 100644 --- a/src/i18n/locales/en/core.json +++ b/src/i18n/locales/en/core.json @@ -68,6 +68,7 @@ "publish": "publish", "publish_app": "publish your app", "publish_comment": "publish comment", + "refresh": "refresh", "register_name": "register name", "remove": "remove", "remove_reaction": "remove reaction", diff --git a/src/i18n/locales/es/core.json b/src/i18n/locales/es/core.json index d56577d..33544ab 100644 --- a/src/i18n/locales/es/core.json +++ b/src/i18n/locales/es/core.json @@ -68,21 +68,22 @@ "publish_app": "publica tu aplicación", "publish_comment": "publicar comentario", "register_name": "nombre de registro", - "remove": "eliminar", - "remove_reaction": "eliminar la reacción", + "refresh": "refresca", + "remove": "elimina", + "remove_reaction": "elimina la reacción", "return_apps_dashboard": "volver al tablero de aplicaciones", - "save": "ahorrar", - "save_disk": "guardar en el disco", - "search": "buscar", - "search_apps": "buscar aplicaciones", - "search_groups": "buscar grupos", - "search_chat_text": "search Chat Text", - "select_app_type": "seleccionar el tipo de aplicación", - "select_category": "seleccionar categoría", - "select_name_app": "seleccionar nombre/aplicación", - "send": "enviar", - "send_qort": "enviar Qort", - "set_avatar": "establecer avatar", + "save": "ahorra", + "save_disk": "guarda en el disco", + "search": "busca", + "search_apps": "busca aplicaciones", + "search_groups": "busca grupos", + "search_chat_text": "busca Chat Text", + "select_app_type": "selecciona el tipo de aplicación", + "select_category": "selecciona categoría", + "select_name_app": "selecciona nombre/aplicación", + "send": "envia", + "send_qort": "envia Qort", + "set_avatar": "establece avatar", "show": "espectáculo", "show_poll": "encuesta", "start_minting": "empiece a acuñar", diff --git a/src/i18n/locales/fr/core.json b/src/i18n/locales/fr/core.json index 0dcca9d..d1452f7 100644 --- a/src/i18n/locales/fr/core.json +++ b/src/i18n/locales/fr/core.json @@ -67,6 +67,7 @@ "publish": "publier", "publish_app": "publiez votre application", "publish_comment": "publier un commentaire", + "refresh": "rafraîche", "register_name": "nom de registre", "remove": "retirer", "remove_reaction": "éliminer la réaction", diff --git a/src/i18n/locales/it/core.json b/src/i18n/locales/it/core.json index cccba97..9a6af16 100644 --- a/src/i18n/locales/it/core.json +++ b/src/i18n/locales/it/core.json @@ -68,6 +68,7 @@ "publish": "pubblica", "publish_app": "pubblica la tua app", "publish_comment": "pubblica un commento", + "refresh": "aggiorna", "register_name": "registra nome", "remove": "rimuovi", "remove_reaction": "rimuovi la reazione", diff --git a/src/i18n/locales/ja/core.json b/src/i18n/locales/ja/core.json index 9194451..570210d 100644 --- a/src/i18n/locales/ja/core.json +++ b/src/i18n/locales/ja/core.json @@ -67,6 +67,7 @@ "publish": "公開", "publish_app": "アプリを公開します", "publish_comment": "コメントを公開します", + "refresh": "リフレッシュ", "register_name": "登録名", "remove": "取り除く", "remove_reaction": "反応を取り除きます", diff --git a/src/i18n/locales/ru/core.json b/src/i18n/locales/ru/core.json index 927cec1..f93831d 100644 --- a/src/i18n/locales/ru/core.json +++ b/src/i18n/locales/ru/core.json @@ -67,6 +67,7 @@ "publish": "публиковать", "publish_app": "Публикуйте свое приложение", "publish_comment": "Публикуйте комментарий", + "refresh": "освежить", "register_name": "зарегистрировать имя", "remove": "удалять", "remove_reaction": "удалить реакцию", diff --git a/src/i18n/locales/zh/core.json b/src/i18n/locales/zh/core.json index 51168b8..3622901 100644 --- a/src/i18n/locales/zh/core.json +++ b/src/i18n/locales/zh/core.json @@ -67,6 +67,7 @@ "publish": "发布", "publish_app": "发布您的应用", "publish_comment": "发布评论", + "refresh": "刷新", "register_name": "登记名称", "remove": "消除", "remove_reaction": "删除反应",