From 83ec2f90ac22325757e57910ea711f08eaa6c0c5 Mon Sep 17 00:00:00 2001
From: Douglas Fabris <devfabris@gmail.com>
Date: Mon, 13 Jun 2022 19:41:31 -0300
Subject: [PATCH] Chore: Rewrite RoomWithData (#25858)

<!-- This is a pull request template, you do not need to uncomment or remove the comments, they won't show up in the PR text. -->

<!-- Your Pull Request name should start with one of the following tags
  [NEW] For new features
  [IMPROVE] For an improvement (performance or little improvements) in existing features
  [FIX] For bug fixes that affect the end-user
  [BREAK] For pull requests including breaking changes
  Chore: For small tasks
  Doc: For documentation
-->

<!-- Checklist!!! If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.
  - I have read the Contributing Guide - https://github.com/RocketChat/Rocket.Chat/blob/develop/.github/CONTRIBUTING.md#contributing-to-rocketchat doc
  - I have signed the CLA - https://cla-assistant.io/RocketChat/Rocket.Chat
  - Lint and unit tests pass locally with my changes
  - I have added tests that prove my fix is effective or that my feature works (if applicable)
  - I have added necessary documentation (if applicable)
  - Any dependent changes have been merged and published in downstream modules
-->

## Proposed changes (including videos or screenshots)
<!-- CHANGELOG -->
<!--
  Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request.
  If it fixes a bug or resolves a feature request, be sure to link to that issue below.
  This description will appear in the release notes if we accept the contribution.
-->

<!-- END CHANGELOG -->

## Issue(s)
<!-- Link the issues being closed by or related to this PR. For example, you can use #594 if this PR closes issue number 594 -->

## Steps to test or reproduce
<!-- Mention how you would reproduce the bug if not mentioned on the issue page already. Also mention which screens are going to have the changes if applicable -->

## Further comments
<!-- If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc... -->
---
 .../client/components/Sidebar/SidebarItemsAssembler.tsx    | 1 -
 apps/meteor/client/views/room/Room/Aside.js                | 7 -------
 apps/meteor/client/views/room/Room/Body.js                 | 7 -------
 apps/meteor/client/views/room/Room/Footer.js               | 7 -------
 .../views/room/Room/{RoomWithData.js => RoomWithData.tsx}  | 4 ++--
 5 files changed, 2 insertions(+), 24 deletions(-)
 delete mode 100644 apps/meteor/client/views/room/Room/Aside.js
 delete mode 100644 apps/meteor/client/views/room/Room/Body.js
 delete mode 100644 apps/meteor/client/views/room/Room/Footer.js
 rename apps/meteor/client/views/room/Room/{RoomWithData.js => RoomWithData.tsx} (75%)

diff --git a/apps/meteor/client/components/Sidebar/SidebarItemsAssembler.tsx b/apps/meteor/client/components/Sidebar/SidebarItemsAssembler.tsx
index 18c1c692ba9..52eb00bc76a 100644
--- a/apps/meteor/client/components/Sidebar/SidebarItemsAssembler.tsx
+++ b/apps/meteor/client/components/Sidebar/SidebarItemsAssembler.tsx
@@ -25,7 +25,6 @@ const SidebarItemsAssembler: FC<SidebarItemsAssemblerProps> = ({ items, currentP
 					tag={t.has(tag as Parameters<typeof t>[0]) ? t(tag as Parameters<typeof t>[0]) : undefined}
 				/>
 			))}
-			;
 		</>
 	);
 };
diff --git a/apps/meteor/client/views/room/Room/Aside.js b/apps/meteor/client/views/room/Room/Aside.js
deleted file mode 100644
index 5ad066acc18..00000000000
--- a/apps/meteor/client/views/room/Room/Aside.js
+++ /dev/null
@@ -1,7 +0,0 @@
-import React from 'react';
-
-function Aside({ children }) {
-	return <>{children}</>;
-}
-
-export default Aside;
diff --git a/apps/meteor/client/views/room/Room/Body.js b/apps/meteor/client/views/room/Room/Body.js
deleted file mode 100644
index b2349681046..00000000000
--- a/apps/meteor/client/views/room/Room/Body.js
+++ /dev/null
@@ -1,7 +0,0 @@
-import React from 'react';
-
-function Body({ children }) {
-	return <>{children}</>;
-}
-
-export default Body;
diff --git a/apps/meteor/client/views/room/Room/Footer.js b/apps/meteor/client/views/room/Room/Footer.js
deleted file mode 100644
index 16bd45fe2c8..00000000000
--- a/apps/meteor/client/views/room/Room/Footer.js
+++ /dev/null
@@ -1,7 +0,0 @@
-import React from 'react';
-
-function Footer({ children }) {
-	return <>{children}</>;
-}
-
-export default Footer;
diff --git a/apps/meteor/client/views/room/Room/RoomWithData.js b/apps/meteor/client/views/room/Room/RoomWithData.tsx
similarity index 75%
rename from apps/meteor/client/views/room/Room/RoomWithData.js
rename to apps/meteor/client/views/room/Room/RoomWithData.tsx
index abd48bfa918..0da9132bd4a 100644
--- a/apps/meteor/client/views/room/Room/RoomWithData.js
+++ b/apps/meteor/client/views/room/Room/RoomWithData.tsx
@@ -1,10 +1,10 @@
-import React from 'react';
+import React, { ReactElement } from 'react';
 
 import { useOpenedRoom } from '../../../lib/RoomManager';
 import RoomProvider from '../providers/RoomProvider';
 import { Room } from './Room';
 
-const RoomWithData = () => {
+const RoomWithData = (): ReactElement | null => {
 	const rid = useOpenedRoom();
 	return rid ? (
 		<RoomProvider rid={rid}>
-- 
GitLab