Skip to content

Commit acba201

Browse files
authored
Merge pull request #6 from oslabs-beta/resolve-merge
Resolve merge
2 parents c9dc38c + 4727b1b commit acba201

File tree

5 files changed

+61
-29
lines changed

5 files changed

+61
-29
lines changed

app/src/components/left/RoomsContainer.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ import store from '../../redux/store';
1616
//pasted from navbarbuttons
1717
import debounce from '../../../../node_modules/lodash/debounce.js';
1818

19-
// for websockets
20-
// Part - join room and room code functionality
19+
// // for websockets
20+
// // Part - join room and room code functionality
2121
let socket;
2222
const { API_BASE_URL } = config;
2323
const RoomsContainer = () => {
@@ -29,11 +29,12 @@ const RoomsContainer = () => {
2929
joinedRoom: store.roomCodeSlice.roomCode
3030
}));
3131
React.useEffect(() => {
32-
console.log('joinedRoom: ', joinedRoom);
32+
console.log('You Joined Room: ', joinedRoom);
3333
}, [joinedRoom]);
3434

3535
function initSocketConnection(roomCode) {
3636
if (socket) {
37+
//edge case check if socket connection existed
3738
socket.disconnect();
3839
}
3940

@@ -79,9 +80,9 @@ const RoomsContainer = () => {
7980
function handleUserEnteredRoom(roomCode) {
8081
initSocketConnection(roomCode);
8182
}
82-
//line 83-113 was pasted in from NavBarButtons
83-
let previousState = store.getState();
8483

84+
let previousState = store.getState();
85+
// console.log('Store States: ', store.getState);
8586
// sending info to backend whenever the redux store changes
8687
const handleStoreChange = debounce(() => {
8788
const newState = store.getState();
@@ -113,7 +114,6 @@ const RoomsContainer = () => {
113114
function joinRoom() {
114115
dispatch(changeRoom(roomCode));
115116
setConfirmRoom((confirmRoom) => roomCode);
116-
117117
// Call handleUserEnteredRoom when joining a room
118118
handleUserEnteredRoom(roomCode);
119119
}
@@ -129,6 +129,9 @@ const RoomsContainer = () => {
129129
}}
130130
>
131131
{' '}
132+
<Typography variant="h6" color={'white'}>
133+
Live Room: {joinedRoom}
134+
</Typography>
132135
<TextField
133136
hiddenLabel
134137
id="filled-hidden-label-small"
@@ -162,9 +165,6 @@ const RoomsContainer = () => {
162165
>
163166
Join Room
164167
</Button>
165-
<Typography variant="h6" color={'white'}>
166-
In Room: {joinedRoom}
167-
</Typography>
168168
</Stack>
169169
{/* <button onClick={() => joinRoom()}>Join Room</button> */}
170170
</div>

app/src/components/top/NavBarButtons.tsx

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,33 @@ function navbarDropDown(props) {
254254
// // Call handleUserEnteredRoom when joining a room
255255
// handleUserEnteredRoom(roomCode);
256256
// }
257+
<<<<<<< HEAD
258+
// Part - Dark Mode
259+
const switchDark = isDarkMode ? (
260+
<svg
261+
xmlns="http://www.w3.org/2000/svg"
262+
width="16"
263+
height="16"
264+
fill="currentColor"
265+
className="bi bi-lightbulb"
266+
viewBox="0 0 16 16"
267+
>
268+
<path d="M2 6a6 6 0 1 1 10.174 4.31c-.203.196-.359.4-.453.619l-.762 1.769A.5.5 0 0 1 10.5 13a.5.5 0 0 1 0 1 .5.5 0 0 1 0 1l-.224.447a1 1 0 0 1-.894.553H6.618a1 1 0 0 1-.894-.553L5.5 15a.5.5 0 0 1 0-1 .5.5 0 0 1 0-1 .5.5 0 0 1-.46-.302l-.761-1.77a1.964 1.964 0 0 0-.453-.618A5.984 5.984 0 0 1 2 6zm6-5a5 5 0 0 0-3.479 8.592c.263.254.514.564.676.941L5.83 12h4.342l.632-1.467c.162-.377.413-.687.676-.941A5 5 0 0 0 8 1z" />
269+
</svg>
270+
) : (
271+
<svg
272+
xmlns="http://www.w3.org/2000/svg"
273+
width="16"
274+
height="16"
275+
fill="currentColor"
276+
className="bi bi-moon"
277+
viewBox="0 0 16 16"
278+
>
279+
<path d="M6 .278a.768.768 0 0 1 .08.858 7.208 7.208 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277.527 0 1.04-.055 1.533-.16a.787.787 0 0 1 .81.316.733.733 0 0 1-.031.893A8.349 8.349 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.752.752 0 0 1 6 .278zM4.858 1.311A7.269 7.269 0 0 0 1.025 7.71c0 4.02 3.279 7.276 7.319 7.276a7.316 7.316 0 0 0 5.205-2.162c-.337.042-.68.063-1.029.063-4.61 0-8.343-3.714-8.343-8.29 0-1.167.242-2.278.681-3.286z" />
280+
</svg>
281+
);
282+
=======
283+
>>>>>>> dev
257284

258285
let showMenu = props.dropMenu ? 'navDropDown' : 'hideNavDropDown';
259286

@@ -327,6 +354,14 @@ function navbarDropDown(props) {
327354
<path d="M6.5 1h3a.5.5 0 0 1 .5.5v1H6v-1a.5.5 0 0 1 .5-.5ZM11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3A1.5 1.5 0 0 0 5 1.5v1H2.506a.58.58 0 0 0-.01 0H1.5a.5.5 0 0 0 0 1h.538l.853 10.66A2 2 0 0 0 4.885 16h6.23a2 2 0 0 0 1.994-1.84l.853-10.66h.538a.5.5 0 0 0 0-1h-.995a.59.59 0 0 0-.01 0H11Zm1.958 1-.846 10.58a1 1 0 0 1-.997.92h-6.23a1 1 0 0 1-.997-.92L3.042 3.5h9.916Zm-7.487 1a.5.5 0 0 1 .528.47l.5 8.5a.5.5 0 0 1-.998.06L5 5.03a.5.5 0 0 1 .47-.53Zm5.058 0a.5.5 0 0 1 .47.53l-.5 8.5a.5.5 0 1 1-.998-.06l.5-8.5a.5.5 0 0 1 .528-.47ZM8 4.5a.5.5 0 0 1 .5.5v8.5a.5.5 0 0 1-1 0V5a.5.5 0 0 1 .5-.5Z" />
328355
</svg>
329356
</button>
357+
<<<<<<< HEAD
358+
{/* {<ExportButton />} */}
359+
{/*
360+
<button onClick={handleDarkModeToggle}>
361+
{isDarkMode ? 'Light' : 'Dark'} Mode {switchDark}
362+
</button> */}
363+
=======
364+
>>>>>>> dev
330365
{state.isLoggedIn && (
331366
<button onClick={handleClick}>
332367
Manage Project

config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ const config = {
33
DEV_PORT: 5656,
44
API_BASE_URL: isProduction
55
? 'https://app.reactype.dev'
6-
//: 'http://localhost:8080',
7-
:'http://localhost:5656',
6+
: 'http://localhost:5656',
7+
// : 'http://localhost:8080',
88
API_BASE_URL2: isProduction
99
? 'https://app.reactype.dev'
10-
: 'http://localhost:8080',
10+
: 'http://localhost:8080'
1111
};
1212
module.exports = config;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "17.0.0 by Victor Martins, Liam Roh, Denton Wong, Ahnaf Khan, Hernan Damazo",
44
"description": "Prototyping tool for React/Typescript Applications.",
55
"private": true,
6-
"main": "app/electron/main.js",
6+
"main": "app/.electron/main.js",
77
"author": "OS Labs",
88
"contributors": [
99
"Victor Martins",

server/server.ts

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const isTest = process.env.NODE_ENV === 'test';
4141

4242
app.use(express.json({ limit: '100mb' }));
4343
app.use(express.urlencoded({ limit: '100mb', extended: true }));
44-
app.use(cookieParser());//added cookie parser
44+
app.use(cookieParser()); //added cookie parser
4545
// Routes
4646
// const stylesRouter = require('./routers/stylesRouter');
4747
import stylesRouter from './routers/stylesRouter';
@@ -96,9 +96,9 @@ const io = new Server(httpServer, {
9696
});
9797

9898
io.on('connection', (socket) => {
99-
console.log(socket.id);
99+
console.log('Socket ID: -----', socket.id);
100100
socket.on('custom-event', (string, redux_store, room) => {
101-
console.log(room);
101+
console.log('Room Code', room);
102102
if (room) {
103103
socket.to(room).emit('receive message', redux_store);
104104
} else {
@@ -173,17 +173,16 @@ app.post(
173173
);
174174

175175
//confirming whether user is logged in for index.tsx rendering
176-
app.get(
177-
'/loggedIn',
178-
sessionController.isLoggedIn,
179-
(req, res) => res.status(200).json(res.locals.loggedIn)
180-
)
176+
app.get('/loggedIn', sessionController.isLoggedIn, (req, res) =>
177+
res.status(200).json(res.locals.loggedIn)
178+
);
181179

182-
app.get('/logout',
183-
cookieController.deleteCookies,
184-
sessionController.endSession,
185-
(req,res) => res.status(200).json(res.locals.deleted)
186-
)
180+
app.get(
181+
'/logout',
182+
cookieController.deleteCookies,
183+
sessionController.endSession,
184+
(req, res) => res.status(200).json(res.locals.deleted)
185+
);
187186

188187
// user must be logged in to get or save projects, otherwise they will be redirected to login page
189188
app.post(
@@ -193,7 +192,6 @@ app.post(
193192
(req, res) => res.status(200).json(res.locals.savedProject)
194193
);
195194

196-
197195
app.post(
198196
'/getProjects',
199197
sessionController.isLoggedIn,
@@ -236,7 +234,7 @@ app.get(
236234
app.get(
237235
'/cloneProject/:docId',
238236
sessionController.isLoggedIn,
239-
marketplaceController.cloneProject,
237+
marketplaceController.cloneProject,
240238
(req, res) => res.status(200).json(res.locals.clonedProject)
241239
);
242240

@@ -266,7 +264,6 @@ if (isDocker) {
266264
});
267265
}
268266

269-
270267
app.get('/test', (req, res) => {
271268
res.send('test request is working');
272269
});

0 commit comments

Comments
 (0)