Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
T
tripsent
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
4
Issues
4
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ли Джен Сеп
tripsent
Commits
567fc95c
Commit
567fc95c
authored
Jun 28, 2025
by
Pavel Mishakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
solving conflicts
parent
fd206072
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
155 additions
and
3 deletions
+155
-3
page.tsx
src/app/page.tsx
+8
-3
Options.tsx
src/components/Options.tsx
+44
-0
CreateOrder.tsx
src/pages/CreateOrder/CreateOrder.tsx
+103
-0
No files found.
src/app/page.tsx
View file @
567fc95c
import
Home
from
"@/pages/Home/Home
"
import
CreateOrder
from
"@/pages/CreateOrder/CreateOrder
"
const
HomePage
=
()
=>
{
return
<
Home
/>
return
(
<
div
>
<
CreateOrder
/>
</
div
>
)
}
export
default
HomePage
\ No newline at end of file
export
default
HomePage
\ No newline at end of file
src/components/Options.tsx
0 → 100644
View file @
567fc95c
type
Props
=
{
regime
:
"country"
|
"city"
contry
:
string
city
:
string
selectHandler
:(
e
:
React
.
ChangeEvent
<
HTMLSelectElement
>
)
=>
void
}
const
Options
=
(
props
:
Props
)
=>
{
const
contries
=
{
Kazakhstan
:
[
"Almaty"
,
"Astana"
,
"Shymkent"
],
USA
:[
"Los-Angelse"
,
"Maiami"
,
"Houston"
]
}
const
optCont
=
(
<
select
onChange=
{
props
.
selectHandler
}
value=
{
props
.
contry
}
name=
"contry"
>
{
Object
.
keys
(
contries
)?.
map
((
i
,
index
)
=>
{
return
<
option
key=
{
index
}
>
{
i
}
</
option
>
})
}
</
select
>
)
const
optCity
=
(
<
select
name=
"city"
onChange=
{
props
.
selectHandler
}
value=
{
props
.
city
}
>
{
contries
[
props
.
contry
as
keyof
typeof
contries
]?.
map
((
i
,
index
)
=>
{
return
<
option
key=
{
index
}
>
{
i
}
</
option
>
})
}
</
select
>
)
return
(
<
div
>
{
props
.
regime
==
"country"
?
optCont
:
optCity
}
</
div
>
)
}
export
default
Options
src/pages/CreateOrder/CreateOrder.tsx
0 → 100644
View file @
567fc95c
'use client'
import
Options
from
"@/components/Options"
import
{
useState
}
from
"react"
export
default
function
CreateOrder
()
{
const
[
inputs
,
setInputs
]
=
useState
<
{
title
:
string
,
description
:
string
,
reward
:
string
}
>
({
title
:
""
,
description
:
""
,
reward
:
""
})
const
[
selectOne
,
setSelectOne
]
=
useState
<
{
contry
:
string
,
city
:
string
,
}
>
({
contry
:
"Kazakhstan"
,
city
:
"Almaty"
,
})
const
[
selectTwo
,
setSelectTwo
]
=
useState
<
{
contry
:
string
,
city
:
string
,
}
>
({
contry
:
"USA"
,
city
:
"Los-Angelse"
,
})
function
inputHandler
(
e
:
React
.
ChangeEvent
<
HTMLInputElement
>
)
{
setInputs
(
{
...
inputs
,
[
e
.
target
.
name
]:
e
.
target
.
value
}
)
}
function
selectionHandlerFrom
(
e
:
React
.
ChangeEvent
<
HTMLSelectElement
>
)
{
setSelectOne
(
{
...
selectOne
,
[
e
.
target
.
name
]:
e
.
target
.
value
}
)
}
function
selectionHandlerTo
(
e
:
React
.
ChangeEvent
<
HTMLSelectElement
>
)
{
setSelectTwo
(
{
...
selectTwo
,
[
e
.
target
.
name
]:
e
.
target
.
value
}
)
}
return
(
<
div
>
<
form
action=
""
>
<
h3
>
Title
</
h3
>
<
input
type=
"text"
name=
"title"
value=
{
inputs
.
title
}
onChange=
{
inputHandler
}
/>
<
h3
>
Description
</
h3
>
<
input
name=
"description"
onChange=
{
inputHandler
}
></
input
>
<
h3
>
Upload Image
</
h3
>
<
h3
>
Reward
</
h3
>
<
input
name=
"reward"
type=
"text"
onChange=
{
inputHandler
}
/>
<
h3
>
Form
</
h3
>
<
Options
regime=
{
"country"
}
selectHandler=
{
(
e
)
=>
{
selectionHandlerFrom
(
e
)
}
}
contry=
{
selectTwo
.
contry
}
city=
{
selectOne
.
city
}
/>
<
Options
regime=
{
"city"
}
selectHandler=
{
(
e
)
=>
{
selectionHandlerFrom
(
e
)
}
}
contry=
{
selectTwo
.
contry
}
city=
{
selectOne
.
city
}
/>
<
h3
>
To
</
h3
>
<
Options
regime=
{
"country"
}
selectHandler=
{
(
e
)
=>
{
selectionHandlerTo
(
e
)
}
}
contry=
{
selectOne
.
contry
}
city=
{
selectTwo
.
city
}
/>
<
Options
regime=
{
"city"
}
selectHandler=
{
(
e
)
=>
{
selectionHandlerTo
(
e
)
}
}
contry=
{
selectOne
.
contry
}
city=
{
selectTwo
.
city
}
/>
<
h3
>
Type of delivery
</
h3
>
<
button
>
Create Order
</
button
>
</
form
>
</
div
>
)
}
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