Skip to content

Commit 2289813

Browse files
committed
final
1 parent 8d4714f commit 2289813

File tree

4 files changed

+43
-117
lines changed

4 files changed

+43
-117
lines changed

app/src/components/left/RoomsContainer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ const RoomsContainer = () => {
7171
const roomPassword = useSelector(
7272
(store: RootState) => store.roomSlice.password
7373
);
74-
74+
7575
const userJoined = useSelector(
7676
(store: RootState) => store.roomSlice.userJoined
7777
);

app/src/components/top/NavBar.tsx

Lines changed: 24 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import MoreVertIcon from '@mui/icons-material/MoreVert';
66
import NavBarButtons from './NavBarButtons';
77
import NewExportButton from './NewExportButton';
88
import { RootState } from '../../redux/store';
9-
import logo from '../../public/icons/win/blue-R-white-bg.png';
9+
import logo from '../../public/icons/win/logo.png';
1010
import { useSelector, useDispatch } from 'react-redux';
1111
import {
1212
publishProject,
@@ -22,22 +22,6 @@ import {
2222
import { State } from '../../interfaces/Interfaces';
2323
import MuiAlert, { AlertProps } from '@mui/material/Alert';
2424
import Snackbar from '@mui/material/Snackbar';
25-
import {
26-
Send,
27-
CancelScheduleSend,
28-
MoreVert,
29-
ManageSearch,
30-
Menu
31-
} from '@mui/icons-material/';
32-
import { styled, alpha } from '@mui/material/styles';
33-
import {
34-
AppBar,
35-
Box,
36-
Toolbar,
37-
IconButton,
38-
Typography,
39-
InputBase
40-
} from '@mui/material';
4125

4226
const NavBar: React.FC = () => {
4327
const [dropMenu, setDropMenu] = useState(false);
@@ -58,43 +42,6 @@ const NavBar: React.FC = () => {
5842
const [openAlert, setOpenAlert] = React.useState<boolean>(false);
5943
const [loginAlert, setLoginAlert] = React.useState<boolean>(false);
6044

61-
const SearchIconWrapper = styled('div')(({ theme }) => ({
62-
padding: theme.spacing(0, 2),
63-
height: '100%',
64-
position: 'absolute',
65-
pointerEvents: 'none',
66-
display: 'flex',
67-
alignItems: 'center',
68-
justifyContent: 'center'
69-
}));
70-
71-
const Search = styled('div')(({ theme }) => ({
72-
color: 'white',
73-
backgroundColor: '#4a4a4a',
74-
borderRadius: theme.shape.borderRadius,
75-
marginRight: theme.spacing(2),
76-
marginLeft: 0,
77-
width: 'auto',
78-
display: 'flex', // Make the container a flex container
79-
alignItems: 'center' // Align items vertically
80-
}));
81-
82-
const StyledInputBase = styled(InputBase)(({ theme }) => ({
83-
color: 'inherit',
84-
'& .MuiInputBase-input': {
85-
padding: theme.spacing(1, 5, 1, 0),
86-
paddingLeft: `calc(1em + ${theme.spacing(6)})`,
87-
transition: theme.transitions.create('width'),
88-
width: '10ch', // Adjust width as needed
89-
[theme.breakpoints.up('sm')]: {
90-
width: '50ch',
91-
'&:focus': {
92-
width: '60ch' // Adjust width as needed
93-
}
94-
}
95-
}
96-
}));
97-
9845
useEffect(() => {
9946
setProjectName(state.name);
10047
}, [state.name]);
@@ -109,9 +56,8 @@ const NavBar: React.FC = () => {
10956

11057
const buttonContainerStyle = {
11158
display: 'flex',
112-
margin: '0',
113-
justifyContent: 'flex-start',
114-
padding: '0'
59+
alignItems: 'center',
60+
justifyContent: 'flex-start'
11561
};
11662

11763
const buttonStyle = {
@@ -127,7 +73,8 @@ const NavBar: React.FC = () => {
12773
};
12874

12975
const moreVertButtonStyle = {
130-
backgroundColor: 'black',
76+
backgroundColor: '#333',
77+
border: '1px solid #333',
13178
padding: '0',
13279
cursor: 'pointer',
13380
display: 'flex',
@@ -137,7 +84,7 @@ const NavBar: React.FC = () => {
13784
width: '30px',
13885
minWidth: '20px',
13986
marginLeft: '0px',
140-
marginRight: '5rem'
87+
marginRight: '10px'
14188
};
14289

14390
const handlePublish = () => {
@@ -200,59 +147,30 @@ const NavBar: React.FC = () => {
200147
<nav className="main-navbar" style={{ backgroundColor: '#151515' }}>
201148
<Link to="/" style={{ textDecoration: 'none', cursor: 'default' }}>
202149
<div className="main-logo">
203-
<Avatar
204-
src={logo}
205-
sx={{
206-
width: '3rem',
207-
height: '3rem'
208-
}}
209-
/>
150+
<Avatar src={logo}></Avatar>
151+
<h1 style={{ color: '#151515' }}>reactype</h1>
210152
</div>
211153
</Link>
212-
213-
<Box sx={{ flexGrow: 1 }}>
214-
<Toolbar>
215-
<IconButton
216-
size="large"
217-
edge="start"
218-
color="inherit"
219-
aria-label="open drawer"
220-
sx={{ mr: 2 }}
221-
></IconButton>
222-
<Typography
223-
variant="h6"
224-
noWrap
225-
component="div"
226-
sx={{ flexGrow: 1, display: { xs: 'none', sm: 'block' } }}
227-
></Typography>
228-
<Search>
229-
<SearchIconWrapper>
230-
<ManageSearch sx={{ marginRight: '2rem' }} />
231-
</SearchIconWrapper>
232-
<StyledInputBase
233-
placeholder="Search…"
234-
inputProps={{ 'aria-label': 'search' }}
235-
/>
236-
</Search>
237-
</Toolbar>
238-
</Box>
239-
240154
<div style={buttonContainerStyle}>
241155
{isMarketplace ? null : state.published ? (
242-
<Button style={buttonStyle} onClick={handleUnpublish}>
243-
<CancelScheduleSend
244-
style={{ color: 'white', marginRight: '-1rem' }}
245-
/>
246-
</Button>
156+
<button style={buttonStyle} onClick={handleUnpublish}>
157+
Unpublish
158+
</button>
247159
) : (
248-
<Button onClick={handlePublish}>
249-
<Send style={{ color: '#86868b', marginRight: '-1rem' }} />
250-
</Button>
160+
<button style={buttonStyle} onClick={handlePublish}>
161+
Publish
162+
</button>
251163
)}
252164
<NewExportButton />
253-
<Button onClick={() => setDropMenu(!dropMenu)} ref={menuButtonRef}>
254-
<MoreVert
255-
style={{ color: '#86868b' }}
165+
<Button
166+
style={moreVertButtonStyle}
167+
variant="contained"
168+
color="primary"
169+
onClick={() => setDropMenu(!dropMenu)}
170+
ref={menuButtonRef}
171+
>
172+
<MoreVertIcon
173+
style={{ color: 'white' }}
256174
data-testid="more-vert-button"
257175
/>
258176
</Button>
@@ -351,4 +269,4 @@ const NavBar: React.FC = () => {
351269
);
352270
};
353271

354-
export default NavBar;
272+
export default NavBar;

app/src/components/top/NewExportButton.tsx

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@ import List from '@mui/material/List';
33
import ListItem from '@mui/material/ListItem';
44
import ListItemText from '@mui/material/ListItemText';
55
import createModal from '../../components/right/createModal';
6-
import zipFiles from '../../helperFunctions/zipFiles';
6+
import zipFiles from '../../helperFunctions/zipFiles'; // Import your zipFiles function
77
import { useSelector } from 'react-redux';
88
import { RootState } from '../../redux/store';
9-
import { IosShare, Publish } from '@mui/icons-material';
10-
import { Button } from '@mui/material';
119

1210
export default function NewExportButton(): React.JSX.Element {
1311
const [modal, setModal] = useState(null);
@@ -17,6 +15,17 @@ export default function NewExportButton(): React.JSX.Element {
1715

1816
const closeModal = () => setModal('');
1917

18+
const buttonStyle = {
19+
backgroundColor: '#333',
20+
border: 'none',
21+
color: 'white',
22+
fontSize: '12px',
23+
padding: '8px 12px',
24+
cursor: 'pointer',
25+
marginRight: '10px',
26+
borderRadius: '4px'
27+
};
28+
2029
const showGenerateAppModal = () => {
2130
const children = (
2231
<List className="export-preference">
@@ -28,8 +37,7 @@ export default function NewExportButton(): React.JSX.Element {
2837
style={{
2938
border: '1px solid #3c59ba',
3039
marginBottom: '2%',
31-
marginTop: '5%',
32-
backgroundColor: '#4a4a4a'
40+
marginTop: '5%'
3341
}}
3442
>
3543
<ListItemText primary={option} style={{ textAlign: 'center' }} />
@@ -72,10 +80,10 @@ export default function NewExportButton(): React.JSX.Element {
7280

7381
return (
7482
<div>
75-
<Button sx={{ color: 'white' }} onClick={showGenerateAppModal}>
76-
<IosShare style={{ color: '#86868b', marginRight: '-0.7rem' }} />
77-
</Button>
83+
<button style={buttonStyle} onClick={showGenerateAppModal}>
84+
&lt; &gt; Export
85+
</button>
7886
{modal}
7987
</div>
8088
);
81-
}
89+
}

server/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ io.on('connection', (client) => {
9595
io.emit('room is already taken');
9696
}
9797

98-
if (!roomLists[roomCode] && method === "JOIN") {
98+
if (!roomLists[roomCode] && method === 'JOIN') {
9999
io.emit('room does not exist');
100100
}
101101

0 commit comments

Comments
 (0)