Skip to content

Commit d9f85f6

Browse files
committed
Co-authored-by: r-mcgrath <[email protected]>
Co-authored-by: HadriChan <[email protected]>
1 parent acba201 commit d9f85f6

File tree

5 files changed

+28
-65
lines changed

5 files changed

+28
-65
lines changed

app/src/components/App.tsx

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { saveProject } from '../helperFunctions/projectGetSaveDel';
1919
// Intermediary component to wrap main App component with higher order provider components
2020
export const App = (): JSX.Element => {
2121
const state = useSelector((store: RootState) => store.appState);
22-
22+
2323
const [toggleAttempt, setToggleAttempt] = useState(false);
2424
const dispatch = useDispatch();
2525
// checks if user is signed in as guest or actual user and changes loggedIn boolean accordingly
@@ -30,21 +30,21 @@ export const App = (): JSX.Element => {
3030
//setToggleAttempt(!toggleAttempt);
3131
}, []);
3232

33-
// following useEffect runs on first mount
33+
// // following useEffect runs on first mount
3434
// useEffect(() => {
35-
// // console.log('cookies.get in App', Cookies.get())
35+
// console.log('cookies.get in App', Cookies.get());
3636
// // if user is a guest, see if a project exists in localforage and retrieve it
37-
// // v17 May not currently work yet
37+
// // v17: May not currently work yet
3838
// if (!state.isLoggedIn) {
3939
// localforage.getItem('guestProject').then((project) => {
4040
// // if project exists, use dispatch to set initial state to that project
41+
// console.log('local forage get project', project);
4142
// if (project) {
4243
// dispatch(setInitialState(project));
4344
// }
4445
// });
4546
// } else {
4647
// // otherwise if a user is logged in, use a fetch request to load user's projects from DB
47-
4848
// let userId;
4949
// if (Cookies.get('ssid')) {
5050
// userId = Cookies.get('ssid');
@@ -63,24 +63,26 @@ export const App = (): JSX.Element => {
6363
// });
6464
// }
6565
// }, []);
66+
67+
// // New project save configuration to optimize server load and minimize Ajax requests
6668
// useEffect(() => {
6769
// // provide config properties to legacy projects so new edits can be auto saved
68-
// // if (state.config === undefined) {
69-
// // state.config = { saveFlag: true, saveTimer: false };
70-
// // }
71-
// // New project save configuration to optimize server load and minimize Ajax requests
70+
// if (state.config === undefined) {
71+
// state.config = { saveFlag: true, saveTimer: false };
72+
// }
73+
7274
// if (state.config.saveFlag) {
73-
// // state.config.saveFlag = false;
74-
// // state.config.saveTimer = true;
75-
// // dispatch(configToggle())
75+
// state.config.saveFlag = false;
76+
// state.config.saveTimer = true;
77+
// //dispatch(configToggle());
7678

7779
// let userId;
7880
// if (Cookies.get('ssid')) {
7981
// userId = Cookies.get('ssid');
8082
// } else {
8183
// userId = window.localStorage.getItem('ssid');
8284
// }
83-
// // if (state.isLoggedIn === false) {
85+
8486
// if (!state.isLoggedIn) {
8587
// localforage.setItem('guestProject', state);
8688
// } else if (state.name !== '') {
@@ -95,19 +97,16 @@ export const App = (): JSX.Element => {
9597
// }, 15000);
9698
// }
9799
// }, [state]);
98-
// uncomment below to log state
99100

100101
return (
101102
<div className="app">
102-
103-
<header
104-
style={{ height: '40px', width: '100%', backgroundColor: 'white' }}
105-
>
106-
ReacType
107-
</header>
103+
<header
104+
style={{ height: '40px', width: '100%', backgroundColor: 'white' }}
105+
>
106+
ReacType
107+
</header>
108108

109-
<AppContainer />
110-
109+
<AppContainer />
111110
</div>
112111
);
113112
};

app/src/components/left/RoomsContainer.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ const RoomsContainer = () => {
5858

5959
// receiving the message from the back end
6060
socket.on('receive message', (event) => {
61-
// console.log('message from server: ', event);
6261
let currentStore: any = JSON.stringify(store.getState());
6362
if (currentStore !== event) {
6463
currentStore = JSON.parse(currentStore);

app/src/components/top/NavBarButtons.tsx

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -254,33 +254,6 @@ 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
284257

285258
let showMenu = props.dropMenu ? 'navDropDown' : 'hideNavDropDown';
286259

@@ -354,14 +327,6 @@ function navbarDropDown(props) {
354327
<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" />
355328
</svg>
356329
</button>
357-
<<<<<<< HEAD
358-
{/* {<ExportButton />} */}
359-
{/*
360-
<button onClick={handleDarkModeToggle}>
361-
{isDarkMode ? 'Light' : 'Dark'} Mode {switchDark}
362-
</button> */}
363-
=======
364-
>>>>>>> dev
365330
{state.isLoggedIn && (
366331
<button onClick={handleClick}>
367332
Manage Project

app/src/interfaces/Interfaces.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export interface State {
99
components: Component[];
1010
rootComponents: number[];
1111
projectType: string;
12-
config?: {};
12+
config?: { saveTimer: boolean; saveFlag: boolean };
1313
separator?: ChildElement;
1414
canvasFocus: { componentId: number; childId: number | null };
1515
nextComponentId: number;

app/src/redux/reducers/slice/appStateSlice.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const initialState: State = {
1717
forked: false,
1818
published: false,
1919
isLoggedIn: false,
20-
// config: { saveFlag: true, saveTimer: false },
20+
config: { saveFlag: true, saveTimer: false },
2121
components: [
2222
{
2323
id: 1,
@@ -42,8 +42,8 @@ export const initialState: State = {
4242
nextTopSeparatorId: 1000,
4343
HTMLTypes: HTMLTypes, // left as is for now
4444
tailwind: false,
45-
stylesheet: '',
46-
codePreview: false,
45+
stylesheet: '',
46+
codePreview: false,
4747
screenshotTrigger: false
4848
};
4949

@@ -778,7 +778,7 @@ const appStateSlice = createSlice({
778778
state._id = projectId;
779779
},
780780
updateProjectPublished: (state, action) => {
781-
const projectPublished = action.payload;
781+
const projectPublished = action.payload;
782782
state.published = projectPublished;
783783
},
784784
deleteElement: (state, action) => {
@@ -1326,8 +1326,8 @@ export const {
13261326
//configToggle,
13271327
snapShotAction,
13281328
allCooperativeState,
1329-
updateStylesheet,
1330-
toggleCodePreview,
1329+
updateStylesheet,
1330+
toggleCodePreview,
13311331
toggleScreenshotTrigger
13321332
} = appStateSlice.actions;
13331333

0 commit comments

Comments
 (0)