Skip to content

Commit a714fce

Browse files
committed
final styling touches v1
1 parent 5803909 commit a714fce

File tree

12 files changed

+108
-81
lines changed

12 files changed

+108
-81
lines changed

src/client/components/App.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import { Box, Divider } from '@mui/material';
2424
* - AA 18 May, 2022
2525
*/
2626
import '../../assets/style/App.scss';
27+
import WorkspaceContainer from './workspace/WorkspaceContainer';
2728

2829

2930
const { api } = window as unknown as WindowExt;
@@ -52,7 +53,7 @@ const App = () => {
5253
<Box sx={{ height: '100%', display: 'flex' }}>
5354
{/* Workspace. Left side of the application. */}
5455
<HistoryOrWorkspaceContainer currentWorkspaceId={currentWorkspaceId} setWorkspace={setWorkspace} />
55-
<Divider orientation="vertical"/>
56+
{/* <Divider orientation="horizontal" /> */}
5657
{/* Main container. Contains the composer and response panes. */}
5758
<MainContainer currentWorkspaceId={currentWorkspaceId} />
5859
</Box>

src/client/components/main/MainContainer.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ const mapDispatchToProps = (dispatch) => ({
7878

7979
function MainContainer(props) {
8080
return(
81-
<Box sx={{p: 1.5, width: '80%', overflowY: 'scroll'}}>
81+
<Box sx={{p: 1, width: '75%', overflowY: 'scroll'}}>
8282
<Routes>
8383
<Route
8484
path="/"
@@ -109,7 +109,6 @@ function MainContainer(props) {
109109
element={<WebhookComposer {...props} />}
110110
/>
111111
</Routes>
112-
{/* <Divider orientation="horizontal"/> */}
113112
<ResponsePaneContainer />
114113
</Box>
115114
)

src/client/components/main/response/WebSocketWindow.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/* eslint-disable no-param-reassign */
66
import React, { useState } from 'react';
77
import PropTypes from 'prop-types';
8-
8+
import WebSocketMessage from './WebSocketMessage';
99
import ImageDropzone from './ImageDropzone';
1010

1111
const { api } = window;
@@ -67,7 +67,7 @@ const WebSocketWindow = ({content, outgoingMessages, incomingMessages, connectio
6767
// maps the messages to view in chronological order and by whom - self/server
6868
const combinedMessagesReactArr = outgoingMessages
6969
.map((message: Record<string, unknown>) => {
70-
message = {...message, source: 'client'}
70+
message = {...message, source: 'client'}
7171
return message;
7272
})
7373
.concat(

src/client/components/navbar/GeneralInfo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default function GeneralInfo(props) {
1515
}}>
1616
{/* TODO: this GitHub button comes from a component library. Should build your own or find one that supports TS types. */ }
1717
{/* @ts-ignore:next-line */}
18-
<GitHubButton href="https://github.com/oslabs-beta/Swell" data-color-scheme="no-preference: dark; light: light; dark: dark;" data-size="large" data-show-count="true" aria-label="Star oslabs-beta/Swell on GitHub">Star</GitHubButton>
18+
<GitHubButton href="https://github.com/open-source-labs/Swell" data-size="large" data-show-count="true" aria-label="Star open-source-labs/Swell on GitHub">Star</GitHubButton>
1919
</Box>
2020
)
2121
}

src/client/components/navbar/LoginStatus.tsx

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,25 @@
11
import React from 'react';
22
import Cookies from 'js-cookie';
33

4-
import MoreVertRoundedIcon from '@mui/icons-material/MoreVertRounded';
54
import LogoutRoundedIcon from '@mui/icons-material/LogoutRounded';
65
import Box from '@mui/material/Box';
76
import Button from '@mui/material/Button';
87
import Avatar from '@mui/material/Avatar';
98
import Badge from '@mui/material/Badge';
109
import { styled } from '@mui/material/styles';
10+
import Tooltip, { TooltipProps, tooltipClasses } from '@mui/material/Tooltip';
11+
12+
const LightTooltip = styled(({ className, ...props }: TooltipProps) => (
13+
<Tooltip {...props} classes={{ popper: className }} />
14+
))(({ theme }) => ({
15+
[`& .${tooltipClasses.tooltip}`]: {
16+
backgroundColor: theme.palette.common.white,
17+
color: 'rgba(0, 0, 0, 0.87)',
18+
boxShadow: theme.shadows[1],
19+
fontSize: 11,
20+
fontWeight: 'bold',
21+
},
22+
}));
1123

1224
const StyledBadge = styled(Badge)(({ theme }) => ({
1325
'& .MuiBadge-badge': {
@@ -72,12 +84,14 @@ export default function LoginContainer(props) {
7284
flexDirection: 'row',
7385
alignItems: 'center',
7486
}}>
75-
<Button
76-
sx={{ maxWidth: '24px', maxHeight: '24px', minWidth: '24px', minHeight: '24px' }}
77-
onClick={handleSignOut}
78-
>
79-
<LogoutRoundedIcon fontSize='small' />
80-
</Button>
87+
<LightTooltip title="Logout">
88+
<Button
89+
sx={{ maxWidth: '24px', maxHeight: '24px', minWidth: '24px', minHeight: '24px' }}
90+
onClick={handleSignOut}
91+
>
92+
<LogoutRoundedIcon fontSize='small' />
93+
</Button>
94+
</LightTooltip>
8195
<StyledBadge
8296
sx={{
8397
m: 1,

src/client/components/workspace/HistoryOrWorkspaceContainer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export default function HistoryOrWorkspaceContainer(props) {
4646
const [showGraph, setShowGraph] = React.useState(false);
4747
const [value, setValue] = React.useState(0);
4848

49-
const currentResponse = useSelector((store: any) => store.business.currentResponse);
49+
// const currentResponse = useSelector((store: any) => store.business.currentResponse);
5050

5151
const handleChange = (event: React.SyntheticEvent, newValue: number) => {
5252
setValue(newValue);

src/client/components/workspace/WorkspaceContainer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export default function WorkspaceContainer({ currentWorkspaceId, setWorkspace })
3333
})
3434

3535
return (
36-
<Box className="workspace-container" sx={{ minWidth: '20%', align: 'center', p: 1.5 }}>
36+
<Box className="workspace-container" sx={{ minWidth: '20%', align: 'center' }}>
3737
{/* The display for your current workspace. Contains functionality for saving, importing, exporting, and adding other GitHub users to your workspace. */}
3838
<CurrentWorskpaceDisplay currentWorkspaceId={currentWorkspaceId} currentWorkspace={currentWorkspace} handleWorkspaceChange={handleWorkspaceChange}/>
3939
<Box className="collections-container">
Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,23 @@
11
import React from 'react';
22
import { useDispatch } from 'react-redux';
33
import * as actions from '../../../features/business/businessSlice'
4-
import DeleteForeverRoundedIcon from '@mui/icons-material/DeleteForeverRounded';
4+
import ClearRoundedIcon from '@mui/icons-material/ClearRounded';
55
import collectionsController from '../../../controllers/collectionsController';
66
import { Button } from '@mui/material';
7+
import { styled } from '@mui/material/styles';
8+
import Tooltip, { TooltipProps, tooltipClasses } from '@mui/material/Tooltip';
9+
10+
const LightTooltip = styled(({ className, ...props }: TooltipProps) => (
11+
<Tooltip {...props} classes={{ popper: className }} />
12+
))(({ theme }) => ({
13+
[`& .${tooltipClasses.tooltip}`]: {
14+
backgroundColor: theme.palette.common.white,
15+
color: 'rgba(0, 0, 0, 0.87)',
16+
boxShadow: theme.shadows[1],
17+
fontSize: 11,
18+
fontWeight: 'bold',
19+
},
20+
}));
721

822
export default function DeleteRequestButton(props) {
923
const dispatch = useDispatch();
@@ -14,13 +28,15 @@ export default function DeleteRequestButton(props) {
1428
};
1529

1630
return(
17-
<Button
18-
color="error"
19-
variant="text"
20-
sx={{ maxWidth: '24px', maxHeight: '24px', minWidth: '24px', minHeight: '24px' }}
21-
onClick={deleteWorkspace}
22-
>
23-
<DeleteForeverRoundedIcon fontSize="small"/>
24-
</Button>
31+
<LightTooltip title="Delete Workspace">
32+
<Button
33+
color="error"
34+
variant="text"
35+
sx={{ maxWidth: '24px', maxHeight: '24px', minWidth: '24px', minHeight: '24px' }}
36+
onClick={deleteWorkspace}
37+
>
38+
<ClearRoundedIcon fontSize="small"/>
39+
</Button>
40+
</LightTooltip>
2541
)
2642
}
Lines changed: 38 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,38 @@
1-
import React from "react";
2-
import { Button } from '@mui/material';
3-
import { PersonAddAlt1Rounded } from '@mui/icons-material';
4-
import InviteToWorkspaceModal from "../modals/invite-to-workspace/InviteToWorkspaceModal";
5-
6-
export default function ExportWorkspaceButton() {
7-
const [open, setOpen] = React.useState(false);
8-
const handleOpen = () => setOpen(true);
9-
const handleClose = () => setOpen(false);
10-
11-
return(
12-
<div>
13-
<Button
14-
variant="text"
15-
sx={{ maxWidth: '24px', maxHeight: '24px', minWidth: '24px', minHeight: '24px' }}
16-
onClick={handleOpen}>
17-
<PersonAddAlt1Rounded fontSize="small"/>
18-
</Button>
19-
<InviteToWorkspaceModal open={open} handleClose={handleClose}/>
20-
</div>
21-
)
22-
}
1+
import React from "react";
2+
import { Button } from '@mui/material';
3+
import { PersonAddAlt1Rounded } from '@mui/icons-material';
4+
import InviteToWorkspaceModal from "../modals/invite-to-workspace/InviteToWorkspaceModal";
5+
import { styled } from '@mui/material/styles';
6+
import Tooltip, { TooltipProps, tooltipClasses } from '@mui/material/Tooltip';
7+
8+
const LightTooltip = styled(({ className, ...props }: TooltipProps) => (
9+
<Tooltip {...props} classes={{ popper: className }} />
10+
))(({ theme }) => ({
11+
[`& .${tooltipClasses.tooltip}`]: {
12+
backgroundColor: theme.palette.common.white,
13+
color: 'rgba(0, 0, 0, 0.87)',
14+
boxShadow: theme.shadows[1],
15+
fontSize: 11,
16+
fontWeight: 'bold',
17+
},
18+
}));
19+
20+
export default function ExportWorkspaceButton() {
21+
const [open, setOpen] = React.useState(false);
22+
const handleOpen = () => setOpen(true);
23+
const handleClose = () => setOpen(false);
24+
25+
return(
26+
<div>
27+
<LightTooltip title="Invite to Workspace">
28+
<Button
29+
variant="text"
30+
sx={{ maxWidth: '24px', maxHeight: '24px', minWidth: '24px', minHeight: '24px' }}
31+
onClick={handleOpen}>
32+
<PersonAddAlt1Rounded fontSize="small"/>
33+
</Button>
34+
</LightTooltip>
35+
<InviteToWorkspaceModal open={open} handleClose={handleClose}/>
36+
</div>
37+
)
38+
}

src/client/components/workspace/modals/import-export-workspace/ExportToGitHubDialog.tsx

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,10 @@ import ListItemButton from '@mui/material/ListItemButton';
1212
import db from '../../../../db';
1313
import { useLiveQuery } from 'dexie-react-hooks';
1414

15-
16-
// export interface SimpleDialogProps {
17-
// open: boolean;
18-
// selectedValue: string;
19-
// onClose: (value: string) => void;
20-
// }
21-
2215
export default function ExportToGithubDialog({ allUserRepos, workspace, selectedRepo, open, onClose}) {
2316
let files = useLiveQuery(() => db.files.toArray());
2417
let repos = useLiveQuery(() => db.repos.toArray());
2518

26-
// db.table('repo')
27-
// .where('name')
28-
// .equalsIgnoreCase(name)
29-
// .first((foundCollection: boolean) => !!foundCollection)
30-
// .then((found: boolean) => resolve(found))
31-
// .catch((error: Record<string, undefined>) => {
32-
// console.error(error.stack || error);
33-
// reject(error);
34-
// });
35-
3619
const handleClose = () => {
3720
onClose(selectedRepo);
3821
};
@@ -52,13 +35,6 @@ export default function ExportToGithubDialog({ allUserRepos, workspace, selected
5235
sha = file.sha;
5336
}
5437
}
55-
// db.table('files')
56-
// .where((workspace) => {
57-
58-
// })
59-
60-
61-
6238
collectionsController.exportToGithub(workspace.id, repo.name, sha)
6339
}
6440

@@ -80,7 +56,6 @@ export default function ExportToGithubDialog({ allUserRepos, workspace, selected
8056
}
8157
}
8258

83-
8459
return (
8560
<Dialog onClose={handleClose} open={open}>
8661
<DialogTitle>Select a repository to export to.</DialogTitle>

0 commit comments

Comments
 (0)