Skip to content

Commit

Permalink
Merge pull request #41 from oslabs-beta/m-clean-up
Browse files Browse the repository at this point in the history
minor clean ups
  • Loading branch information
MatteoDiter authored May 12, 2023
2 parents eca51ac + 24f2264 commit 30e92c4
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 39 deletions.
6 changes: 2 additions & 4 deletions app/src/components/left/HTMLItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ const HTMLItem : React.FC<{
id: number;
Icon: any;
handleDelete: (id: number) => void;
}> = ({ name, id, Icon, handleDelete }) => {
}> = ({ name, id, handleDelete }) => {

const classes = useStyles();
const [modal, setModal] = useState(null);
const isDarkMode = useSelector((store:RootState) => store.darkMode.isDarkMode);
const [{ isDragging }, drag] = useDrag({
const [{ isDragging }, drag] = useDrag({ // is dragging is never read, but if deleted adjustment in the ref are needed line 122/128 ref={drag} to {...drag}
item: {
type: ItemTypes.INSTANCE,
newInstance: true,
Expand All @@ -70,7 +70,6 @@ const HTMLItem : React.FC<{
<List className="export-preference">
<ListItem
key={`clear${deleteID}`}
button
onClick={() => handleDelete(deleteID)}
style={{
border: '1px solid #3f51b5',
Expand All @@ -86,7 +85,6 @@ const HTMLItem : React.FC<{
</ListItem>
<ListItem
key={`close${deleteID}`}
button
onClick={closeModal}
style={{
border: '1px solid #3f51b5',
Expand Down
5 changes: 0 additions & 5 deletions app/src/components/left/HTMLPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import makeStyles from '@mui/styles/makeStyles';
import {
Button,
InputLabel
// TextField,
} from '@mui/material';
import TextField from '@mui/material/TextField';
import { RootState } from '../../redux/store';
Expand Down Expand Up @@ -169,7 +168,6 @@ const HTMLPanel = (props): JSX.Element => {
? classes.lightThemeFontColor
: classes.darkThemeFontColor
}
//value="New HTML Tag"
>
New HTML Tag:{' '}
</h4>
Expand Down Expand Up @@ -233,7 +231,6 @@ const HTMLPanel = (props): JSX.Element => {
</InputLabel>
<TextField
id="elementName"
// label='Element Name'
color="primary"
variant="outlined"
type="text"
Expand Down Expand Up @@ -321,8 +318,6 @@ const useStyles = makeStyles({
textOverflow: 'ellipsis',
backgroundColor: 'rgba(255,255,255,0.15)',
margin: '0px 0px 0px 0px',
// width: '200px',
// height: '75px',
alignSelf: 'center',
border: '2px solid grey'
},
Expand Down
44 changes: 20 additions & 24 deletions app/src/components/login/SignIn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,17 @@ function Copyright() {

const useStyles = makeStyles((theme) => ({
paper: {
// marginTop: theme.spacing(8),
display: 'flex',
flexDirection: 'column',
alignItems: 'center'
},
avatar: {
// margin: theme.spacing(1),
backgroundColor: '#3EC1AC'
},
form: {
width: '100%' // Fix IE 11 issue.
// marginTop: theme.spacing(1)
},
submit: {
// margin: theme.spacing(1, 0, 1),
cursor: 'pointer'
},
root: {
Expand Down Expand Up @@ -183,25 +179,26 @@ const SignIn: React.FC<LoginInt & RouteComponentProps> = (props) => {
// 8080 for container 5656 for dev
window.location.assign(`${API_BASE_URL}/auth/github`);
};
const responseFacebook = (response) => {
if (response.accessToken) {
newUserIsCreated(response.email, response.email, randomPassword()).then(
(userCreated) => {
if (userCreated === 'Success') {
props.history.push('/');
} else {
sessionIsCreated(response.email, randomPassword(), true).then(
(loginStatus) => {
if (loginStatus === 'Success') {
props.history.push('/');
}
}
);
}
}
);
}
};

// const responseFacebook = (response) => {
// if (response.accessToken) {
// newUserIsCreated(response.email, response.email, randomPassword()).then(
// (userCreated) => {
// if (userCreated === 'Success') {
// props.history.push('/');
// } else {
// sessionIsCreated(response.email, randomPassword(), true).then(
// (loginStatus) => {
// if (loginStatus === 'Success') {
// props.history.push('/');
// }
// }
// );
// }
// }
// );
// }
// };

// NEW DARK MODE
const handleDarkModeToggle = () => {
Expand All @@ -225,7 +222,6 @@ const SignIn: React.FC<LoginInt & RouteComponentProps> = (props) => {
right: 20,
position: 'absolute'
}}
// variant="contained"
endIcon={!isDarkMode ? <Brightness3Icon /> : <Brightness5Icon />}
onClick={handleDarkModeToggle}
>
Expand Down
4 changes: 0 additions & 4 deletions app/src/components/login/SignUp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,17 @@ function Copyright() {

const useStyles = makeStyles(theme => ({
paper: {
// marginTop: theme.spacing(8),
display: 'flex',
flexDirection: 'column',
alignItems: 'center'
},
avatar: {
// margin: theme.spacing(1),
backgroundColor: '#3EC1AC'
},
form: {
width: '100%', // Fix IE 11 issue.
// marginTop: theme.spacing(3)
},
submit: {
// margin: theme.spacing(3, 0, 2)
},
root: {
'& .MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline': {
Expand Down
2 changes: 0 additions & 2 deletions app/src/components/main/AddLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,9 @@ function AddLink({ id, onClickHandler, linkDisplayed }) {
});
}


const pagesItems = state.components.filter(comp => state.rootComponents.includes(comp.id));
const dropDown = [<MenuItem style={{ color: '#000' }} disabled hidden selected>Pages</MenuItem>].concat(pagesItems.map(comp => <MenuItem style={{ color: '#000' }} value={comp.name}>{comp.name}</MenuItem>));


return (
<div style={{float: 'right'}}>
<FormControl variant='outlined' focused={true} style={ {width: '100%'} }>
Expand Down

0 comments on commit 30e92c4

Please sign in to comment.