Skip to content
Snippets Groups Projects
Commit 1b51bb87 authored by Raul Almeida's avatar Raul Almeida
Browse files

WIP more adjustments to item store

Detailed information on reports
parent 49545645
Branches
No related tags found
1 merge request!21Gamification
......@@ -31,7 +31,7 @@ import DialogContent from '@material-ui/core/DialogContent';
import DialogContentText from '@material-ui/core/DialogContentText';
import DialogTitle from '@material-ui/core/DialogTitle';
import axios from 'axios'
import {apiUrl} from '../../env';
import {apiUrl} from '../env';
function Alert(props) {
return <MuiAlert elevation={6} variant="filled" {...props} />;
......@@ -83,7 +83,7 @@ export default function ItemCardAction (props) {
const revertLastOperation = () => {
manageItemAndShowSnackbar(last_operation == 'equip' ? 'unequip' : 'equip',
setInfo,
nonPurchaseMessage;
nonPurchaseMessage,
'Erro');
}
......
......@@ -127,7 +127,7 @@ export default function MenuBar(props){
<a href="http://educacaoconectada.mec.gov.br/" rel="noopener noreferrer" target="_blank" >
<ButtonStyled >Educação Conectada</ButtonStyled>
</a>
<a href="/store">
<a href="/loja">
<ButtonStyled>Lojinha</ButtonStyled>
</a>
<ButtonStyled onClick={props.openSearchBar} ><IconSearchStyled />Buscar</ButtonStyled>
......
......@@ -27,7 +27,7 @@ export default function TabPanelStatusEConquistas (props) {
axios.all(
['xp_to_next_lvl', 'percent_to_next_level', 'points', 'xp', 'get_level',
'completed_achievements'].map((r) => {
return axios.get(apiUrl + '/' r + '?id=' + state.currentUser.id);
return axios.get(apiUrl + '/' + r + '?id=' + state.currentUser.id);
})).then(axios.spread((xp_to_next_lvl, percent_to_next_level, points,
xp, level, completed_achievements) => {
this.setXpToNextLevel(xp_to_next_lvl);
......
......@@ -53,30 +53,17 @@ export default function ItemStoreContainer (props) {
useEffect(() => {
axios.all(
['avatar_frame', 'card_frame', 'cover_frame', 'badge'].map((r) => {
return axios.get(apiUrl + '/' + 'user_items/index?q={"item_type":'
+ r + ', "op": "none", "unlock_rule": "purchase"}');
return axios.get(apiUrl+'/' + 'user_items/index?item_type='+r+'&unlock_rule=purchase');
})).then(axios.spread((avatar, card, cover, badge) => {
console.log([avatar, card, cover, badge]);
//setAvatarFrames(avatar);
//setCardFrames(card);
//setCoverFrames(cover);
//setBadges(badge);
setAvatarFrames(avatar);
setCardFrames(card);
setCoverFrames(cover);
setBadges(badge);
}));
}, [])
var items = [
{
src: "https://upload.wikimedia.org/wikipedia/en/9/90/The_DuckDuckGo_Duck.png",
action: "buy",
name: "Avatar um",
description: "Descrição | Descrição"
}
];
for (let i = 0; i < 10; i++)
items = items.concat(items[0]);
return (
<Container style={{paddingTop : "2em", backgroundColor : "#f4f4f4"}}>
<Container style={{paddingTop : "2em", backgroundColor : "#f4f4f4", width: '100%'}}>
<Grid container
direction="row"
justify="space-around"
......@@ -92,25 +79,25 @@ export default function ItemStoreContainer (props) {
<StoreSection>
<SectionTitle>Bordas de avatar</SectionTitle>
<StoreDivider/>
<ItemCarousel items={items}/>
<ItemCarousel items={avatar_frames}/>
</StoreSection>
<StoreSection>
<SectionTitle>Insígnias</SectionTitle>
<StoreDivider/>
<ItemCarousel items={items}/>
<ItemCarousel items={badges}/>
</StoreSection>
<StoreSection>
<SectionTitle>Bordas de card</SectionTitle>
<StoreDivider/>
<ItemCarousel items={items}/>
<ItemCarousel items={card_frames}/>
</StoreSection>
<StoreSection>
<SectionTitle>Bordas de capa de perfil</SectionTitle>
<StoreDivider/>
<ItemCarousel items={items}/>
<ItemCarousel items={cover_frames}/>
</StoreSection>
</Container>
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment