Skip to content
Snippets Groups Projects
Commit 1ea30c07 authored by lfr20's avatar lfr20
Browse files

fix bugs

parent 40571407
No related branches found
No related tags found
4 merge requests!100Changed recaptcha key to the production one, removed console.logs and fixed...,!99Changed recaptcha key to the production one, removed console.logs and fixed...,!98Changed recaptcha key to the production one, removed console.logs and fixed...,!86Acessibility
......@@ -222,6 +222,46 @@ export default function CollectionCardFunction(props) {
<div className="Text" style={{ width: "100%" }}>
{SlideAnimationContent(props.contrast)}
</div>
</div>
}
</Header>
</Link>
<Description className={`${props.contrast}BackColor`}> {/*renders rating, number of learning objects and likes count*/}
{
props.authorID !== state.currentUser.id &&
<Rating
style={props.contrast === "" ? {} : {color: "white"}}
name="customized-empty"
value={props.rating}
readOnly
emptyIcon={<StarBorderIcon className={`${props.contrast}Text`} fontSize="inherit" />}
/>
}
<Footer className={`${props.contrast}Text`}>
<Type>
<FolderIcon style={props.contrast === "" ? {} : {color: "white"}} />
<span style={{ fontWeight: "bold" }}>{props.collections ? props.collections.length : 0} </span>
<span>{props.collections ? props.collections.length !== 1 ? "Recursos" : "Recurso" : 0}</span>
</Type>
<LikeCounter>
<span>{likesCount}</span>
<ButtonNoWidth onClick={handleLike}>
<FavoriteIcon className={`${props.contrast}LinkColor`} style={ props.contrast === "" ? {color: liked ? "red" : "#666"} : {color: liked ? "red" : "white"} } />
</ButtonNoWidth>
</LikeCounter>
</Footer>
</Description>
</CardReaDiv>
{
props.authorID === state.currentUser.id ?
(
<CardReaFooter className={`${props.contrast}BackColor`} style={{ justifyContent: "space-between" }}> {/*renders following/unfollow and follow button*/}
<Grid container>
<Grid item xs={6} style={{ display: "flex", justifyContent: "center" }}>
{
privacy === 'private' &&
<LockIcon className={`${props.contrast}IconColor`} />
......
......@@ -29,7 +29,7 @@ import ReportIcon from '@material-ui/icons/Error';
import PersonAddIcon from '@material-ui/icons/PersonAdd';
import { putRequest } from './HelperFunctions/getAxiosConfig'
import ReportModal from './ReportModal.js'
import { useHistory } from 'react-router-dom'
import {Link} from 'react-router-dom'
import LoginModal from './LoginModal.js'
import Snackbar from '@material-ui/core/Snackbar';
import SignUpModal from './SignUpModal'
......@@ -40,7 +40,6 @@ function Alert(props) {
}
export default function SimpleMenu(props) {
const history = useHistory();
const {state} = useContext(Store)
const [anchorEl, setAnchorEl] = React.useState(null);
const [loginOpen, setLogin] = useState(false)
......@@ -158,41 +157,6 @@ export default function SimpleMenu(props) {
<StyledMenuItem className={`${props.contrast}LinkColor ${props.contrast}Text`} contrast={props.contrast} onClick={() => {handleLogin(true)}}>
<ListItemIcon className={`${props.contrast}IconColor`}><ReportIcon /></ListItemIcon>Reportar
</StyledMenuItem>
{
props.followed ?
(
<StyledMenuItem contrast={state.contrast} onClick={() => { handleFollow(props.followableID) }}>
<ListItemIcon><ReportIcon /></ListItemIcon>Deixar de Seguir
</StyledMenuItem>
)
:
(
state.currentUser.id !== '' ? (
<StyledMenuItem contrast={state.contrast} onClick={() => { handleFollow(props.followableID) }}>
<ListItemIcon><PersonAddIcon /></ListItemIcon>Seguir
</StyledMenuItem>
)
:
(
<StyledMenuItem contrast={state.contrast} onClick={() => { handleLogin(props.followableID) }}>
<ListItemIcon><PersonAddIcon /></ListItemIcon>Seguir
</StyledMenuItem>
)
)
}
{
state.currentUser.id !== '' ? (
<StyledMenuItem contrast={state.contrast} onClick={() => { handleModal(true); handleClose() }}>
<ListItemIcon><ReportIcon /></ListItemIcon>Reportar
</StyledMenuItem>
)
:
(
<StyledMenuItem contrast={state.contrast} onClick={() => { handleLogin(true) }}>
<ListItemIcon><ReportIcon /></ListItemIcon>Reportar
</StyledMenuItem>
)
}
</Menu>
......@@ -207,7 +171,8 @@ const ButtonNoWidth = styled(Button)`
min-width : 24px !important;
max-height : 24px !important;
padding : 0 !important;
background-color: ${props => props.contrast === "" ? "#fff" : "black"};
background-color : #fff !important;
color : #a5a5a5 !important;
border : 0 !important;
.MuiButton-root {
......@@ -218,7 +183,6 @@ const ButtonNoWidth = styled(Button)`
.MuiSvgIcon-root {
padding-right : 0 !important;
vertical-align : middle;
color: ${props => props.contrast === "" ? "#a5a5a5 !important" : "yellow"};
}
.MuiButton-label {
......@@ -230,12 +194,8 @@ const StyledMenuItem = styled(MenuItem)`
background-color: ${props => props.contrast === "" ? "white" : "black"} !important;
.MuiSvgIcon-root {
vertical-align : middle !important;
color: ${props => props.contrast === "" ? "inherit" : "white"} !important;
}
a {
color: ${props => props.contrast === "" ? "inherit" : "yellow"} !important;
text-decoration: ${props => props.contrast === "" ? "none" : "underline"} !important;
color : inherit !important;
}
color: ${props => props.contrast === "" ? "inherit" : "yellow"} !important;
text-decoration: ${props => props.contrast === "" ? "none" : "underline"} !important;
`
\ No newline at end of file
......@@ -40,23 +40,6 @@ const dividerStyled = {
margin: '0 20px'
}
const useStyles = makeStyles(theme => ({
darkTextField: {
maxWidth: "100%",
fontSize: "15px",
fontWeight: "lighter",
color: "white",
width: "100%"
},
lightTextField: {
maxWidth: "100%",
fontSize: "15px",
fontWeight: "lighter",
color: "black",
width: "100%"
}
}));
const DividerVertical = () => <em style={dividerStyled}></em>
const ButtonStyled = styled(Button)`
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment