Skip to content

Commit

Permalink
Add Report List
Browse files Browse the repository at this point in the history
  • Loading branch information
sehee0207 committed Feb 19, 2024
1 parent 274d2b4 commit f2babc1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
14 changes: 4 additions & 10 deletions src/pages/Reportlistpage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,9 @@ interface DataState {
interface Report {
id: number,
cause: string,
createdTime: {
year: number;
month: number;
day: number;
hour: number;
minute: number;
second: number;
nanosecond: number;
};
member:{
userId: string,
}
}

const ReportlistpageStyle = styled.div`
Expand Down Expand Up @@ -83,7 +77,7 @@ const Reportlist = () => {
{reports.map((report) => (
<Link to={`/report/${report.id}`} key={report.id}>
<ReportListStyle>
<h5>{report.cause}</h5>
<h5>{report.member.userId} / {report.cause}</h5>
</ReportListStyle>
</Link>
))}
Expand Down
6 changes: 4 additions & 2 deletions src/pages/Reportwritepage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ const Reportwrite = () => {
const title = uselocation.state.title;

const report = {
location: location,
reportFirePlace: location,
cause: cause,
deathNum: deathnumber,
injuryNum: injurynumber,
Expand Down Expand Up @@ -155,6 +155,8 @@ const Reportwrite = () => {
.catch(error => {
console.error('Error:', error);
});

setLocation(title);
}, []);

return(
Expand Down Expand Up @@ -183,7 +185,7 @@ const Reportwrite = () => {
<InputStyle type="time" onChange={e => setTime(e.target.value)}/>

<H5Style>장소</H5Style>
<InputStyle value={title} onChange={e => setLocation(e.target.value)}/>
<InputStyle value={title}/>

<H5Style>원인</H5Style>
<InputStyle id="height_long" onChange={e => setCause(e.target.value)}/>
Expand Down

0 comments on commit f2babc1

Please sign in to comment.