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
0086b124
Commit
0086b124
authored
Jul 28, 2022
by
Lee Soobeom
Browse files
삭제시 유저 확인(authenticate)
parent
27e8f6a0
Changes
5
Show whitespace changes
Inline
Side-by-side
frontend/src/Pages/myslide.tsx
View file @
0086b124
import
React
,
{
useRef
,
useState
}
from
"
react
"
;
type
num
=
{
slides
:
any
[],
}
export
function
MySlide
({
slides
}:
num
)
{
slides
:
any
[];
};
export
function
MySlide
({
slides
}:
num
)
{
const
firstLeftClick
=
useRef
(
true
);
const
firstRightClick
=
useRef
(
true
);
const
[
page
,
setPage
]
=
useState
(
1
);
const
[
slide
,
setSlide
]
=
useState
(
1
);
const
[
slide
,
setSlide
]
=
useState
(
1
);
// const slide = useRef(1);
const
[
style
,
setStyle
]
=
useState
(
""
);
...
...
@@ -18,10 +17,10 @@ export function MySlide({ slides}: num) {
firstLeftClick
.
current
=
false
;
firstRightClick
.
current
=
true
;
}
else
{
setPage
(
page
-
1
)
setPage
(
page
-
1
)
;
}
// slide.current -= 1;
setSlide
(
slide
-
1
)
setSlide
(
slide
-
1
)
;
setStyle
(
"
-translate-x-full animate-slidetoright
"
);
};
...
...
@@ -30,35 +29,43 @@ export function MySlide({ slides}: num) {
firstLeftClick
.
current
=
true
;
firstRightClick
.
current
=
false
;
}
else
{
setPage
(
page
+
1
)
setPage
(
page
+
1
)
;
}
// slide.current += 1;
setSlide
(
slide
+
1
)
setSlide
(
slide
+
1
)
;
setStyle
(
"
animate-slidetoleft
"
);
};
return
(
<
div
className
=
"flex flex-row justify-center items-center "
>
<
button
className
=
"mx-3 w-6 h-6 rounded-full hover:bg-sky-100 hover:text-gray-400"
onClick
=
{
leftClick
}
disabled
=
{
slide
===
1
}
>
<
button
className
=
"mx-3 w-6 h-6 rounded-full hover:bg-sky-100 hover:text-gray-400"
onClick
=
{
leftClick
}
disabled
=
{
slide
===
1
}
>
<
</
button
>
<
div
className
=
{
`m-3 md:m-5 md:basis-4/5 flex flex-row relative w-full overflow-hidden`
}
>
{
slides
.
slice
(
page
-
1
,
page
+
2
).
map
((
slide
)
=>
(
<
div
key
=
{
Math
.
random
()
}
className
=
"min-w-full"
<
div
key
=
{
Math
.
random
()
}
className
=
"min-w-full"
>
<
div
key
=
{
slide
}
className
=
{
`inline-grid grid-cols-2
${
style
}
min-w-full`
}
>
<
div
key
=
{
slide
}
className
=
{
`inline-grid grid-cols-2
${
style
}
min-w-full`
}
>
{
slide
}
</
div
>
</
div
>
))
}
</
div
>
<
button
className
=
"mx-3 w-6 h-6 rounded-full hover:bg-sky-100 hover:text-gray-400"
onClick
=
{
rightClick
}
disabled
=
{
slide
===
slides
.
length
}
>
<
button
className
=
"mx-3 w-6 h-6 rounded-full hover:bg-sky-100 hover:text-gray-400"
onClick
=
{
rightClick
}
disabled
=
{
slide
===
slides
.
length
}
>
>
</
button
>
</
div
>
);
}
;
}
frontend/src/home/body.tsx
View file @
0086b124
...
...
@@ -87,11 +87,11 @@ export default function Body() {
return
(
<
div
className
=
"flex flex-col"
>
<
Theme
handleClick
=
{
themeHandleClick
}
/>
<
div
className
=
"flex flex-col md:flex-row py-
5
"
>
<
div
className
=
"flex flex-col md:flex-row py-
8
"
>
<
div
className
=
"md:w-1/5 lg:w-1/6"
>
<
Citylist
handleClick
=
{
cityHandleClick
}
/>
</
div
>
<
div
className
=
"flex flex-col"
>
<
div
className
=
"flex flex-col
mt-5
"
>
<
MySlide
key
=
{
Math
.
random
()
}
slides
=
{
slides
}
/>
</
div
>
</
div
>
...
...
frontend/src/home/header.tsx
View file @
0086b124
...
...
@@ -28,10 +28,10 @@ export default function Header() {
</
button
>
<
div
className
=
"flex h-12"
>
<
input
className
=
"ml-10 focus:outline-none focus:border-y-4 focus:border-l-4 focus:border-
sky-5
00 w-3/5 md:w-4/5 border-y-4 border-l-4 border-
sky-3
00 pl-9 rounded-l-full focus:border-0"
className
=
"ml-10 focus:outline-none focus:border-y-4 focus:border-l-4 focus:border-
yellow-9
00 w-3/5 md:w-4/5 border-y-4 border-l-4 border-
yellow-6
00 pl-9 rounded-l-full focus:border-0"
onChange
=
{
handleChange
}
/>
<
button
className
=
"whitespace-nowrap bg-white border-y-4 border-r-4 border-
sky-5
00 rounded-r-full pr-4"
>
<
button
className
=
"whitespace-nowrap bg-white border-y-4 border-r-4 border-
yellow-9
00 rounded-r-full pr-4"
>
검색
</
button
>
</
div
>
...
...
@@ -80,7 +80,7 @@ export default function Header() {
<
Outlet
/>
</
div
>
<
div
className
=
"bg-
cent
er z-0 absolute w-full h-44 overflow-hidden object-cover object-center bg-[url('https://
blog.kakaocdn.net/dn/b5qUMZ/btqN9NEYqcW/ZuZmPcI4u7bdK89shT3RL1/img
.jpg')]"
></
div
>
<
div
className
=
"bg-
right bg-cov
er z-0 absolute w-full h-44 overflow-hidden object-cover object-center bg-[url('https://
a-static.besthdwallpaper.com/seom-punggyeong-ilreoseuteu-byeogji-3840x1200-81006_62
.jpg')]"
></
div
>
</
div
>
);
}
frontend/src/pages/citylist.tsx
View file @
0086b124
...
...
@@ -8,7 +8,7 @@ export default function Citylist({ handleClick }: CityProps) {
const
[
active
,
setActive
]
=
useState
(
0
);
const
onactive
=
"
text-start px-5 py-2 whitespace-nowrap w-full border-b-4 md:border-b-0 md:border-r-4 border-
sky
-500
"
;
"
text-start px-5 py-2 whitespace-nowrap w-full border-b-4 md:border-b-0 md:border-r-4 border-
lime
-500
"
;
const
offactive
=
"
text-start px-5 py-2 whitespace-nowrap w-full
"
;
const
clickActive
=
(
a
:
number
)
=>
{
...
...
@@ -16,10 +16,10 @@ export default function Citylist({ handleClick }: CityProps) {
};
return
(
<
div
className
=
"overflow-auto w-full flex flex-row md:flex-col md:mr-24 bg-
red
-100 shadow-lg"
>
<
div
className
=
"text-start px-5 py-2 bg-white whitespace-nowrap"
>
<
div
className
=
"overflow-auto w-full
md:w-36
flex flex-row md:flex-col md:mr-24 bg-
lime
-100 shadow-lg"
>
{
/*
<div className="text-start px-5 py-2 bg-white whitespace-nowrap">
도시
</
div
>
</div>
*/
}
<
div
onClick
=
{
()
=>
clickActive
(
1
)
}
>
<
button
id
=
{
"
Seoul
"
}
...
...
src/routes/post.route.ts
View file @
0086b124
...
...
@@ -12,7 +12,7 @@ router
.
route
(
"
/:postId
"
)
.
post
(
authCtrl
.
requireLogin
,
postCtrl
.
addCounts
)
.
delete
(
authCtrl
.
requireLogin
,
authCtrl
.
authenticate
,
postCtrl
.
deleteOnePost
)
.
put
(
authCtrl
.
requireLogin
,
postCtrl
.
updateOnePost
);
.
put
(
authCtrl
.
requireLogin
,
authCtrl
.
authenticate
,
postCtrl
.
updateOnePost
);
router
.
param
(
"
postId
"
,
postCtrl
.
userByPostId
);
export
default
router
;
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