diff --git a/play-node-go/src/components/Logo/Logo.js b/play-node-go/src/components/Button/Logo/Logo.js
similarity index 100%
rename from play-node-go/src/components/Logo/Logo.js
rename to play-node-go/src/components/Button/Logo/Logo.js
diff --git a/play-node-go/src/components/Logo/Logo.scss b/play-node-go/src/components/Button/Logo/Logo.scss
similarity index 100%
rename from play-node-go/src/components/Logo/Logo.scss
rename to play-node-go/src/components/Button/Logo/Logo.scss
diff --git a/play-node-go/src/components/Button/Room/Room.js b/play-node-go/src/components/Button/Room/Room.js
new file mode 100644
index 0000000..6761902
--- /dev/null
+++ b/play-node-go/src/components/Button/Room/Room.js
@@ -0,0 +1,13 @@
+import React from 'react';
+import './Room.scss';
+
+const RoomButton = (props) => {
+ const roomData = props.room;
+ return (
+
+
{roomData.name}
+
+ );
+}
+
+export default RoomButton;
\ No newline at end of file
diff --git a/play-node-go/src/components/Button/Room/Room.scss b/play-node-go/src/components/Button/Room/Room.scss
new file mode 100644
index 0000000..b48b2ee
--- /dev/null
+++ b/play-node-go/src/components/Button/Room/Room.scss
@@ -0,0 +1,9 @@
+div.RoomButton {
+ display: block;
+ padding: 1vw;
+
+ .RoomButton__room-name {
+ text-transform: capitalize;
+ }
+
+}
\ No newline at end of file
diff --git a/play-node-go/src/components/Button/Room/Room.test.js b/play-node-go/src/components/Button/Room/Room.test.js
new file mode 100644
index 0000000..cd885ef
--- /dev/null
+++ b/play-node-go/src/components/Button/Room/Room.test.js
@@ -0,0 +1,23 @@
+import React from 'react';
+import { render } from '@testing-library/react';
+import Room from './Room';
+
+const roomData = {
+ id: 1,
+ name: "main",
+ description: "A general place to play Go",
+ language: "EN"
+}
+
+test('renders RoomButton without crashing', () => {
+ const { getByTestId } = render();
+ const RoomButton = getByTestId('RoomButton');
+ expect(RoomButton).toBeInTheDocument();
+});
+
+test('renders RoomButton with Room name', () => {
+ const { getByTestId } = render();
+ const RoomButton = getByTestId('RoomButton');
+ expect(RoomButton).toHaveTextContent('main');
+});
+
diff --git a/play-node-go/src/pages/Home/Home.js b/play-node-go/src/pages/Home/Home.js
index 655203d..8d6dc14 100644
--- a/play-node-go/src/pages/Home/Home.js
+++ b/play-node-go/src/pages/Home/Home.js
@@ -1,8 +1,24 @@
import React, { useEffect } from 'react';
import './Home.scss';
import roomsServices from '../../services/api/roomsServices';
+import RoomButton from '../../components/Button/Room/Room';
const Home = props => {
+ const state = props.state;
+ const dispatch = props.dispatch;
+
+ const renderRooms = () => {
+ const rooms = state.rooms || [];
+ if (rooms.length) {
+ return rooms.map(roomData => (
+
+ ))
+ }
+ return Loading Component
+ }
const fetchRoomsAPI = async () => {
const response = await roomsServices.indexService();
@@ -12,7 +28,7 @@ const Home = props => {
message: 'SET_ROOMS',
body: response
}
- return props.dispatch(action)
+ return dispatch(action)
}
}
@@ -24,7 +40,7 @@ const Home = props => {
);
diff --git a/play-node-go/src/pages/Home/Home.scss b/play-node-go/src/pages/Home/Home.scss
index e69de29..ae4003c 100644
--- a/play-node-go/src/pages/Home/Home.scss
+++ b/play-node-go/src/pages/Home/Home.scss
@@ -0,0 +1,6 @@
+div.Page div.Home {
+ display: flex;
+ flex-flow: row wrap;
+ align-items: flex-start;
+ justify-content: flex-start;
+}
\ No newline at end of file
diff --git a/play-node-go/src/pages/Layout/MainWrapper/MainWrapper.scss b/play-node-go/src/pages/Layout/MainWrapper/MainWrapper.scss
index b2af025..807f518 100644
--- a/play-node-go/src/pages/Layout/MainWrapper/MainWrapper.scss
+++ b/play-node-go/src/pages/Layout/MainWrapper/MainWrapper.scss
@@ -27,10 +27,10 @@ div.main-wrapper {
}
main {
- display: flex;
- justify-content: center;
- align-items: center;
- flex-grow: 4;
+ display: block;
+ max-width: 80vw;
+ width: 100%;
+ height: 100%;
}
}
}
diff --git a/play-node-go/src/pages/Layout/NavBar/NavBar.js b/play-node-go/src/pages/Layout/NavBar/NavBar.js
index f537c8a..7c8014e 100644
--- a/play-node-go/src/pages/Layout/NavBar/NavBar.js
+++ b/play-node-go/src/pages/Layout/NavBar/NavBar.js
@@ -1,7 +1,7 @@
import React from 'react';
import { Link } from 'react-router-dom';
import './NavBar.scss';
-import Logo from '../../../components/Logo/Logo';
+import Logo from '../../../components/Button/Logo/Logo';
const NavBar = (props) => {