From 5fa1ff371e80a0173d3099848e247c553e4835d4 Mon Sep 17 00:00:00 2001 From: Saahil Date: Tue, 25 Jun 2024 00:44:26 -0400 Subject: [PATCH] Silence Logs --- src/Ackee.ts | 2 +- src/components/HashRouter/index.tsx | 4 ++-- src/components/Projects/index.tsx | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Ackee.ts b/src/Ackee.ts index f87ef1ec..539bd14c 100644 --- a/src/Ackee.ts +++ b/src/Ackee.ts @@ -46,7 +46,7 @@ getDeviceInfo() { } handleWebVitals = () =>(d: any) => { -console.log(d) +if(isDev) console.log(d) let idThing = d.name // const _this = this switch(idThing) { diff --git a/src/components/HashRouter/index.tsx b/src/components/HashRouter/index.tsx index fb35dfe2..467ce9e8 100644 --- a/src/components/HashRouter/index.tsx +++ b/src/components/HashRouter/index.tsx @@ -1,11 +1,11 @@ // writing my own hashRouter export function HashRouter({ children }: any) { - console.log(children) + if(process.env.NODE_ENV !== "production") console.log(children) if(!Array.isArray(children)) children = [children] debugger; const child = children.find((child:any) => { -console.log('script', child.props, window.location.hash, child.props.route == window.location.hash, (window.location.hash.length < 2 && child.props.index)) +if(process.env.NODE_ENV !== "production") console.log('script', child.props, window.location.hash, child.props.route == window.location.hash, (window.location.hash.length < 2 && child.props.index)) return child.props.path == window.location.hash || (window.location.hash.length < 2 && child.props.index) || child.props.path == "*" }) // console.log('child', child) diff --git a/src/components/Projects/index.tsx b/src/components/Projects/index.tsx index 8ce2d994..29f42b1c 100644 --- a/src/components/Projects/index.tsx +++ b/src/components/Projects/index.tsx @@ -50,7 +50,7 @@ const [translateY, setTranslateY] = useState(0) .then((data) => { - console.log(data[0], data[1]) + if(process.env.NODE_ENV !== "production") console.log(data[0], data[1]) const idsThatAreFound:any = {} const items = [...data[0], ...data[1]] .filter(e => e.topics.includes('github-include-on-site')) @@ -61,7 +61,7 @@ const [translateY, setTranslateY] = useState(0) }) console.log() - console.log(items) + if(process.env.NODE_ENV !== "production") console.log(items) //@ts-ignore setGithubData(items) })