Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Project4
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
IT2810-H19
T
Teams
Team 8
Project4
Commits
698eb748
Commit
698eb748
authored
Nov 13, 2019
by
Adrian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#3
Added info in overlay
parent
1e8493f5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
87 additions
and
22 deletions
+87
-22
p4/.expo/packager-info.json
p4/.expo/packager-info.json
+4
-4
p4/src/components/Content.js
p4/src/components/Content.js
+6
-16
p4/src/components/Details.js
p4/src/components/Details.js
+77
-2
No files found.
p4/.expo/packager-info.json
View file @
698eb748
...
@@ -2,8 +2,8 @@
...
@@ -2,8 +2,8 @@
"devToolsPort"
:
19002
,
"devToolsPort"
:
19002
,
"expoServerPort"
:
19000
,
"expoServerPort"
:
19000
,
"packagerPort"
:
19001
,
"packagerPort"
:
19001
,
"packagerPid"
:
15
348
,
"packagerPid"
:
15
960
,
"expoServerNgrokUrl"
:
"https://av-4mb.
hhorge
.p4.exp.direct"
,
"expoServerNgrokUrl"
:
"https://av-4mb.
anonymous
.p4.exp.direct"
,
"packagerNgrokUrl"
:
"https://packager.av-4mb.
hhorge
.p4.exp.direct"
,
"packagerNgrokUrl"
:
"https://packager.av-4mb.
anonymous
.p4.exp.direct"
,
"ngrokPid"
:
18008
"ngrokPid"
:
6856
}
}
p4/src/components/Content.js
View file @
698eb748
...
@@ -27,6 +27,9 @@ const GET_PRODUCTS = gql`
...
@@ -27,6 +27,9 @@ const GET_PRODUCTS = gql`
alcohol
alcohol
volume
volume
type
type
country
district
pricePerLiter
}
}
}
}
}
}
...
@@ -34,7 +37,6 @@ const GET_PRODUCTS = gql`
...
@@ -34,7 +37,6 @@ const GET_PRODUCTS = gql`
const
Content
=
()
=>
{
const
Content
=
()
=>
{
const
dispatch
=
useDispatch
();
const
dispatch
=
useDispatch
();
const
stateAlbums
=
useSelector
(
state
=>
state
.
albums
);
const
stateSearch
=
useSelector
(
state
=>
state
.
search
);
const
stateSearch
=
useSelector
(
state
=>
state
.
search
);
const
stateGenre
=
useSelector
(
state
=>
state
.
filter
);
const
stateGenre
=
useSelector
(
state
=>
state
.
filter
);
...
@@ -53,18 +55,8 @@ const Content = () => {
...
@@ -53,18 +55,8 @@ const Content = () => {
subtitle
=
{
product
.
price
+
"
kr
"
}
subtitle
=
{
product
.
price
+
"
kr
"
}
bottomDivider
bottomDivider
chevron
chevron
onPress
=
{()
=>
setOverlayState
()}
onPress
=
{()
=>
setOverlayState
(
product
)}
/
>
/
>
{
/* <Elements
name={product.name}
img={product.img}
price={product.price}
alcohol={product.alcohol}
volume={product.volume}
type={product.type}
/> */
}
<
/View
>
<
/View
>
));
));
...
@@ -81,12 +73,10 @@ const Content = () => {
...
@@ -81,12 +73,10 @@ const Content = () => {
return
f
;
return
f
;
}
}
function
setDetailState
(
album
)
{
dispatch
(
details
(
album
));
}
function
setOverlayState
()
{
function
setOverlayState
(
d
)
{
dispatch
(
isOverlayVisible
());
dispatch
(
isOverlayVisible
());
dispatch
(
details
(
d
));
}
}
return
(
return
(
...
...
p4/src/components/Details.js
View file @
698eb748
...
@@ -3,12 +3,13 @@ import { Overlay } from 'react-native-elements';
...
@@ -3,12 +3,13 @@ import { Overlay } from 'react-native-elements';
import
{
useSelector
}
from
"
react-redux
"
;
import
{
useSelector
}
from
"
react-redux
"
;
import
{
useDispatch
}
from
"
react-redux
"
;
import
{
useDispatch
}
from
"
react-redux
"
;
import
{
isOverlayVisible
}
from
"
../actions
"
;
import
{
isOverlayVisible
}
from
"
../actions
"
;
import
{
Text
}
from
'
react-native
'
;
import
{
Text
,
View
,
Image
,
StyleSheet
}
from
'
react-native
'
const
Details
=
()
=>
{
const
Details
=
()
=>
{
const
stateOverlay
=
useSelector
(
state
=>
state
.
overlay
);
const
stateOverlay
=
useSelector
(
state
=>
state
.
overlay
);
const
details
=
useSelector
(
state
=>
state
.
details
)
const
dispatch
=
useDispatch
();
const
dispatch
=
useDispatch
();
return
(
return
(
...
@@ -16,9 +17,83 @@ const Details = () => {
...
@@ -16,9 +17,83 @@ const Details = () => {
isVisible
=
{
stateOverlay
}
isVisible
=
{
stateOverlay
}
onBackdropPress
=
{()
=>
dispatch
(
isOverlayVisible
())}
onBackdropPress
=
{()
=>
dispatch
(
isOverlayVisible
())}
>
>
<
Text
>
Hello
from
Overlay
!<
/Text
>
<
View
style
=
{
styles
.
container
}
>
<
Text
style
=
{
styles
.
name
}
>
{
details
.
name
}
<
/Text
>
<
Image
style
=
{
styles
.
image
}
source
=
{{
uri
:
details
.
img
}}
/
>
<
Text
style
=
{
styles
.
price
}
>
Kr
.
{
details
.
price
}
<
/Text
>
<
Text
style
=
{
styles
.
type
}
>
{
details
.
type
}
<
/Text
>
<
View
style
=
{
styles
.
info
}
>
<
Text
style
=
{
styles
.
alcohol
}
>
Alcohol
:
<
Text
style
=
{
styles
.
elements
}
>
{
details
.
alcohol
}
%
<
/Text></
Text
>
<
Text
style
=
{
styles
.
volume
}
>
Volume
:
<
Text
style
=
{
styles
.
elements
}
>
{
details
.
volume
}
<
/Text></
Text
>
<
/View
>
<
View
style
=
{
styles
.
info
}
>
<
Text
style
=
{
styles
.
country
}
>
Country
:
<
Text
style
=
{
styles
.
elements
}
>
{
details
.
country
}
<
/Text></
Text
>
<
Text
style
=
{
styles
.
district
}
>
District
:
<
Text
style
=
{
styles
.
elements
}
>
{
details
.
district
}
<
/Text></
Text
>
<
/View
>
<
Text
style
=
{
styles
.
pricePL
}
>
Price
per
liter
:
<
Text
style
=
{
styles
.
elements
}
>
Kr
.{
details
.
pricePerLiter
}
<
/Text></
Text
>
<
/View
>
<
/Overlay
>
<
/Overlay
>
);
);
}
}
const
styles
=
StyleSheet
.
create
({
container
:
{
margin
:
10
,
marginTop
:
10
,
alignItems
:
'
center
'
,
flexWrap
:
'
wrap
'
,
flexDirection
:
'
column
'
,
},
name
:
{
fontSize
:
20
,
textAlign
:
'
center
'
,
margin
:
10
,
},
price
:
{
marginTop
:
5
,
fontWeight
:
'
bold
'
,
fontSize
:
17
,
},
info
:
{
padding
:
10
,
flexDirection
:
'
row
'
,
flexWrap
:
'
wrap
'
},
alcohol
:
{
width
:
"
60%
"
,
paddingLeft
:
5
},
volume
:
{
width
:
"
40%
"
,
paddingRight
:
5
},
country
:
{
width
:
"
60%
"
,
paddingLeft
:
5
},
district
:
{
width
:
"
40%
"
,
paddingRight
:
5
},
type
:
{
borderBottomWidth
:
1
,
borderBottomColor
:
'
black
'
,
width
:
"
90%
"
,
textAlign
:
"
center
"
,
paddingBottom
:
15
,
paddingTop
:
5
,
marginBottom
:
20
},
image
:
{
resizeMode
:
"
contain
"
,
height
:
200
,
width
:
100
,
justifyContent
:
'
center
'
},
elements
:
{
fontWeight
:
'
bold
'
},
pricePL
:
{
padding
:
5
}
});
export
default
Details
;
export
default
Details
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment