Conversation
| const [isChanged, setIsChanged] = useState(false) | ||
| const respondToAppeals = searchParams.get('respondToAppeals') === 'true' | ||
| const [isManagerEdit, setIsManagerEdit] = useState(respondToAppeals) | ||
| const hasChallengeAdminRole = useMemo( |
There was a problem hiding this comment.
[💡 performance]
The useMemo hook is used here to compute hasChallengeAdminRole, but since the computation is simple and not computationally expensive, the use of useMemo might be unnecessary. Consider removing useMemo to simplify the code unless there is a specific performance concern.
| [myChallengeResources], | ||
| ) | ||
|
|
||
| const hasTopcoderAdminRole = useMemo( |
There was a problem hiding this comment.
[💡 performance]
The useMemo hook is used here to compute hasTopcoderAdminRole, but since the computation is simple and not computationally expensive, the use of useMemo might be unnecessary. Consider removing useMemo to simplify the code unless there is a specific performance concern.
| [myChallengeRoles], | ||
| ) | ||
|
|
||
| const hasChallengeManagerRole = useMemo( |
There was a problem hiding this comment.
[💡 performance]
The useMemo hook is used here to compute hasChallengeManagerRole, but since the computation is simple and not computationally expensive, the use of useMemo might be unnecessary. Consider removing useMemo to simplify the code unless there is a specific performance concern.
| [myChallengeResources], | ||
| ) | ||
|
|
||
| const canManagerEdit = useMemo( |
There was a problem hiding this comment.
[💡 performance]
The useMemo hook is used here to compute canManagerEdit, but since the computation is simple and not computationally expensive, the use of useMemo might be unnecessary. Consider removing useMemo to simplify the code unless there is a specific performance concern.
Related JIRA Ticket:
https://topcoder.atlassian.net/browse/PM-4075
What's in this PR?
We were only relying on search param to check who can add/edit comment
I added a check for roles - admin/manager/reviewer