Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
map_UT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
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
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
Anael Lacour
map_UT
Commits
a484f74c
Commit
a484f74c
authored
2 years ago
by
Aline Zhang
Browse files
Options
Downloads
Patches
Plain Diff
new grid
parent
4f84c090
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
frontend/src/pages/newPlace/newPlace.js
+54
-20
54 additions, 20 deletions
frontend/src/pages/newPlace/newPlace.js
with
54 additions
and
20 deletions
frontend/src/pages/newPlace/newPlace.js
+
54
−
20
View file @
a484f74c
...
...
@@ -2,9 +2,10 @@ import { useEffect, useMemo, useReducer, useState } from "react";
import
{
TextInput
,
View
,
Text
,
StyleSheet
,
Dimensions
,
ScrollView
,
TouchableOpacity
,
CheckBox
,
SectionList
}
from
"
react-native
"
;
import
{
baseIPAddress
,
newPlacePath
}
from
"
../../../constants/server
"
;
import
{
SelectInput
}
from
"
../../components/form/select
"
;
import
{
Grid
,
TextField
}
from
"
@mui/material
"
;
export
default
function
NewPlace
()
{
{
const
cityList
=
[
"
Compiègne
"
,
"
Margny
"
,
"
Venette
"
]
const
typeList
=
[
"
Maison
"
,
"
Appartement
"
,
"
Studio
"
]
const
equipmentList
=
[
"
wifi
"
,
"
canap
"
]
...
...
@@ -61,7 +62,7 @@ export default function NewPlace()
}
const
style
=
StyleSheet
.
create
({
input
:
{
borderBottomWidth
:
1
,
...
...
@@ -74,30 +75,63 @@ export default function NewPlace()
fontWeight
:
"
bold
"
,
marginTop
:
25
,
marginBottom
:
15
},
grid
:
{
marginLeft
:
20
,
alignItems
:
'
center
'
,
justifyContent
:
'
center
'
,
display
:
'
flex
'
}
})
return
(
<
View
style
=
{{
marginTop
:
20
,
backgroundColor
:
"
white
"
,
height
:
"
100%
"
}}
>
{
errorText
!=
""
?
<
Text
>
{
errorText
}
<
/Text> : null
}
<
ScrollView
style
=
{{
marginLeft
:
20
,
marginBottom
:
20
}}
>
<
Text
style
=
{
style
.
titles
}
>
Adresse
<
/Text
>
<
TextInput
style
=
{
style
.
input
}
onChangeText
=
{
setaddress
}
value
=
{
address
}
placeholder
=
"
Adresse
"
/>
<
TextInput
style
=
{
style
.
input
}
onChangeText
=
{
setcomp
}
value
=
{
comp
}
placeholder
=
"
Complément
"
/>
<
SelectInput
style
=
{{
fontSize
:
style
.
input
.
fontSize
,
marginTop
:
10
,
marginBottom
:
10
}}
SetIsMain
=
{
setIsMainCity
}
useOther
=
{
true
}
onChangeText
=
{
setcity
}
value
=
{
city
}
list
=
{
cityList
}
/
>
{
isMainCity
?
<
TextInput
style
=
{
style
.
input
}
onChangeText
=
{
setcity
}
value
=
{
city
}
/> : null
}
<
Text
style
=
{
style
.
titles
}
>
Nom
<
/Text
>
<
TextInput
style
=
{
style
.
input
}
onChangeText
=
{
setname
}
value
=
{
name
}
placeholder
=
"
Nom
"
/>
<
Text
style
=
{
style
.
titles
}
>
Places
restantes
<
/Text
>
<
TextInput
style
=
{
style
.
input
}
onChangeText
=
{
setplacesRestantes
}
value
=
{
placesRestantes
}
placeholder
=
"
Places restantes
"
/>
<
Text
style
=
{
style
.
titles
}
>
Prix
<
/Text
>
<
TextInput
style
=
{
style
.
input
}
onChangeText
=
{
setprix
}
value
=
{
prix
}
placeholder
=
"
Prix
"
/>
<
Text
style
=
{
style
.
titles
}
>
Type
de
logement
<
/Text
>
<
SelectInput
style
=
{{
fontSize
:
style
.
input
.
fontSize
,
marginTop
:
10
,
marginBottom
:
10
}}
SetIsMain
=
{
setIsMainType
}
useOther
=
{
true
}
onChangeText
=
{
settype
}
value
=
{
type
}
list
=
{
typeList
}
/
>
{
isMainType
?
<
TextInput
style
=
{{...
style
.
input
,
marginBottom
:
25
}}
onChangeText
=
{
settype
}
value
=
{
type
}
/> : null
}
<
TouchableOpacity
style
=
{{
borderRadius
:
1
,
backgroundColor
:
"
black
"
,
padding
:
10
,
width
:
180
}}
onPress
=
{
createPlace
}
>
<
Grid
item
style
=
{{
marginLeft
:
20
}}
container
spacing
=
{
1
}
>
<
Text
style
=
{
style
.
titles
}
>
Adresse
<
/Text
>
<
/Grid
>
<
Grid
item
style
=
{{
marginLeft
:
20
}}
container
spacing
=
{
1
}
>
<
TextField
required
id
=
{
address
}
placeholder
=
"
Adresse
"
onChangeText
=
{
setaddress
}
/
>
<
TextField
style
=
{{
marginLeft
:
3
}}
onChangeText
=
{
setcomp
}
id
=
{
comp
}
placeholder
=
"
Complément
"
/>
<
/Grid
>
<
Grid
item
style
=
{{
marginLeft
:
20
}}
>
<
SelectInput
style
=
{{
fontSize
:
style
.
input
.
fontSize
,
marginTop
:
10
,
marginBottom
:
10
}}
SetIsMain
=
{
setIsMainCity
}
useOther
=
{
true
}
onChangeText
=
{
setcity
}
value
=
{
city
}
list
=
{
cityList
}
/
>
{
isMainCity
?
<
TextField
placeholder
=
"
Autre
"
onChangeText
=
{
setcity
}
id
=
{
city
}
/> : null
}
<
/Grid
>
<
Grid
item
style
=
{{
marginLeft
:
20
,
marginTop
:
10
}}
>
<
Text
style
=
{
style
.
titles
}
>
Nom
<
/Text
>
<
/Grid
>
<
Grid
item
style
=
{{
marginLeft
:
20
}}
>
<
TextField
required
onChangeText
=
{
setname
}
id
=
{
name
}
placeholder
=
"
Nom
"
/>
<
/Grid
>
<
Grid
item
style
=
{{
marginLeft
:
20
,
marginTop
:
10
}}
>
<
Text
style
=
{
style
.
titles
}
>
Places
restantes
<
/Text
>
<
/Grid
>
<
Grid
item
style
=
{{
marginLeft
:
20
}}
>
<
TextField
required
onChangeText
=
{
setplacesRestantes
}
id
=
{
placesRestantes
}
placeholder
=
"
Places restantes
"
/>
<
/Grid
>
<
Grid
item
style
=
{{
marginLeft
:
20
,
marginTop
:
10
}}
>
<
Text
style
=
{
style
.
titles
}
>
Prix
<
/Text
>
<
/Grid
>
<
Grid
item
style
=
{{
marginLeft
:
20
}}
>
<
TextField
required
onChangeText
=
{
setprix
}
id
=
{
prix
}
placeholder
=
"
Prix
"
/>
<
/Grid
>
<
Grid
item
style
=
{{
marginLeft
:
20
,
marginTop
:
10
}}
>
<
Text
style
=
{
style
.
titles
}
>
Type
de
logement
<
/Text
>
<
/Grid
>
<
Grid
item
style
=
{{
marginLeft
:
20
}}
>
<
SelectInput
style
=
{{
fontSize
:
style
.
input
.
fontSize
,
marginTop
:
10
,
marginBottom
:
10
}}
SetIsMain
=
{
setIsMainType
}
useOther
=
{
true
}
onChangeText
=
{
settype
}
value
=
{
type
}
list
=
{
typeList
}
/
>
{
isMainType
?
<
TextField
style
=
{{...
style
.
input
,
marginBottom
:
25
}}
placeholder
=
"
Autre
"
onChangeText
=
{
settype
}
value
=
{
type
}
/> : null
}
<
/Grid
>
<
Grid
>
<
TouchableOpacity
style
=
{{
borderRadius
:
1
,
backgroundColor
:
"
black
"
,
padding
:
10
,
width
:
180
}}
onPress
=
{
createPlace
}
>
<
Text
style
=
{{
fontSize
:
16
,
color
:
"
white
"
,
fontWeight
:
"
bold
"
,
textAlign
:
"
center
"
}}
>
Ajouter
le
logement
<
/Text
>
<
/TouchableOpacity
>
<
/TouchableOpacity
>
<
/Grid
>
<
View
>
{
equipmentList
.
map
(
item
=>
{
return
(
...
...
@@ -130,4 +164,4 @@ function reducingUpdate(state, action)
{
state
[
action
.
item
]
=
action
.
value
return
state
}
\ No newline at end of file
}
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