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
Commits
18840982
Commit
18840982
authored
1 year ago
by
Thi Nguyen
Browse files
Options
Downloads
Plain Diff
Merge branch 'feature/update-08.01' into 'master'
Cast sitter See merge request
!3
parents
f261dd08
b7444f8f
No related branches found
Branches containing commit
No related tags found
2 merge requests
!3
Cast sitter
,
!2
Draft: Master
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
screens/tabs/Catsitter.js
+79
-21
79 additions, 21 deletions
screens/tabs/Catsitter.js
with
79 additions
and
21 deletions
screens/tabs/Catsitter.js
+
79
−
21
View file @
18840982
import
{
StyleSheet
,
Text
,
View
,
FlatList
}
from
"
react-native
"
;
import
{
Text
,
View
,
Dimensions
,
TouchableOpacity
,
Image
}
from
"
react-native
"
;
import
React
,
{
useState
,
useLayoutEffect
}
from
"
react
"
;
import
{
collection
,
query
,
onSnapshot
,
where
,
and
}
from
"
firebase/firestore
"
;
import
{
auth
,
database
}
from
"
../../config/firebase
"
;
import
styles
from
"
../../assets/styles
"
;
import
{
database
}
from
"
../../config/firebase
"
;
import
Icon
from
"
../../components/Icon
"
;
import
styles
,
{
DISLIKE_ACTIONS
,
LIKE_ACTIONS
,
WHITE
,
}
from
"
../../assets/styles
"
;
const
Catsitter
=
({
route
})
=>
{
const
{
id
}
=
route
.
params
;
...
...
@@ -20,30 +26,82 @@ const Catsitter = ({ route }) => {
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
(
<>
<
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
>
<
Text
>
Cat
Sitter
Address
:
{
catsitter
.
address
}
<
/Text
>
<
Text
>
Cat
Sitter
Available
Time
:
{
catsitter
.
availableTime
}
<
/Text
>
<
Text
>
Cat
Sitter
Postal
Code
:{
catsitter
.
postalCode
}
<
/Text
>
<
Text
>
Cat
Sitter
Age
:
{
catsitter
.
age
}
<
/Text
>
<
Text
>
Cat
Sitter
Price
Per
Night
:
{
catsitter
.
price
}
<
/Text
>
<
Text
>
Cat
Sitter
Status
:
{(()
=>
{
switch
(
catsitter
.
isOpen
)
{
case
true
:
return
"
Open
"
;
case
"
false
"
:
return
"
Closed
"
;
default
:
return
"
Closed
"
;
}
})()}
<
/Text
>
<
Text
>
Cat
Sitter
Information
:
{
catsitter
.
description
}
<
/Text
>
{
/* STATUS */
}
<
View
style
=
{
styles
.
status
}
>
<
View
style
=
{
catsitter
.
isOpen
?
styles
.
online
:
styles
.
offline
}
/
>
<
Text
style
=
{
styles
.
statusText
}
>
{
catsitter
.
isOpen
?
"
Online
"
:
"
Offline
"
}
<
/Text
>
<
/View
>
{
/* 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
>
<
/
>
);
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment