diff --git a/src/Components/CollectionCardFunction.js b/src/Components/CollectionCardFunction.js index 21caf2bd1b53f295f53eea0a5603d9fab3d24df0..5e496574bcd0a3a1ef280c27a986e0c0b63b2f69 100644 --- a/src/Components/CollectionCardFunction.js +++ b/src/Components/CollectionCardFunction.js @@ -172,7 +172,7 @@ export default function CollectionCardFunction(props) { function toggleLoginSnackbar(reason) { if (reason === 'clickaway') { - return; + return; } handleSuccessfulLogin(false); } @@ -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`} /> @@ -414,4 +454,4 @@ const FollowingButton = styled(Button)` white-space : nowrap !important; font-weight: 500; -` +` \ No newline at end of file diff --git a/src/Components/ContactCardOptions.js b/src/Components/ContactCardOptions.js index 84fc512edfd3a667ca63ec75b43684d7efb0d630..5831b386698c2fcea44b612fffcaaf4e08253355 100644 --- a/src/Components/ContactCardOptions.js +++ b/src/Components/ContactCardOptions.js @@ -16,8 +16,8 @@ GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with Plataforma Integrada MEC. If not, see <http://www.gnu.org/licenses/>.*/ -import React, { useContext, useState } from 'react'; -import { Store } from '../Store' +import React, {useContext, useState} from 'react'; +import {Store} from '../Store' import styled from 'styled-components' import Button from '@material-ui/core/Button'; import Menu from '@material-ui/core/Menu'; @@ -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,8 +40,7 @@ function Alert(props) { } export default function SimpleMenu(props) { - const history = useHistory(); - const { state } = useContext(Store) + const {state} = useContext(Store) const [anchorEl, setAnchorEl] = React.useState(null); const [loginOpen, setLogin] = useState(false) const [successfulLoginOpen, handleSuccessfulLogin] = useState(false) @@ -59,8 +58,8 @@ export default function SimpleMenu(props) { if (reason === 'clickaway') { return; } - - handleSuccessfulLogin(false); + + handleSuccessfulLogin(false); } function handleClick(event) { @@ -158,48 +157,13 @@ 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> - </div> - </> - </React.Fragment > - ); + ) + } + </Menu> + </div> + </> + </React.Fragment> + ); } const ButtonNoWidth = styled(Button)` @@ -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 diff --git a/src/Components/SearchBar.js b/src/Components/SearchBar.js index adc31726ba6eb71b1add5a632d8fd937dbee9977..be81cfa490acb38f26f6783ef394c0caad6b31c1 100644 --- a/src/Components/SearchBar.js +++ b/src/Components/SearchBar.js @@ -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)`