Re-arrange general room settings
authorAjay Bura <ajbura@gmail.com>
Sun, 16 Jan 2022 12:25:00 +0000 (17:55 +0530)
committerAjay Bura <ajbura@gmail.com>
Sun, 16 Jan 2022 12:25:00 +0000 (17:55 +0530)
Signed-off-by: Ajay Bura <ajbura@gmail.com>
src/app/organisms/room/RoomSettings.jsx

index 057d45a2e598c2c25125698cdabcca059f99453f..cfccd003b5946ebcc18d44da21330aa16854c7b4 100644 (file)
@@ -63,10 +63,6 @@ function GeneralSettings({ roomId }) {
 
   return (
     <>
-      <div className="room-settings__card">
-        <MenuHeader>Notification (Changing this will only affect you)</MenuHeader>
-        <RoomNotification roomId={roomId} />
-      </div>
       <div className="room-settings__card">
         <MenuItem
           disabled={!canInvite}
@@ -75,7 +71,21 @@ function GeneralSettings({ roomId }) {
         >
           Invite
         </MenuItem>
-        <MenuItem variant="danger" onClick={() => roomActions.leave(roomId)} iconSrc={LeaveArrowIC}>Leave</MenuItem>
+        <MenuItem
+          variant="danger"
+          onClick={() => {
+            if (confirm('Are you really want to leave this room?')) {
+              roomActions.leave(roomId);
+            }
+          }}
+          iconSrc={LeaveArrowIC}
+        >
+          Leave
+        </MenuItem>
+      </div>
+      <div className="room-settings__card">
+        <MenuHeader>Notification (Changing this will only affect you)</MenuHeader>
+        <RoomNotification roomId={roomId} />
       </div>
       <div className="room-settings__card">
         <MenuHeader>Room visibility (who can join)</MenuHeader>