From d294da66ee22849050c8ed952fdabd916fbb8166 Mon Sep 17 00:00:00 2001 From: Nakul Jhunjhunwala Date: Mon, 17 Jun 2024 16:12:51 +0530 Subject: [PATCH] Update Sample App to version 4.3.8 --- package.json | 2 +- src/assets/wolverine_avatar.png | Bin 0 -> 9984 bytes src/components/Login/index.tsx | 63 ++++++++++++++++---------------- src/metaInfo.ts | 2 +- src/sampleApp/sampledata.js | 35 ++++++++++++++++++ 5 files changed, 68 insertions(+), 34 deletions(-) create mode 100644 src/assets/wolverine_avatar.png create mode 100644 src/sampleApp/sampledata.js diff --git a/package.json b/package.json index c46521a..d0e7703 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cometchat-chat-sample-app-react", - "version": "4.3.7", + "version": "4.3.8", "private": true, "dependencies": { "@cometchat/calls-sdk-javascript": "^4.0.7", diff --git a/src/assets/wolverine_avatar.png b/src/assets/wolverine_avatar.png new file mode 100644 index 0000000000000000000000000000000000000000..43913642c12f0cdd0d06b826ffdcdf08f6b0207c GIT binary patch literal 9984 zcmaKS2RNH=+%9U*SXHC8+Ei8Ty&`FCV$-T>i_{2e*H%T1ptVOr?a?ZtHl-nP`&)YLp56fKTZ zIG-Rvp-{z1JlfjY=buDf9c}^4Xgwng2AfCg8yac?U1=%Dp{Wd9*YF3S7n z`H*NR{KE0yq`-_sB7ym=Ot!T|;&Z+#5EfWwhTS|X7C}Y{ZGWO5w&|U|qySvp9Ms%_ z;c5{CHwI+YnLK@ceGi>w0Mo_tg#zGMU0od)0Qon5a&qzvhW@-p)%U?oV!I};LWb~8 zw=F{t5Ch#c=F8l3u>+JFAE_=fMi{QOO7&N;{mtP5mLZ-BGcz-QvhKP1ztK{|1pt0% zXb6~rk(-;_k)?Frby4sTN|w+F_PQr^_pZx%gASk{f6rAC2L`s<*Vh*iH051xY-|L; zSh4zYH%)eoAn}tZ;*nf*bTlBIYm|NwaIrH_ea!*QNFDR5M2)k2zMROLWyo9oRYDb6 z3J2IrKQJ7CxG_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!zo zK6F(c52a%Z%#>4d-TLc3&u4sSJGQ(_1 za9TW6-LsrMR4z!oE>?8ytXpbA&5iwT;Pw>^{8Y+)CfPKhROGBeOqt1&Dd7F%f?})h z{;2sd(ZrE{iFBvG;-M32Ke6-rTKCP;&K;4jStGW74H>@i3^GqWZ&57jn#tST^VE#H zn`b=)>v&dAEhu{yD^^2Zg;nn_mh3!1`iV&Vx$=iRzXgH0-6kH-<2%^;QJCYWt8eJ# zVrE^NlXylgZ6RgGV~HN2m}8HAu=Il%|AxU>c1jS z&A?_p-l6yXqb!a;1v6mnKXZd517c7SnTW94FlEzqJu^X_De)FK2mh?VrV0LCI$+qoME?{$e{~I( zr}QlF4^I_gs)U}|!zlsO*d?y6fmJ`g88t{+3Vg|o78Fl{N`6B*AFQucp-F|lyD`!L$+*Vzpun0^s40gDzPi_*Jq92^+A`tCH7N;BhtB3hFJ9#EcF#gGN zTP1VGr*vdcs#b!9YjggUlY^V%I1xqZ1Ii88!2~q)m*JKGF?p9oTXJ@l!k(G#;V6el zChyxV&(sG?;^+bNR+1^>>^dr<`&hbynFCvt8zGQ!j#g50U)5?PRm~(&{lp3;nT}wX zjUvS1l08H5Ah^jx)BrLGbn_7x3*M(H=ZbJ$Xh|y8JIfD6o48*}gBoCGEdf([]); + + + async function fetchDefaultUsers() { + try { + const response = await fetch("https://assets.cometchat.io/sampleapp/sampledata.json"); + const data : UserJson = await response.json(); + setDefaultUsers(data.users); + } + catch(error) { + console.log("fetching default users failed, using fallback data", error); + setDefaultUsers(users.users); + } + } async function login(uid : string) { try { @@ -67,7 +59,7 @@ export function Login(props : ILoginProps) { console.log("Login successful, loggedInUser:", loggedInUser); setLoggedInUser(loggedInUser); navigate("/home"); - + }) } catch(error) { @@ -91,7 +83,7 @@ export function Login(props : ILoginProps) { console.log(error); } } - + function getUserBtnWithKeyAdded({ name, uid, avatar } : User) { return ( ); - } + } function getErrorMessage() { if (!errorMessage) { @@ -135,6 +127,13 @@ export function Login(props : ILoginProps) { ); } + useEffect(()=>{ + fetchDefaultUsers(); + return () =>{ + setDefaultUsers([]); + } + },[]) + // if (loggedInUser === undefined) { // return null; // } @@ -169,7 +168,7 @@ export function Login(props : ILoginProps) { onSubmit = {handleLoginWithUidFormSubmit} style = {loginUidFormStyle()} > -