Skip to content
Snippets Groups Projects
Commit 9162bb17 authored by Lucas Eduardo Schoenfelder's avatar Lucas Eduardo Schoenfelder
Browse files

adicionado trabalho dos ultimos dias. checar o retorno das rotas no card de...

adicionado trabalho dos ultimos dias. checar o retorno das rotas no card de contato (testei agora e nao estavam funcionando)
parent fe4ff462
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +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, { useState } from 'react';
import React, { useState, useContext } from 'react';
import {Store} from '../Store.js'
import Card from '@material-ui/core/Card';
import CardContent from '@material-ui/core/CardContent';
import noAvatar from "../img/default_profile.png";
......@@ -27,11 +28,16 @@ import FollowButton from './ContactButtons/FollowButton.js'
import FollowingButton from './ContactButtons/FollowingButton.js'
import FollowersCountButton from './ContactButtons/FollowersCountButton.js'
import { Link } from 'react-router-dom';
import CircularProgress from '@material-ui/core/CircularProgress';
import Rubi from '../img/rubi.png';
export default function ImgMediaCard(props) {
const {state} = useContext(Store)
const [followedBoolean, setFollowedBoolean] = useState(props.followed)
const toggleFollowed = () => { setFollowedBoolean(!followedBoolean) }
function isOnStore () {
return (window.location.href.includes("loja"))
}
return (
<StyledCard>
<CardDiv>
......@@ -67,7 +73,24 @@ export default function ImgMediaCard(props) {
<b>{props.numCollections}</b> {props.numCollections !== 1 ? "Coleções" : "Coleção"} | <b>{props.numLearningObjects}</b> {props.numLearningObjects !== 1 ? "Recursos" : "Recurso"}
</span>
</Link>
{
isOnStore() ?
(
<div style={{display : "flex", flexDirection : "row", justifyContent : "space-around", padding : "20px"}}>
<span style={{display : "flex"}}>
Nível
<div style={{borderRadius : "50%", background : "lightgrey", border : "4px solid gray", height : "25px", width : "25px", marginLeft : "10px"}}>
{state.currentUser.level}
</div>
</span>
<div style={{borderLeft : "1px solid lightgrey"}}/>
<img src={Rubi} alt="gemas-icon" style={{maxHeight : "25px"}}/>
<span > {state.currentUser.coins} gemas</span>
</div>
)
:
(
<div style={{ display: "flex", justifyContent: "center" }}>
{
followedBoolean ?
......@@ -97,8 +120,10 @@ export default function ImgMediaCard(props) {
</React.Fragment>
)
}
</div>
)
}
</UserInfo>
</CardContent>
</CardAreaDiv>
......
......@@ -73,16 +73,12 @@ export default function ItemStoreContainer(props) {
// }, [])
useEffect(() => {
// axios.get((`${apiUrl}/users/` + state.currentUser.id))
// .then((response) => {
// setCurrUser(response.data);
// setIsLoading(false);
// },
// (error) => {
// console.log(error);
// setIsLoading(false);
// }
// )
getRequest("/users/238", (data) => {
setCurrUser(data);
setIsLoading(false)
}, (error) => {
console.log(error);
})
getRequest("/items", (data) => {
console.log(data)
setBadges(data.filter(item => item.item_type === "badge"))
......
src/img/rubi.png

7.09 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment