Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MC Semester Project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Thi Nguyen
MC Semester Project
Merge requests
!3
Cast sitter
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Cast sitter
feature/update-08.01
into
master
Overview
0
Commits
1
Pipelines
0
Changes
1
Merged
Thi Nguyen
requested to merge
feature/update-08.01
into
master
1 year ago
Overview
0
Commits
1
Pipelines
0
Changes
1
Expand
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
b7444f8f
1 commit,
1 year ago
1 file
+
79
−
21
Side-by-side
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
screens/tabs/Catsitter.js
+
79
−
21
Options
import
{
StyleSheet
,
Text
,
View
,
FlatList
}
from
"
react-native
"
;
import
{
Text
,
View
,
Dimensions
,
TouchableOpacity
,
Image
}
from
"
react-native
"
;
import
React
,
{
useState
,
useLayoutEffect
}
from
"
react
"
;
import
React
,
{
useState
,
useLayoutEffect
}
from
"
react
"
;
import
{
collection
,
query
,
onSnapshot
,
where
,
and
}
from
"
firebase/firestore
"
;
import
{
collection
,
query
,
onSnapshot
,
where
,
and
}
from
"
firebase/firestore
"
;
import
{
auth
,
database
}
from
"
../../config/firebase
"
;
import
{
database
}
from
"
../../config/firebase
"
;
import
styles
from
"
../../assets/styles
"
;
import
Icon
from
"
../../components/Icon
"
;
import
styles
,
{
DISLIKE_ACTIONS
,
LIKE_ACTIONS
,
WHITE
,
}
from
"
../../assets/styles
"
;
const
Catsitter
=
({
route
})
=>
{
const
Catsitter
=
({
route
})
=>
{
const
{
id
}
=
route
.
params
;
const
{
id
}
=
route
.
params
;
@@ -20,30 +26,82 @@ const Catsitter = ({ route }) => {
@@ -20,30 +26,82 @@ const Catsitter = ({ route }) => {
return
unsubscribe
;
return
unsubscribe
;
},
[]);
},
[]);
const
fullWidth
=
Dimensions
.
get
(
"
window
"
).
width
;
const
imageStyle
=
[
{
borderRadius
:
8
,
width
:
catsitter
.
hasVariant
?
fullWidth
/
2
-
30
:
fullWidth
-
80
,
height
:
catsitter
.
hasVariant
?
170
:
350
,
margin
:
catsitter
.
hasVariant
?
0
:
20
,
},
];
const
nameStyle
=
[
{
paddingTop
:
catsitter
.
hasVariant
?
10
:
15
,
paddingBottom
:
catsitter
.
hasVariant
?
5
:
7
,
color
:
"
#363636
"
,
fontSize
:
catsitter
.
hasVariant
?
15
:
30
,
},
];
return
(
return
(
<>
<
View
style
=
{{
borderRadius
:
8
,
alignItems
:
"
center
"
,
margin
:
10
,
elevation
:
1
,
padding
:
10
,
width
:
"
95%
"
,
display
:
"
flex
"
,
flexDirection
:
"
column
"
,
overflow
:
"
hidden
"
}}
>
{
/* IMAGE */
}
<
Image
source
=
{{
uri
:
catsitter
.
avatar
}}
style
=
{
imageStyle
}
/
>
{
/* MATCHES */
}
<
View
style
=
{
styles
.
matchesCardItem
}
>
<
Text
style
=
{
styles
.
matchesTextCardItem
}
>
<
Icon
name
=
"
heart
"
color
=
{
WHITE
}
size
=
{
13
}
/> {catsitter.availableTime
}
<
/Text
>
<
/View
>
<
Text
>
Cat
Sitter
Address
:
{
catsitter
.
address
}
<
/Text
>
<
Text
>
Cat
Sitter
Postal
Code
:{
catsitter
.
postalCode
}
<
/Text
>
{
/* NAME */
}
<
Text
style
=
{
nameStyle
}
>
{
catsitter
.
name
}
<
/Text
>
<
Text
>
Cat
Sitter
Age
:
{
catsitter
.
age
}
<
/Text
>
<
Text
>
Cat
Sitter
Price
Per
Night
:
{
catsitter
.
price
}
<
/Text
>
<
View
style
=
{
styles
.
containerFlatList
}
>
{
/* DESCRIPTION */
}
<
Text
style
=
{
styles
.
descriptionCardItem
}
>
{
catsitter
.
description
}
<
/Text
>
<
Text
>
Cat
Sitter
Name
:
{
catsitter
.
name
}
<
/Text
>
{
/* STATUS */
}
<
Text
>
Cat
Sitter
Address
:
{
catsitter
.
address
}
<
/Text
>
<
View
style
=
{
styles
.
status
}
>
<
Text
>
Cat
Sitter
Available
Time
:
{
catsitter
.
availableTime
}
<
/Text
>
<
View
style
=
{
catsitter
.
isOpen
?
styles
.
online
:
styles
.
offline
}
/
>
<
Text
>
Cat
Sitter
Postal
Code
:{
catsitter
.
postalCode
}
<
/Text
>
<
Text
style
=
{
styles
.
statusText
}
>
<
Text
>
Cat
Sitter
Age
:
{
catsitter
.
age
}
<
/Text
>
{
catsitter
.
isOpen
?
"
Online
"
:
"
Offline
"
}
<
Text
>
Cat
Sitter
Price
Per
Night
:
{
catsitter
.
price
}
<
/Text
>
<
/Text
>
<
Text
>
Cat
Sitter
Status
:
<
/View
>
{(()
=>
{
switch
(
catsitter
.
isOpen
)
{
case
true
:
return
"
Open
"
;
case
"
false
"
:
return
"
Closed
"
;
default
:
return
"
Closed
"
;
}
})()}
<
/Text
>
<
Text
>
Cat
Sitter
Information
:
{
catsitter
.
description
}
<
/Text
>
{
/* ACTIONS */
}
<
View
style
=
{
styles
.
actionsCardItem
}
>
<
TouchableOpacity
style
=
{
styles
.
button
}
>
<
Icon
name
=
"
mail
"
color
=
{
LIKE_ACTIONS
}
size
=
{
25
}
/
>
<
/TouchableOpacity
>
<
TouchableOpacity
style
=
{
styles
.
button
}
>
<
Icon
name
=
"
close
"
color
=
{
DISLIKE_ACTIONS
}
size
=
{
25
}
/
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
<
/View
>
<
/
>
);
);
};
};
Loading