From cbbea733747b329c45d5d2cc1b9906738bcbcf12 Mon Sep 17 00:00:00 2001 From: Gleidson Daniel Silva Date: Wed, 9 Aug 2023 16:15:10 -0300 Subject: [PATCH] feat: add new video conf block - Issue (#5150) * improve build-icon-set script * update mappedIcons with new icons, and orderBy name * add new icons fonts * add phone-issue icon * create VideoConferenceIssue block * verify error and return issue block --- android/app/src/main/assets/fonts/custom.ttf | Bin 56384 -> 56676 bytes app/containers/CustomIcon/mappedIcons.js | 133 +++++++++--------- app/containers/CustomIcon/selection.json | 2 +- app/containers/ImageViewer/ImageComponent.ts | 2 +- .../VideoConferenceBaseContainer.tsx | 10 +- .../components/VideoConferenceIssue.tsx | 18 +++ .../UIKit/VideoConferenceBlock/index.tsx | 5 +- app/i18n/locales/en.json | 2 + app/i18n/locales/pt-BR.json | 2 + app/lib/constants/colors.ts | 6 + ios/custom.ttf | Bin 56384 -> 56676 bytes scripts/build-icon-set.js | 32 ++++- 12 files changed, 133 insertions(+), 79 deletions(-) create mode 100644 app/containers/UIKit/VideoConferenceBlock/components/VideoConferenceIssue.tsx diff --git a/android/app/src/main/assets/fonts/custom.ttf b/android/app/src/main/assets/fonts/custom.ttf index a7cb347abd787a26b41a3d0a1fda7df2e2c068d1..b8f6412be0cb3b92c41a4d8600d9a4c6dc429234 100644 GIT binary patch delta 1398 zcmY+ETWnNC7{_PMT+W$u_MAPtdoH`(Tiw##5|-L+x4Sj8fRThtN-4BJxpygT7sAbO zu^@DbKA7?XWR(z~`l2BQ6YFYh`k+XR(FX`ITq+_GA;yiy#6+JA;J1K^o5{|6Gyn6Q z-^~A;b8(v7pCPB~OTWH%{w6{=f)F}5S~##DdK2Q)&?}?6kBs~<)_V%#a|m5KRva$u zm~-XE1VT3~SkDzcEx(&uy8 zR5Ibk?b&2Qf=99CxH0TnEp6~0!wYb04p!#jK&lzb#?#hNzB;uR+vP87qNI%xSI*<)g{|`F7e0#C0diK}QX-RQ8ut%~9ueH-y`Q!FhIg zz7NtdU0BVbF0L}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$`fz$)=b^y39ZzZ|DDW{A0r*jq3`j@x@bfX`Xs201pPk71$I?) zgZ7MCz2IGR0=v+-IF&Y-Cq_70*96AUL}1C16;Tv|!irN-oCEw@5yS%D@f0Ft0Aw8=~WMfWlakJZ%!x>{^91Mh4t^P~?1 zO4>{7W@4^px1+-5DdR|*VeI^<*&#|^seZCrf6nJ?a_O-`253eRidq7FCW+xV05i+U zCYvsb<*G&Fd50)_L|(H10iUoQjrec{r!9&r(?+6Ow27ivoI4E!VU)7-b}vm6MA~ek zEfhflK@tql%6>r%+HnoI5{jcZiM2c>2u^;9w=)byaHSqwmBZcaioIM{dblLe;x2D> z@?bW5Rehiu>v)B^Ehr2POkqrS#eDwf_3Fub$s>ynv+8DV010M|7cs_KoOQV-ib2IB zvz!??j*)Ox&>J}5LYZ&A9+J}}iUT6A5a*Bu)u3i<>8_IncC{uP#kSRi4V$915xo+0 z!(+A*{5}@j#uV5MTMb>w-s6cxYr-n5_O!P481reziI$2`sKJU`Lnu_ya>DUHrU7RE zl|#0wv$G1%;&78BMg0Cy$nTFxQd9T|eEuI@M!QAJfxP?M+@RF>C$dnxkN?5aPj4BE zy}0*W7h-EJC5QjYf7|^`YVAFO^up!>x1I#wLTY_K{!{VH_4NyoKG=5f(jocKYWsBi z_Tl-Csg5r@1D)@8#k+p!exZB0d!xtOvvH*C$o1aF-go+JeY1Vn`u;lVJG$Lp-#^xW z^;qcG{D3;}$BRF{ba^lp-xt3Y-%fNTK0n@ee0k{naMAErBcYM(= - + {iconStyle[variant].label} diff --git a/app/containers/UIKit/VideoConferenceBlock/components/VideoConferenceIssue.tsx b/app/containers/UIKit/VideoConferenceBlock/components/VideoConferenceIssue.tsx new file mode 100644 index 000000000..39043d2bd --- /dev/null +++ b/app/containers/UIKit/VideoConferenceBlock/components/VideoConferenceIssue.tsx @@ -0,0 +1,18 @@ +import React from 'react'; +import { Text } from 'react-native'; + +import i18n from '../../../../i18n'; +import useStyle from './styles'; +import { VideoConferenceBaseContainer } from './VideoConferenceBaseContainer'; + +const VideoConferenceIssue = React.memo(() => { + const style = useStyle(); + + return ( + + {i18n.t('Waiting_for_server_connection')} + + ); +}); + +export default VideoConferenceIssue; diff --git a/app/containers/UIKit/VideoConferenceBlock/index.tsx b/app/containers/UIKit/VideoConferenceBlock/index.tsx index e99aca350..7d7a784ba 100644 --- a/app/containers/UIKit/VideoConferenceBlock/index.tsx +++ b/app/containers/UIKit/VideoConferenceBlock/index.tsx @@ -5,9 +5,10 @@ import VideoConferenceDirect from './components/VideoConferenceDirect'; import VideoConferenceEnded from './components/VideoConferenceEnded'; import VideoConferenceOutgoing from './components/VideoConferenceOutgoing'; import VideoConferenceSkeletonLoading from './components/VideoConferenceSkeletonLoading'; +import VideoConferenceIssue from './components/VideoConferenceIssue'; export default function VideoConferenceBlock({ callId, blockId }: { callId: string; blockId: string }): React.ReactElement { - const { result } = useEndpointData('video-conference.info', { callId }); + const { result, error } = useEndpointData('video-conference.info', { callId }); if (result?.success) { const { users, type, status, createdBy, rid } = result; @@ -19,5 +20,7 @@ export default function VideoConferenceBlock({ callId, blockId }: { callId: stri return ; } + if (result?.error || error) return ; + return ; } diff --git a/app/i18n/locales/en.json b/app/i18n/locales/en.json index 9943de6e8..abb506c05 100644 --- a/app/i18n/locales/en.json +++ b/app/i18n/locales/en.json @@ -689,12 +689,14 @@ "Also_send_thread_message_to_channel_behavior": "Also send thread message to channel", "Accounts_Default_User_Preferences_alsoSendThreadToChannel_Description": "Allow users to select the 'Also send to channel' behavior", "Waiting_for_answer": "Waiting for answer", + "Waiting_for_server_connection": "Waiting for server connection", "Call_ended": "Call ended", "Call_was_not_answered": "Call was not answered", "Call_rejected": "Call rejected", "Call_back": "Call Back", "Call_again": "Call Again", "Call_ongoing": "Call Ongoing", + "Call_issue": "Call issue", "Joined": "Joined", "Calling": "Calling", "Start_a_call": "Start a call", diff --git a/app/i18n/locales/pt-BR.json b/app/i18n/locales/pt-BR.json index 2a444c8a7..28c5dc888 100644 --- a/app/i18n/locales/pt-BR.json +++ b/app/i18n/locales/pt-BR.json @@ -689,11 +689,13 @@ "Also_send_thread_message_to_channel_behavior": "Também enviar mensagem do tópico para o canal", "Accounts_Default_User_Preferences_alsoSendThreadToChannel_Description": "Permitir que os usuários selecionem o comportamento Também enviar para o canal", "Waiting_for_answer": "Esperando por resposta", + "Waiting_for_server_connection": "Aguardando conexão com o servidor", "Call_ended": "Chamada finalizada", "Call_was_not_answered": "A chamada não foi atendida", "Call_back": "Ligue de volta", "Call_again": "Ligue novamente", "Call_ongoing": "Chamada em andamento", + "Call_issue": "Chamada com problemas", "Joined": "Ingressou", "Calling": "Chamando", "Start_a_call": "Inicie uma chamada", diff --git a/app/lib/constants/colors.ts b/app/lib/constants/colors.ts index eba53bca4..841d98211 100644 --- a/app/lib/constants/colors.ts +++ b/app/lib/constants/colors.ts @@ -99,6 +99,8 @@ export const colors = { gray300: '#5f656e', gray100: '#CBCED1', n900: '#1F2329', + statusBackgroundWarning: '#FFECAD', + statusFontOnWarning: '#B88D00', overlayColor: '#1F2329B2', ...mentions, ...callButtons @@ -176,6 +178,8 @@ export const colors = { gray300: '#5f656e', gray100: '#CBCED1', n900: '#FFFFFF', + statusBackgroundWarning: '#FFECAD', + statusFontOnWarning: '#B88D00', overlayColor: '#1F2329B2', ...mentions, ...callButtons @@ -253,6 +257,8 @@ export const colors = { gray300: '#5f656e', gray100: '#CBCED1', n900: '#FFFFFF', + statusBackgroundWarning: '#FFECAD', + statusFontOnWarning: '#B88D00', overlayColor: '#1F2329B2', ...mentions, ...callButtons diff --git a/ios/custom.ttf b/ios/custom.ttf index a7cb347abd787a26b41a3d0a1fda7df2e2c068d1..b8f6412be0cb3b92c41a4d8600d9a4c6dc429234 100644 GIT binary patch delta 1398 zcmY+ETWnNC7{_PMT+W$u_MAPtdoH`(Tiw##5|-L+x4Sj8fRThtN-4BJxpygT7sAbO zu^@DbKA7?XWR(z~`l2BQ6YFYh`k+XR(FX`ITq+_GA;yiy#6+JA;J1K^o5{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= o[k], r), {}); + +let icons = {}; + +// map icons +customIcons.icons.forEach((icon) => { icon.properties.name.split(/\s*,\s*/g).forEach((name) => { - iconsName += `\t'${name}': ${icon.properties.code},\n`; + icons = {...icons, [name]: icon.properties.code}; }); }); -iconsName = `${iconsName.slice(0, -2) }\n};\n`; -fs.writeFile('app/containers/CustomIcon/mappedIcons.js', iconsName, 'utf8', function (err) { +// sort icons by name +icons = sortObject(icons); + +// generate mappedIcons file +let mappedIcons = 'export const mappedIcons = {\n'; + +// map icons to file +Object.keys(icons).forEach((icon)=> { + mappedIcons += `\t'${icon}': ${icons[icon]},\n`; +}); + +// close file +mappedIcons = `${mappedIcons.slice(0, -2) }\n};\n`; + +// write file +fs.writeFile('app/containers/CustomIcon/mappedIcons.js', mappedIcons, 'utf8', function (err) { if (err) { console.log('An error occurred while writing Object to File.'); console.log(err); return; } - console.log('🚀 Icons name generated.'); + console.log('🚀 Icons name generated.'); });