-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactored Code: Removed redundant window.androidIntract, added GetBotList and SocketComponents, implemented expired bot logic #126
Refactored Code: Removed redundant window.androidIntract, added GetBotList and SocketComponents, implemented expired bot logic #126
Conversation
@Rishit30G is attempting to deploy a commit to the Samagra Team on Vercel. A member of the Team first needs to authorize it. |
|
GitGuardian id | Secret | Commit | Filename | |
---|---|---|---|---|
- | Generic High Entropy Secret | 5128e13 | apps/uci/web/.env.sample | View secret |
- | Generic High Entropy Secret | 5128e13 | apps/uci/web/.env.sample | View secret |
- | Generic High Entropy Secret | 5128e13 | apps/uci/web/src/utils/set-local-storage.ts | View secret |
- | Generic High Entropy Secret | 5128e13 | apps/uci/web/src/utils/set-local-storage.ts | View secret |
- | Generic High Entropy Secret | 5128e13 | apps/uci/web/src/utils/set-local-storage.ts | View secret |
- | Generic High Entropy Secret | 5128e13 | apps/uci/web/src/utils/set-local-storage.ts | View secret |
- | Generic High Entropy Secret | 78b3e37 | apps/uci/web/.env.sample | View secret |
- | Generic High Entropy Secret | 78b3e37 | apps/uci/web/.env.sample | View secret |
- | Generic High Entropy Secret | 9342ad7 | apps/uci/web/src/utils/set-local-storage.ts | View secret |
- | Generic High Entropy Secret | 9342ad7 | apps/uci/web/src/utils/set-local-storage.ts | View secret |
- | Generic High Entropy Secret | 9342ad7 | apps/uci/web/src/utils/set-local-storage.ts | View secret |
- | Generic High Entropy Secret | 9342ad7 | apps/uci/web/src/utils/set-local-storage.ts | View secret |
- | Generic High Entropy Secret | 9342ad7 | apps/uci/web/src/utils/set-local-storage.ts | View secret |
- | Generic High Entropy Secret | 9342ad7 | apps/uci/web/src/utils/set-local-storage.ts | View secret |
- | Generic High Entropy Secret | 9342ad7 | apps/uci/web/src/utils/set-local-storage.ts | View secret |
- | Generic High Entropy Secret | 826409e | apps/uci/web/.env.sample | View secret |
- | Generic High Entropy Secret | 826409e | apps/uci/web/.env.sample | View secret |
- | Generic High Entropy Secret | 826409e | apps/uci/web/src/utils/set-local-storage.ts | View secret |
- | Generic High Entropy Secret | 826409e | apps/uci/web/src/utils/set-local-storage.ts | View secret |
- | Generic High Entropy Secret | 826409e | apps/uci/web/src/utils/set-local-storage.ts | View secret |
- | Generic High Entropy Secret | 826409e | apps/uci/web/src/utils/set-local-storage.ts | View secret |
- | Generic High Entropy Secret | 826409e | apps/uci/web/src/utils/set-local-storage.ts | View secret |
- | Generic High Entropy Secret | 826409e | apps/uci/web/src/utils/set-local-storage.ts | View secret |
- | Generic High Entropy Secret | 826409e | apps/uci/web/src/utils/set-local-storage.ts | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secrets safely. Learn here the best practices.
- Revoke and rotate these secrets.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
Our GitHub checks need improvements? Share your feedbacks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change the file name to this format -> get-bot-list.tsx
import moment from "moment"; | ||
import { useEffect } from "react"; | ||
import { toast } from "react-hot-toast"; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move the types to type folder and use the following naming convention for the types file -> [component-name].d.ts
interface GetBotItemProp{ | ||
setUsers: React.Dispatch<React.SetStateAction<any>>; | ||
setCurrentUser: React.Dispatch<React.SetStateAction<any>>; | ||
setLoading: React.Dispatch<React.SetStateAction<boolean>>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since all the types are same so you can define a separate type for this and re use it
@@ -16,15 +17,21 @@ interface chatItemProps { | |||
isBlank?: boolean; | |||
} | |||
|
|||
|
|||
const ChatItem: React.FC<chatItemProps> = ({ active, name, phoneNumber, user, isBlank }) => { | |||
const history = useRouter(); | |||
const context = useContext(AppContext); | |||
|
|||
const fontColorToggle = useColorModeValue(styles.darkFontColor, styles.lightFontColor); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use useMemo for calculated variables
const ChatItem: React.FC<chatItemProps> = ({ active, name, phoneNumber, user, isBlank }) => { | ||
const history = useRouter(); | ||
const context = useContext(AppContext); | ||
|
||
const fontColorToggle = useColorModeValue(styles.darkFontColor, styles.lightFontColor); | ||
|
||
const expiredItem = user?.endDate!== undefined && user.endDate < moment().format() && user?.status === 'ENABLED'; | ||
|
||
|
||
const onChangingCurrentUserHandler = useCallback(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try to short the function name
// setLocalStorage(); | ||
// }, []); | ||
useEffect(() => { | ||
const hasLocalStorageBeenSet = localStorage.getItem('localStorageSet'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try to use some good naming conventions like isLocalStorageAvailable
* to be edited * Update .env.sample * Update set-local-storage.ts * fix: enhancement done for #126
* Updated branch (#129) * to be edited * Update .env.sample * Update set-local-storage.ts * fix: enhancement done for #126 * Refactored Code: Removed redundant window.androidIntract, added GetBotList and SocketComponents, implemented expired bot logic (#126) * to be edited * Update .env.sample * Update set-local-storage.ts * fix: enhancement done for #126 * style: layout modified to look similar like whatsapp (#132) * Config for components * env sample * removed unnecessary config * ui changes * chore: revert ui changes * Revert "style: layout modified to look similar like whatsapp (#132)" (#134) This reverts commit fcbb545. * chore: base setup * refactor: added socket class (#136) * feat: added class for socket * refactor: created socket * chore: new socket class tested * feat: using deployed socket package, added suppressHydrationWarning for extensions giving warning * feat: added logger, setup store using createAsyncThunk * change: reverted few changes --------- Co-authored-by: Tushar Banik <[email protected]> Co-authored-by: Saiyan Abhishek <[email protected]>
* Updated branch (#129) * to be edited * Update .env.sample * Update set-local-storage.ts * fix: enhancement done for #126 * Refactored Code: Removed redundant window.androidIntract, added GetBotList and SocketComponents, implemented expired bot logic (#126) * to be edited * Update .env.sample * Update set-local-storage.ts * fix: enhancement done for #126 * style: layout modified to look similar like whatsapp (#132) * Config for components * env sample * removed unnecessary config * ui changes * chore: revert ui changes * Revert "style: layout modified to look similar like whatsapp (#132)" (#134) This reverts commit fcbb545. * chore: base setup * refactor: added socket class (#136) * feat: added class for socket * refactor: created socket * chore: new socket class tested * feat: using deployed socket package, added suppressHydrationWarning for extensions giving warning * feat: added logger, setup store using createAsyncThunk * change: reverted few changes * feat: bot's displayed from store --------- Co-authored-by: Tushar Banik <[email protected]> Co-authored-by: Saiyan Abhishek <[email protected]>
* Updated branch (#129) * to be edited * Update .env.sample * Update set-local-storage.ts * fix: enhancement done for #126 * Refactored Code: Removed redundant window.androidIntract, added GetBotList and SocketComponents, implemented expired bot logic (#126) * to be edited * Update .env.sample * Update set-local-storage.ts * fix: enhancement done for #126 * style: layout modified to look similar like whatsapp (#132) * Config for components * env sample * removed unnecessary config * ui changes * chore: revert ui changes * Revert "style: layout modified to look similar like whatsapp (#132)" (#134) This reverts commit fcbb545. * UI Changes * changes * changes * changes * config for all components and pages * remove local storage * styled component for starredchatitem * styled component for chatItem and global theme * dark mode UI * dark and light theme --------- Co-authored-by: Rishit Gupta <[email protected]> Co-authored-by: Saiyan Abhishek <[email protected]>
* UI Changes * changes * changes * changes * config for all components and pages * remove local storage * styled component for starredchatitem * styled component for chatItem and global theme * dark mode UI * feat: setup createAsyncThunk, added logger (#140) * Updated branch (#129) * to be edited * Update .env.sample * Update set-local-storage.ts * fix: enhancement done for #126 * Refactored Code: Removed redundant window.androidIntract, added GetBotList and SocketComponents, implemented expired bot logic (#126) * to be edited * Update .env.sample * Update set-local-storage.ts * fix: enhancement done for #126 * style: layout modified to look similar like whatsapp (#132) * Config for components * env sample * removed unnecessary config * ui changes * chore: revert ui changes * Revert "style: layout modified to look similar like whatsapp (#132)" (#134) This reverts commit fcbb545. * chore: base setup * refactor: added socket class (#136) * feat: added class for socket * refactor: created socket * chore: new socket class tested * feat: using deployed socket package, added suppressHydrationWarning for extensions giving warning * feat: added logger, setup store using createAsyncThunk * change: reverted few changes --------- Co-authored-by: Tushar Banik <[email protected]> Co-authored-by: Saiyan Abhishek <[email protected]> * Bot's displayed using store (#142) * Updated branch (#129) * to be edited * Update .env.sample * Update set-local-storage.ts * fix: enhancement done for #126 * Refactored Code: Removed redundant window.androidIntract, added GetBotList and SocketComponents, implemented expired bot logic (#126) * to be edited * Update .env.sample * Update set-local-storage.ts * fix: enhancement done for #126 * style: layout modified to look similar like whatsapp (#132) * Config for components * env sample * removed unnecessary config * ui changes * chore: revert ui changes * Revert "style: layout modified to look similar like whatsapp (#132)" (#134) This reverts commit fcbb545. * chore: base setup * refactor: added socket class (#136) * feat: added class for socket * refactor: created socket * chore: new socket class tested * feat: using deployed socket package, added suppressHydrationWarning for extensions giving warning * feat: added logger, setup store using createAsyncThunk * change: reverted few changes * feat: bot's displayed from store --------- Co-authored-by: Tushar Banik <[email protected]> Co-authored-by: Saiyan Abhishek <[email protected]> * dark and light theme * eslint and husky setup * eslint and husky setup --------- Co-authored-by: Rishit Gupta <[email protected]> Co-authored-by: Saiyan Abhishek <[email protected]>
* Updated branch (#129) * to be edited * Update .env.sample * Update set-local-storage.ts * fix: enhancement done for #126 * Refactored Code: Removed redundant window.androidIntract, added GetBotList and SocketComponents, implemented expired bot logic (#126) * to be edited * Update .env.sample * Update set-local-storage.ts * fix: enhancement done for #126 * style: layout modified to look similar like whatsapp (#132) * Config for components * env sample * removed unnecessary config * ui changes * chore: revert ui changes * Revert "style: layout modified to look similar like whatsapp (#132)" (#134) This reverts commit fcbb545. * Eslint and husky setup (#144) * UI Changes * changes * changes * changes * config for all components and pages * remove local storage * styled component for starredchatitem * styled component for chatItem and global theme * dark mode UI * feat: setup createAsyncThunk, added logger (#140) * Updated branch (#129) * to be edited * Update .env.sample * Update set-local-storage.ts * fix: enhancement done for #126 * Refactored Code: Removed redundant window.androidIntract, added GetBotList and SocketComponents, implemented expired bot logic (#126) * to be edited * Update .env.sample * Update set-local-storage.ts * fix: enhancement done for #126 * style: layout modified to look similar like whatsapp (#132) * Config for components * env sample * removed unnecessary config * ui changes * chore: revert ui changes * Revert "style: layout modified to look similar like whatsapp (#132)" (#134) This reverts commit fcbb545. * chore: base setup * refactor: added socket class (#136) * feat: added class for socket * refactor: created socket * chore: new socket class tested * feat: using deployed socket package, added suppressHydrationWarning for extensions giving warning * feat: added logger, setup store using createAsyncThunk * change: reverted few changes --------- Co-authored-by: Tushar Banik <[email protected]> Co-authored-by: Saiyan Abhishek <[email protected]> * Bot's displayed using store (#142) * Updated branch (#129) * to be edited * Update .env.sample * Update set-local-storage.ts * fix: enhancement done for #126 * Refactored Code: Removed redundant window.androidIntract, added GetBotList and SocketComponents, implemented expired bot logic (#126) * to be edited * Update .env.sample * Update set-local-storage.ts * fix: enhancement done for #126 * style: layout modified to look similar like whatsapp (#132) * Config for components * env sample * removed unnecessary config * ui changes * chore: revert ui changes * Revert "style: layout modified to look similar like whatsapp (#132)" (#134) This reverts commit fcbb545. * chore: base setup * refactor: added socket class (#136) * feat: added class for socket * refactor: created socket * chore: new socket class tested * feat: using deployed socket package, added suppressHydrationWarning for extensions giving warning * feat: added logger, setup store using createAsyncThunk * change: reverted few changes * feat: bot's displayed from store --------- Co-authored-by: Tushar Banik <[email protected]> Co-authored-by: Saiyan Abhishek <[email protected]> * dark and light theme * eslint and husky setup --------- Co-authored-by: Rishit Gupta <[email protected]> Co-authored-by: Saiyan Abhishek <[email protected]> * conflicts and localstorage for dark-mode * fix: old changes merged * env sample and styled-components * Refactor Home using styled-components * dockerfile * C4gt socket package (#146) * fix: socket connection fix * Update next.config.js * fix: sorted botList, Unexpected JSON error resolved, starred message now visible, updated redux, converstation working * Major UI changes * StarredChats UI fixed * Tab view UI * Fullscreen Loader * changes in bot image * Chat-message ui fix * Added unit test cases for socket and search functionality * Refactoring Message Itema and fullscreen Loader with styled-components * Configuration changes * fix: currentUser now fetched from redux * textInput config * Voice-to-text * VoiceIcon animation,no response text and ui fixes * Added lerna for watch mode,impelmented config for urls * Added lerna for watch mode,impelmented config for urls * ThemeProvider and Styledcompoents Reafactoring * Update README.md * fix: useSelcetor optimized, hardcoded auth fixed, LogIn and OTP partially functional --------- Co-authored-by: Tushar Banik <[email protected]> Co-authored-by: Saiyan Abhishek <[email protected]> Co-authored-by: Tushar98644 <[email protected]>
Fixes Refactored ContextProvider, Filter Bots, Removed redundant code #127