From 315d309a4146f5035d05118807db71252b8b8f3c Mon Sep 17 00:00:00 2001 From: Xavier Abad <77491413+xabg2@users.noreply.github.com> Date: Wed, 25 Mar 2026 10:46:59 +0100 Subject: [PATCH] feat: add support section --- .env.example | 3 ++- package-lock.json | 10 ++++++++ package.json | 1 + .../general/components/support/index.tsx | 25 +++++++++++++++++++ .../preferences/sections/general/index.tsx | 3 ++- src/i18n/locales/en.json | 6 ++++- src/i18n/locales/es.json | 6 ++++- src/i18n/locales/fr.json | 6 ++++- src/i18n/locales/it.json | 6 ++++- src/main.tsx | 21 ++++++++++------ src/services/config/index.ts | 1 + src/types/config/index.ts | 1 + 12 files changed, 76 insertions(+), 13 deletions(-) create mode 100644 src/components/preferences/sections/general/components/support/index.tsx diff --git a/.env.example b/.env.example index 2ea51e1..a3d6972 100644 --- a/.env.example +++ b/.env.example @@ -3,4 +3,5 @@ VITE_DRIVE_API_URL= VITE_MAGIC_IV= VITE_MAGIC_SALT= VITE_CRYPTO_SECRET= -VITE_DRIVE_APP_URL= \ No newline at end of file +VITE_DRIVE_APP_URL= +VITE_INTERCOM_PROVIDER_KEY= \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 717d7ed..a67abde 100644 --- a/package-lock.json +++ b/package-lock.json @@ -35,6 +35,7 @@ "react-hot-toast": "^2.6.0", "react-hotkeys-hook": "^5.2.4", "react-i18next": "^16.5.4", + "react-live-chat-loader": "^2.11.0", "react-redux": "^9.2.0", "react-router-dom": "^7.13.1", "tailwindcss": "^4.2.1", @@ -8347,6 +8348,15 @@ "version": "16.13.1", "license": "MIT" }, + "node_modules/react-live-chat-loader": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/react-live-chat-loader/-/react-live-chat-loader-2.11.0.tgz", + "integrity": "sha512-Nq1oK249vvQbjZUuoIcNzT4+9VWJoLL7c3ss5ykod8JFs0Vh0R5u5WZGAK3LoCwXTRxknXyfKAzCIGI+0RC+HQ==", + "license": "MIT", + "peerDependencies": { + "react": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, "node_modules/react-redux": { "version": "9.2.0", "license": "MIT", diff --git a/package.json b/package.json index 69af1b8..74c4482 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "react-hot-toast": "^2.6.0", "react-hotkeys-hook": "^5.2.4", "react-i18next": "^16.5.4", + "react-live-chat-loader": "^2.11.0", "react-redux": "^9.2.0", "react-router-dom": "^7.13.1", "tailwindcss": "^4.2.1", diff --git a/src/components/preferences/sections/general/components/support/index.tsx b/src/components/preferences/sections/general/components/support/index.tsx new file mode 100644 index 0000000..2e7b5ca --- /dev/null +++ b/src/components/preferences/sections/general/components/support/index.tsx @@ -0,0 +1,25 @@ +import { useChat } from 'react-live-chat-loader'; + +import { Button } from '@internxt/ui'; +import PreferenceSectionLayout from '../PreferenceSectionLayout'; +import { useTranslationContext } from '@/i18n'; + +const Support = () => { + const { translate } = useTranslationContext(); + const [, loadChat] = useChat(); + + const onClick = () => { + loadChat({ open: true }); + }; + + return ( + +

{translate('modals.preferences.sections.general.support.description')}

+ +
+ ); +}; + +export default Support; diff --git a/src/components/preferences/sections/general/index.tsx b/src/components/preferences/sections/general/index.tsx index f110bb6..171c723 100644 --- a/src/components/preferences/sections/general/index.tsx +++ b/src/components/preferences/sections/general/index.tsx @@ -2,6 +2,7 @@ import { useTranslationContext } from '@/i18n'; import PreferencesSection from '../../components/PreferencesSection'; import Appearance from './components/appearance'; import Language from './components/language'; +import Support from './components/support'; const GeneralSection = ({ onClose }: { onClose: () => void }) => { const { translate } = useTranslationContext(); @@ -11,9 +12,9 @@ const GeneralSection = ({ onClose }: { onClose: () => void }) => { title={translate('modals.preferences.sections.general.title')} onClose={onClose} > - {/* TODO: Add language and support components */} + ); }; diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index 0dfa486..51119f6 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -132,7 +132,11 @@ "fr": "Français (French)", "it": "Italiano (Italian)" }, - "support": "Support" + "support": { + "title": "Support", + "description": "Navigate helpful articles or get assistance from our team.", + "cta": "Open Support Centre" + } } } } diff --git a/src/i18n/locales/es.json b/src/i18n/locales/es.json index 3b9bb00..cafdafa 100644 --- a/src/i18n/locales/es.json +++ b/src/i18n/locales/es.json @@ -132,7 +132,11 @@ "fr": "Français (Francés)", "it": "Italiano (Italiano)" }, - "support": "Soporte" + "support": { + "title": "Soporte", + "description": "Consulta artículos de ayuda u obtén asistencia de nuestro equipo.", + "cta": "Abrir Centro de Soporte" + } } } } diff --git a/src/i18n/locales/fr.json b/src/i18n/locales/fr.json index 26c28bf..a4c2cdd 100644 --- a/src/i18n/locales/fr.json +++ b/src/i18n/locales/fr.json @@ -132,7 +132,11 @@ "fr": "Français (French)", "it": "Italiano (Italien)" }, - "support": "Support" + "support": { + "title": "Support", + "description": "Consultez des articles d'aide ou obtenez l'assistance de notre équipe.", + "cta": "Ouvrir le Centre d'assistance" + } } } } diff --git a/src/i18n/locales/it.json b/src/i18n/locales/it.json index 6d87cd1..ef0f2c0 100644 --- a/src/i18n/locales/it.json +++ b/src/i18n/locales/it.json @@ -132,7 +132,11 @@ "fr": "Français (Francese)", "it": "Italiano (Italian)" }, - "support": "Supporto" + "support": { + "title": "Supporto", + "description": "Consulta articoli di aiuto o ricevi assistenza dal nostro team.", + "cta": "Apri il Centro assistenza" + } } } } diff --git a/src/main.tsx b/src/main.tsx index 98ca6eb..67b4a9c 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -7,17 +7,24 @@ import { store } from './store/index.ts'; import { userActions } from './store/slices/user/index.ts'; import { Provider } from 'react-redux'; import { ThemeProvider } from './context/theme/ThemeProvider.tsx'; +import { LiveChatLoaderProvider } from 'react-live-chat-loader'; +import { ConfigService } from './services/config/index.ts'; store.dispatch(userActions.initialize()); createRoot(document.getElementById('root')!).render( - - - - - - - + + + + + + + + + , ); diff --git a/src/services/config/index.ts b/src/services/config/index.ts index ec31b20..116545b 100644 --- a/src/services/config/index.ts +++ b/src/services/config/index.ts @@ -20,6 +20,7 @@ const configKeys: Record = { MAGIC_IV: 'VITE_MAGIC_IV', MAGIC_SALT: 'VITE_MAGIC_SALT', DRIVE_APP_URL: 'VITE_DRIVE_APP_URL', + INTERCOM_PROVIDER_KEY: 'VITE_INTERCOM_PROVIDER_KEY', }; export class ConfigService { diff --git a/src/types/config/index.ts b/src/types/config/index.ts index 55a43c9..31b479b 100644 --- a/src/types/config/index.ts +++ b/src/types/config/index.ts @@ -36,4 +36,5 @@ export interface ConfigKeys { MAGIC_IV: string; MAGIC_SALT: string; DRIVE_APP_URL: string; + INTERCOM_PROVIDER_KEY: string; }