Skip to content

Commit 171ea36

Browse files
committed
Removed unused interface.
1 parent 10d5636 commit 171ea36

File tree

1 file changed

+73
-87
lines changed

1 file changed

+73
-87
lines changed

web/src/components/user/userInvitations.tsx

Lines changed: 73 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -3,94 +3,80 @@ import * as React from 'react';
33
import { Invitation } from '../../models/invitation';
44
import Moment from 'react-moment';
55

6+
export function UserInvitations() {
7+
let userInvitations: Invitation[] = [
8+
{
9+
invitationId: 'asdf',
10+
userId: 'asdf',
11+
inviteesAmount: 3,
12+
inviteesAdmitted: 2,
13+
inviteesArrivalTimestamp: new Date(),
14+
isActive: true,
15+
creationTimestamp: new Date(),
16+
modifyTimestamp: new Date(),
17+
commentForGuard: 'hey'
18+
}
19+
];
620

7-
8-
export function UserInvitations() {
9-
let userInvitations:Invitation[] = [
10-
{invitationId: 'asdf',
11-
userId: 'asdf',
12-
inviteesAmount: 3,
13-
inviteesAdmitted:2,
14-
inviteesArrivalTimestamp: new Date(),
15-
isActive: true,
16-
creationTimestamp: new Date(),
17-
modifyTimestamp: new Date(),
18-
commentForGuard: 'hey'}
19-
];
20-
21-
const renderRows = function(){ return userInvitations.map((invitation) => <InvitaionRow invitation={invitation}/>)
22-
}
23-
return (
24-
<table>
25-
<thead>
26-
<tr>
27-
<th>
28-
addmitted
29-
</th>
30-
<th>
31-
invited
32-
</th>
33-
<th>
34-
arriving at
35-
</th>
36-
<th>
37-
comment for guard
38-
</th>
39-
<th>
40-
created at
41-
</th>
42-
<th>
43-
is active
44-
</th>
45-
</tr>
46-
</thead>
47-
<tbody>
48-
49-
{renderRows()}
50-
</tbody>
51-
</table>
52-
);
53-
54-
}
55-
56-
function InvitaionRow({invitation}:IInvitaionRowData){
57-
return (
58-
<tr>
59-
<td>
60-
{invitation.inviteesAdmitted}
61-
</td>
62-
<td>
63-
{invitation.inviteesAmount}
64-
</td>
65-
<td>
66-
<Moment format="MM/DD HH:mm" date= {invitation.inviteesArrivalTimestamp}>
67-
68-
</Moment>
69-
</td>
70-
<td>
71-
{invitation.commentForGuard}
72-
</td>
73-
<td>
74-
<Moment format="MM/DD HH:mm" date= { invitation.creationTimestamp}>
75-
76-
</Moment>
77-
</td>
78-
<td>
79-
{invitation.isActive.toString()}
80-
</td>
81-
</tr>
82-
);
83-
}
84-
85-
86-
function InvitaionRows({invitations}:IInvitaionRowsData){
87-
return invitations.map((invitation) => <InvitaionRow invitation={invitation}/>)
21+
const renderRows = function () {
22+
return userInvitations.map((invitation) => <InvitaionRow invitation={invitation} />)
8823
}
24+
return (
25+
<table>
26+
<thead>
27+
<tr>
28+
<th>
29+
addmitted
30+
</th>
31+
<th>
32+
invited
33+
</th>
34+
<th>
35+
arriving at
36+
</th>
37+
<th>
38+
comment for guard
39+
</th>
40+
<th>
41+
created at
42+
</th>
43+
<th>
44+
is active
45+
</th>
46+
</tr>
47+
</thead>
48+
<tbody>
49+
{renderRows()}
50+
</tbody>
51+
</table>
52+
);
53+
}
8954

90-
interface IInvitaionRowData{
91-
invitation: Invitation
92-
}
55+
function InvitaionRow({ invitation }: IInvitaionRowData) {
56+
return (
57+
<tr>
58+
<td>
59+
{invitation.inviteesAdmitted}
60+
</td>
61+
<td>
62+
{invitation.inviteesAmount}
63+
</td>
64+
<td>
65+
<Moment format="MM/DD HH:mm" date={invitation.inviteesArrivalTimestamp} />
66+
</td>
67+
<td>
68+
{invitation.commentForGuard}
69+
</td>
70+
<td>
71+
<Moment format="MM/DD HH:mm" date={invitation.creationTimestamp} />
72+
</td>
73+
<td>
74+
{invitation.isActive.toString()}
75+
</td>
76+
</tr>
77+
);
78+
}
9379

94-
interface IInvitaionRowsData{
95-
invitations: Invitation[]
96-
}
80+
interface IInvitaionRowData {
81+
invitation: Invitation
82+
}

0 commit comments

Comments
 (0)