Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
students
travel
Commits
1254b3cc
Commit
1254b3cc
authored
Jul 04, 2022
by
백승민
Browse files
theme&city really done
parent
e928e6d8
Changes
4
Hide whitespace changes
Inline
Side-by-side
frontend/src/Pages/pic.ts
View file @
1254b3cc
...
...
@@ -51,7 +51,7 @@ let url = [
{
themeid
:
"
activity
"
,
cityid
:
"
Busan
"
,
url
:
"
https://cdn.pixabay.com/photo/20
22/06/15/23/08/germany-7264701__34
0.jpg
"
,
url
:
"
https://cdn.pixabay.com/photo/20
15/04/07/07/51/railroad-tracks-710614__48
0.jpg
"
,
name
:
"
레일바이크
"
},
{
...
...
@@ -63,7 +63,7 @@ let url = [
{
themeid
:
"
activity
"
,
cityid
:
"
Jeju
"
,
url
:
"
https://cdn.pixabay.com/photo/20
2
2/
06/15/23/08/germany-7264701
__340.jpg
"
,
url
:
"
https://cdn.pixabay.com/photo/20
1
2/
10/10/05/07/combat-diver-60545
__340.jpg
"
,
name
:
"
스카이다이빙
"
},
{
...
...
@@ -87,7 +87,7 @@ let url = [
{
themeid
:
"
activity
"
,
cityid
:
"
Woolsan
"
,
url
:
"
https://cdn.pixabay.com/photo/20
22
/0
6
/1
5
/2
3/08/germany-7264701__34
0.jpg
"
,
url
:
"
https://cdn.pixabay.com/photo/20
19
/0
5
/1
1
/2
0/44/free-climbing-4196577__48
0.jpg
"
,
name
:
"
클라이밍
"
},
{
...
...
@@ -108,8 +108,9 @@ let url = [
url
:
"
https://cdn.pixabay.com/photo/2016/08/23/16/34/italy-1614931__340.jpg
"
,
name
:
"
서울 동굴
"
},
];
export
default
function
get
p
ic
(){
export
function
get
P
ic
ure
(){
return
url
;
};
\ No newline at end of file
frontend/src/pages/body.tsx
View file @
1254b3cc
...
...
@@ -2,14 +2,14 @@ import React, { useEffect, MouseEvent } from "react";
import
{
Outlet
,
useSearchParams
}
from
"
react-router-dom
"
;
import
Theme
from
"
./theme
"
;
import
Citylist
from
"
./citylist
"
;
import
get
p
ic
from
"
./pic
"
;
import
{
get
P
ic
ure
}
from
"
./pic
"
;
const
initSearchParams
=
{
"
theme
"
:
""
,
"
city
"
:
""
}
export
default
function
Body
()
{
const
[
searchParams
,
setSearchParams
]
=
useSearchParams
(
initSearchParams
)
let
get
p
ics
=
get
p
ic
();
let
get
P
ics
=
get
P
ic
ure
();
useEffect
(()
=>
{
console
.
log
(
searchParams
.
get
(
'
theme
'
),
searchParams
.
get
(
'
city
'
))
...
...
@@ -32,27 +32,29 @@ export default function Body() {
})
}
const
Idpics
=
getpics
.
filter
(
p
=>
p
.
themeid
==
searchParams
.
get
(
'
theme
'
)
&&
p
.
cityid
==
searchParams
.
get
(
'
city
'
)
)
return
(
<
div
className
=
"flex flex-col px-1 py-1"
>
<
Theme
handleClick
=
{
themeHandleClick
}
/>
<
div
className
=
"flex flex-col md:flex-row py-10 "
>
<
Citylist
handleClick
=
{
cityHandleClick
}
/>
<
div
className
=
"overflow-y-auto flex mr:10 md:basis-4/5 grid grid-rows-3 grid-cols-5"
>
{
Idpics
.
map
((
pic
,
index
:
number
)
=>
(
const
Idpics
=
getPics
.
filter
(
p
=>
{
return
(
p
.
themeid
==
searchParams
.
get
(
'
theme
'
)
&&
p
.
cityid
==
searchParams
.
get
(
'
city
'
))
||
(
p
.
themeid
==
searchParams
.
get
(
'
theme
'
)
&&
searchParams
.
get
(
'
city
'
)
==
""
)
||
(
searchParams
.
get
(
'
theme
'
)
==
""
&&
p
.
cityid
==
searchParams
.
get
(
'
city
'
))
||
(
searchParams
.
get
(
'
theme
'
)
==
""
&&
searchParams
.
get
(
'
city
'
)
==
""
)
})
return
(
<
div
className
=
"flex flex-col px-1 py-1"
>
<
Theme
handleClick
=
{
themeHandleClick
}
/>
<
div
className
=
"flex flex-col md:flex-row py-10 "
>
<
Citylist
handleClick
=
{
cityHandleClick
}
/>
<
div
className
=
"flex md:mr-10 md:basis-4/5 grid grid-rows-3 grid-cols-5"
>
{
Idpics
.
map
((
pic
,
index
:
number
)
=>
(
<
div
className
=
"m-1 shrink-0 bg-gray-200 rounded overflow-hidden shadow-md"
key
=
{
index
}
>
<
img
src
=
{
pic
.
url
}
className
=
"w-full h-10 md:h-20 object-cover"
/>
<
img
src
=
{
pic
.
url
}
className
=
"w-full h-10 md:h-20 object-cover"
/>
<
p
className
=
"text-center text-xs"
>
{
pic
.
name
}
</
p
>
</
div
>
))
}
</
div
>
))
}
</
div
>
<
Outlet
/>
</
div
>
// Body Page
);
};
<
Outlet
/>
</
div
>
// Body Page
);
};
frontend/src/pages/header.tsx
View file @
1254b3cc
...
...
@@ -9,7 +9,7 @@ export default function Header() {
<
div
className
=
"flex flex-col "
>
<
div
className
=
"flex flex-row px-5 py-20 md:place-content-between"
>
<
button
className
=
"px-5 py-2"
>
<
Link
to
=
"/"
className
=
"hover:bg-gray-200 focus:text-purple-500
"
>
Travel Report
</
Link
>
<
Link
to
=
"/"
className
=
"hover:bg-gray-200 focus:text-purple-500"
>
Travel Report
</
Link
>
</
button
>
<
div
className
=
"flex flex-row-reverse"
>
<
button
className
=
"px-5 py-2 bg-teal-400 rounded"
>
...
...
frontend/src/url.ts
deleted
100644 → 0
View file @
e928e6d8
let
url
=
[
{
url
:
"
1
"
},
{
url
:
"
2
"
},
{
url
:
"
3
"
},
{
url
:
"
4
"
},
{
url
:
"
5
"
},
{
url
:
"
6
"
},
{
url
:
"
7
"
},
{
url
:
"
8
"
},
{
url
:
"
9
"
},
{
url
:
"
10
"
},
{
url
:
"
11
"
},
{
url
:
"
12
"
},
{
url
:
"
13
"
},
{
url
:
"
14
"
},
];
export
default
function
getUrl
(){
return
url
;
}
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