Toggle navigation
Toggle navigation
This project
Loading...
Sign in
최은석
/
ossw-project
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
채지성
2022-06-04 16:47:33 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
88520052e09f8385e1e8d1bd572b1227b94039be
88520052
1 parent
711ebf64
writingPage
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
81 additions
and
12 deletions
client/src/Component/Writing.css
client/src/Component/Writing.js
client/src/Component/mainpage.js
client/src/index.css
client/src/Component/Writing.css
View file @
8852005
.writing
{
height
:
90%
;
width
:
90%
;
max-width
:
1024px
;
display
:
grid
;
grid-template-rows
:
15%
70%
10%
;
margin
:
2%
2%
;
background-color
:
#FDF5E6
;
}
.writing
:nth-child
(
1
)
{
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
}
.writing
:nth-child
(
2
)
{
display
:
flex
;
justify-content
:
center
;
align-items
:
flex-start
;
padding-top
:
3%
;
}
.writing
:nth-child
(
1
)
input
{
padding
:
2%
;
width
:
95%
;
height
:
87%
;
font-size
:
30px
;
}
.writing
:nth-child
(
2
)
textarea
{
padding
:
2%
;
width
:
95%
;
height
:
95%
;
resize
:
none
;
font-size
:
20px
;
}
.writing
:nth-child
(
1
)
input
::placeholder
{
font-size
:
40px
;
}
.writing
:nth-child
(
3
)
{
display
:
flex
;
justify-content
:
end
;
align-items
:
flex-end
;
}
.writing
:nth-child
(
3
)
button
{
height
:
70%
;
width
:
15%
;
margin
:
3%
;
max-width
:
250px
;
}
\ No newline at end of file
...
...
client/src/Component/Writing.js
View file @
8852005
...
...
@@ -3,19 +3,38 @@ import axios from "axios";
import
{
useEffect
,
useState
}
from
'react'
;
import
'./Writing.css'
function
Writing
()
{
const
postContent
=
()
=>
{
const
title
=
document
.
getElementById
(
'title'
).
value
;
const
content
=
document
.
getElementById
(
'content'
).
value
;
function
Writing
()
{
let
postContent
=
{
"title"
:
title
,
"content"
:
content
,
"password"
:
'1234'
,
};
console
.
log
(
postContent
);
if
(
postContent
.
title
==
''
||
postContent
.
content
==
''
){
alert
(
'제목과 내용을 모두 적어주세요'
);
}
else
{
axios
.
post
(
'/api/postSave'
,
postContent
).
then
((
res
)
=>
{
window
.
location
.
href
=
'/mealtalk'
;
});
}
}
useEffect
(()
=>
{
},
[]);
return
(
<
div
className
=
'writing'
>
<
div
><
input
id
=
'title'
type
=
'text'
placeholder
=
'제목'
/><
/div
>
<
div
><
textarea
id
=
'content'
><
/textarea></
div
>
<
div
id
=
'postContent'
><
button
onClick
=
{
postContent
}
>
게시글
등록
<
/button></
div
>
<
/div
>
);
}
//첫번째: 오늘 메뉴/ 두번째: 오늘 메뉴에 대한 이야기/ 세번째: 어제 메뉴에 대한 이야기
export
default
Writing
;
\ No newline at end of file
...
...
client/src/Component/mainpage.js
View file @
8852005
...
...
@@ -6,16 +6,12 @@ import './MainPage.css'
function
MainPage
()
{
const
[
lunch
,
setlunch
]
=
useState
(
""
);
const
[
dinner
,
setdinner
]
=
useState
(
""
);
const
[
list
,
setList
]
=
useState
([]);
let
currentYear
=
new
Date
().
getFullYear
();
let
currentMonth
=
new
Date
().
getMonth
();
let
currentDate
=
new
Date
().
getDate
();
let
today
=
currentYear
+
'/'
+
currentMonth
+
'/'
+
currentDate
;
const
todayMealTable
=
async
()
=>
{
axios
.
get
(
"/api/todayMenu"
).
then
(
(
res
)
=>
{
...
...
@@ -48,8 +44,7 @@ function MainPage() {
makeTable
(
dinnerArr
,
dinnerDom
);
}
)
}
};
useEffect
(()
=>
{
todayMealTable
();
...
...
client/src/index.css
View file @
8852005
...
...
@@ -15,9 +15,9 @@ code {
*
{
margin
:
0px
;
padding
:
0px
;
/*
border-style
:
solid
;
border-color
:
black
;
border-width
:
5px
;
*/
}
...
...
Please
register
or
login
to post a comment