From 4ef2ccb03db2b454a9d13e6a7d885bce3a2f96c5 Mon Sep 17 00:00:00 2001
From: Shravya Ramesh <shravs1208@gmail.com>
Date: Thu, 20 May 2021 15:31:51 -0700
Subject: Add comments for Tag user selection cell

---
 src/components/common/TaggUserSelectionCell.tsx | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

(limited to 'src/components/common/TaggUserSelectionCell.tsx')

diff --git a/src/components/common/TaggUserSelectionCell.tsx b/src/components/common/TaggUserSelectionCell.tsx
index a8564ddf..01d965cf 100644
--- a/src/components/common/TaggUserSelectionCell.tsx
+++ b/src/components/common/TaggUserSelectionCell.tsx
@@ -17,6 +17,9 @@ const TaggUserSelectionCell: React.FC<TaggUserSelectionCellProps> = ({
 }) => {
   const [pressed, setPressed] = useState<boolean>(false);
 
+  /*
+   * To update state of radio button on initial render and subsequent re-renders
+   */
   useEffect(() => {
     const updatePressed = () => {
       const userSelected = selectedUsers.findIndex(
@@ -27,8 +30,12 @@ const TaggUserSelectionCell: React.FC<TaggUserSelectionCellProps> = ({
     updatePressed();
   });
 
+  /*
+   * Handles on press on radio button
+   * Adds/removes user from selected list of users
+   */
   const handlePress = () => {
-    // Add to selected list pf users
+    // Add to selected list of users
     if (pressed === false) {
       setSelectedUsers([...selectedUsers, item]);
     }
-- 
cgit v1.2.3-70-g09d2

