diff --git a/HideCallButtons/index.js b/HideCallButtons/index.js index 306a688..df89d65 100644 --- a/HideCallButtons/index.js +++ b/HideCallButtons/index.js @@ -1 +1 @@ -(function(m,f,o,c,y,e,g,D,C){"use strict";const{FormDivider:b,FormIcon:v,FormSwitchRow:h}=D.Forms;function V(){return C.useProxy(e.storage),React.createElement(g.ReactNative.ScrollView,null,React.createElement(h,{label:"Hide from user profile",subLabel:"Hide call buttons from user profile",leading:React.createElement(v,{source:c.getAssetIDByName("ic_profile_24px")}),onValueChange:function(r){e.storage.hideUserProfile=r},value:e.storage.hideUserProfile}),React.createElement(b,null),React.createElement(h,{label:"Hide from DM",subLabel:"Hide call buttons from DM title bar",leading:React.createElement(v,{source:c.getAssetIDByName("ic_dm")}),onValueChange:function(r){return e.storage.hideDMTitlebar=r},value:e.storage.hideDMTitlebar}),React.createElement(b,null),React.createElement(h,{label:"Hide from VC",subLabel:"Hide video button from VC",leading:React.createElement(v,{source:c.getAssetIDByName("video")}),onValueChange:function(r){return e.storage.hideVCVideoButton=r},value:e.storage.hideVCVideoButton}))}let s=[];var R={onLoad:function(){e.storage.hideUserProfile??=!0,e.storage.hideDMTitlebar??=!1,e.storage.hideVCVideoButton??=!1;const r=c.getAssetIDByName("ic_video"),N=c.getAssetIDByName("ic_audio"),_=c.getAssetIDByName("video"),A=c.getAssetIDByName("nav_header_connect"),I=f.findByName("UserProfileActions",!1),E=f.findByName("ChannelActions",!1),P=f.findByName("Header",!1),M=f.findByName("FocusedControlsBottomControls",!1);s.push(o.after("default",I,function(p,n){if(!e.storage.hideUserProfile)return;const t=y.findInReactTree(n,function(i){return i?.props?.children[0]?.type?.name=="_default"})?.props?.children;if(t!==void 0){for(var a in t){var l=t[a];(l?.props?.icon===N||l?.props?.icon===r)&&delete t[a]}return[n]}})),s.push(o.after("default",M,function(p,n){if(!e.storage.hideVCVideoButton||n?.props?.children?.props?.children===void 0)return;var t=n?.props?.children?.props?.children[1];if(t?.type?.name!=="_default")return;const a=o.after("type",t,function(l,i){var d=i?.props?.children?.props?.children?.props?.children;d!==void 0&&delete d[0],a()})})),s.push(o.after("default",E,function(p,n){if(!e.storage.hideDMTitlebar)return;const t=n?.props?.children?.type;if(t?.type?.name!=="PrivateChannelButtons")return;const a=o.after("type",t,function(l,i){const d=i?.props?.children;d!==void 0&&(delete d[0],delete d[1],a())});return[n]})),s.push(o.after("default",P,function(p,n){if(!e.storage.hideDMTitlebar)return;const t=y.findInReactTree(n,function(l){return l?.type?.name=="_default"});if(t===void 0)return;const a=o.after("type",t,function(l,i){if(i?.type===void 0)return;const d=o.after("type",i,function(U,B){if(B?.type===void 0)return;const T=o.after("type",B,function(F,H){const u=H?.props?.buttons;u!==void 0&&(u[0].source===A||u[0].source===_)&&(delete u[0],delete u[1]),T()});d()});a()});return[n]}))},onUnload:function(){for(const r of s)r()},settings:V};return m.default=R,Object.defineProperty(m,"__esModule",{value:!0}),m})({},vendetta.metro,vendetta.patcher,vendetta.ui.assets,vendetta.utils,vendetta.plugin,vendetta.metro.common,vendetta.ui.components,vendetta.storage); +(function(m,f,o,c,y,e,g,D,C){"use strict";const{FormDivider:b,FormIcon:v,FormSwitchRow:h}=D.Forms;function V(){return C.useProxy(e.storage),React.createElement(g.ReactNative.ScrollView,null,React.createElement(h,{label:"Hide from user profile",subLabel:"Hide call buttons from user profile",leading:React.createElement(v,{source:c.getAssetIDByName("ic_profile_24px")}),onValueChange:function(r){e.storage.hideUserProfile=r},value:e.storage.hideUserProfile}),React.createElement(b,null),React.createElement(h,{label:"Hide from DM",subLabel:"Hide call buttons from DM title bar",leading:React.createElement(v,{source:c.getAssetIDByName("ic_dm")}),onValueChange:function(r){return e.storage.hideDMTitlebar=r},value:e.storage.hideDMTitlebar}),React.createElement(b,null),React.createElement(h,{label:"Hide from VC",subLabel:"Hide video button from VC",leading:React.createElement(v,{source:c.getAssetIDByName("video")}),onValueChange:function(r){return e.storage.hideVCVideoButton=r},value:e.storage.hideVCVideoButton}))}let s=[];var R={onLoad:function(){e.storage.hideUserProfile??=!0,e.storage.hideDMTitlebar??=!1,e.storage.hideVCVideoButton??=!1;const r=c.getAssetIDByName("ic_video"),N=c.getAssetIDByName("ic_audio"),_=c.getAssetIDByName("video"),A=c.getAssetIDByName("nav_header_connect"),I=f.findByName("UserProfileActions",!1),E=f.findByName("ChannelActions",!1),P=f.findByName("Header",!1),M=f.findByName("FocusedControlsBottomControls",!1);s.push(o.after("default",I,function(p,n){if(!e.storage.hideUserProfile)return;const t=y.findInReactTree(n,function(i){return i?.props?.children[1]?.type?.name=="_default"})?.props?.children;if(t!==void 0){for(var a in t){var l=t[a];(l?.props?.icon===N||l?.props?.icon===r)&&delete t[a]}return[n]}})),s.push(o.after("default",M,function(p,n){if(!e.storage.hideVCVideoButton||n?.props?.children?.props?.children===void 0)return;var t=n?.props?.children?.props?.children[1];if(t?.type?.name!=="_default")return;const a=o.after("type",t,function(l,i){var d=i?.props?.children?.props?.children?.props?.children;d!==void 0&&delete d[0],a()})})),s.push(o.after("default",E,function(p,n){if(!e.storage.hideDMTitlebar)return;const t=n?.props?.children?.type;if(t?.type?.name!=="PrivateChannelButtons")return;const a=o.after("type",t,function(l,i){const d=i?.props?.children;d!==void 0&&(delete d[0],delete d[1],a())});return[n]})),s.push(o.after("default",P,function(p,n){if(!e.storage.hideDMTitlebar)return;const t=y.findInReactTree(n,function(l){return l?.type?.name=="_default"});if(t===void 0)return;const a=o.after("type",t,function(l,i){if(i?.type===void 0)return;const d=o.after("type",i,function(U,B){if(B?.type===void 0)return;const T=o.after("type",B,function(F,H){const u=H?.props?.buttons;u!==void 0&&(u[0].source===A||u[0].source===_)&&(delete u[0],delete u[1]),T()});d()});a()});return[n]}))},onUnload:function(){for(const r of s)r()},settings:V};return m.default=R,Object.defineProperty(m,"__esModule",{value:!0}),m})({},vendetta.metro,vendetta.patcher,vendetta.ui.assets,vendetta.utils,vendetta.plugin,vendetta.metro.common,vendetta.ui.components,vendetta.storage); diff --git a/HideCallButtons/manifest.json b/HideCallButtons/manifest.json index 325fea6..8d4d37c 100644 --- a/HideCallButtons/manifest.json +++ b/HideCallButtons/manifest.json @@ -1 +1 @@ -{"name":"Hide call buttons","description":"Hides call buttons from dms, user profiles and vcs","authors":[{"name":"John","id":"780819226839220265"}],"main":"index.js","vendetta":{"icon":"ic_call_ended"},"hash":"50cbf9a3d8dbfdf087077b1adea923ee0825b7f912e4871fd1a84177b1b13cb9"} \ No newline at end of file +{"name":"Hide call buttons","description":"Hides call buttons from dms, user profiles and vcs","authors":[{"name":"John","id":"780819226839220265"}],"main":"index.js","vendetta":{"icon":"ic_call_ended"},"hash":"2f133f557df4630ae82a9bbc66098ff0e043bcf00c217e7c5b525ea8c2307c6a"} \ No newline at end of file