Commit 1e8493f5 authored by Halvor Horge's avatar Halvor Horge

Merge branch 'backendDev' into 'master'

#4

See merge request !6
parents 479986c0 c64a87ac
......@@ -2,8 +2,8 @@
"devToolsPort": 19002,
"expoServerPort": 19000,
"packagerPort": 19001,
"packagerPid": 11012,
"expoServerNgrokUrl": "https://8h-zc8.hhorge.p4.exp.direct",
"packagerNgrokUrl": "https://packager.8h-zc8.hhorge.p4.exp.direct",
"ngrokPid": 8404
"packagerPid": 15348,
"expoServerNgrokUrl": "https://av-4mb.hhorge.p4.exp.direct",
"packagerNgrokUrl": "https://packager.av-4mb.hhorge.p4.exp.direct",
"ngrokPid": 18008
}
......@@ -3,6 +3,6 @@
"lanType": "ip",
"dev": true,
"minify": false,
"urlRandomness": "8h-zc8",
"urlRandomness": "av-4mb",
"https": false
}
......@@ -39,47 +39,35 @@ const Content = () => {
const stateGenre = useSelector(state => state.filter);
const { loading, error, data } = useQuery(GET_PRODUCTS, {
variables: { limit: 10, search: stateSearch, sort: "-price", filters:{filterType:"Vodka"}}
variables: { limit: 15, search: stateSearch, sort: "-price"}
});
if (loading) return <Text> Loading ... </Text>;
if (error) return <Text> {error} </Text>;
const productElements = data.products.products.map(product => (
<View key={product.id} style={{ display: "flex" }}>
<Elements
<ListItem
key={product.id}
leftAvatar={{ source: { uri: product.img } } }
title={product.name}
subtitle={product.price + " kr"}
bottomDivider
chevron
onPress={() => setOverlayState()}
/>
{/* <Elements
name={product.name}
img={product.img}
price={product.price}
alcohol={product.alcohol}
volume={product.volume}
type={product.type}
/>
/> */}
</View>
));
function filterAlbums(Albums) {
let filteredAlbums = [];
for (let a in Albums) {
if (
Albums[a]["Album"].toLowerCase().indexOf(stateSearch.toLowerCase()) !==
-1
) {
filteredAlbums.push(Albums[a]);
} else if (
Albums[a]["Artist"].toLowerCase().indexOf(stateSearch.toLowerCase()) !==
-1
) {
filteredAlbums.push(Albums[a]);
} else if (
Albums[a]["Year"].toLowerCase().indexOf(stateSearch.toLowerCase()) !==
-1
) {
filteredAlbums.push(Albums[a]);
}
}
return filteredAlbums;
}
function genreFilter(albums) {
let f = [];
for (let a in albums) {
......@@ -104,16 +92,6 @@ const Content = () => {
return (
<ScrollView>
{productElements}
{genreFilter(filterAlbums(stateAlbums)).map((l, i) => (
<ListItem
key={i}
title={l.title}
subtitle={l.subtitle}
bottomDivider
chevron
onPress={() => setOverlayState()}
/>
))}
<Details />
</ScrollView>
);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment