Skip to content

Commit

Permalink
Removed unused interface.
Browse files Browse the repository at this point in the history
  • Loading branch information
inbarbarkai committed May 15, 2022
1 parent 10d5636 commit 6909821
Showing 1 changed file with 75 additions and 84 deletions.
159 changes: 75 additions & 84 deletions web/src/components/user/userInvitations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,94 +3,85 @@ import * as React from 'react';
import { Invitation } from '../../models/invitation';
import Moment from 'react-moment';

export function UserInvitations() {
let userInvitations: Invitation[] = [
{
invitationId: 'asdf',
userId: 'asdf',
inviteesAmount: 3,
inviteesAdmitted: 2,
inviteesArrivalTimestamp: new Date(),
isActive: true,
creationTimestamp: new Date(),
modifyTimestamp: new Date(),
commentForGuard: 'hey'
}
];


export function UserInvitations() {
let userInvitations:Invitation[] = [
{invitationId: 'asdf',
userId: 'asdf',
inviteesAmount: 3,
inviteesAdmitted:2,
inviteesArrivalTimestamp: new Date(),
isActive: true,
creationTimestamp: new Date(),
modifyTimestamp: new Date(),
commentForGuard: 'hey'}
];

const renderRows = function(){ return userInvitations.map((invitation) => <InvitaionRow invitation={invitation}/>)
}
return (
<table>
<thead>
<tr>
<th>
addmitted
</th>
<th>
invited
</th>
<th>
arriving at
</th>
<th>
comment for guard
</th>
<th>
created at
</th>
<th>
is active
</th>
</tr>
</thead>
<tbody>

{renderRows()}
</tbody>
</table>
);

const renderRows = function () {
return userInvitations.map((invitation) => <InvitaionRow invitation={invitation} />)
}
return (
<table>
<thead>
<tr>
<th>
addmitted
</th>
<th>
invited
</th>
<th>
arriving at
</th>
<th>
comment for guard
</th>
<th>
created at
</th>
<th>
is active
</th>
</tr>
</thead>
<tbody>
{renderRows()}
</tbody>
</table>
);

function InvitaionRow({invitation}:IInvitaionRowData){
return (
<tr>
<td>
{invitation.inviteesAdmitted}
</td>
<td>
{invitation.inviteesAmount}
</td>
<td>
<Moment format="MM/DD HH:mm" date= {invitation.inviteesArrivalTimestamp}>

</Moment>
</td>
<td>
{invitation.commentForGuard}
</td>
<td>
<Moment format="MM/DD HH:mm" date= { invitation.creationTimestamp}>

</Moment>
</td>
<td>
{invitation.isActive.toString()}
</td>
</tr>
);
}
}

function InvitaionRow({ invitation }: IInvitaionRowData) {
return (
<tr>
<td>
{invitation.inviteesAdmitted}
</td>
<td>
{invitation.inviteesAmount}
</td>
<td>
<Moment format="MM/DD HH:mm" date={invitation.inviteesArrivalTimestamp}>

function InvitaionRows({invitations}:IInvitaionRowsData){
return invitations.map((invitation) => <InvitaionRow invitation={invitation}/>)
}
</Moment>
</td>
<td>
{invitation.commentForGuard}
</td>
<td>
<Moment format="MM/DD HH:mm" date={invitation.creationTimestamp}>

interface IInvitaionRowData{
invitation: Invitation
}
</Moment>
</td>
<td>
{invitation.isActive.toString()}
</td>
</tr>
);
}

interface IInvitaionRowsData{
invitations: Invitation[]
}
interface IInvitaionRowData {
invitation: Invitation
}

0 comments on commit 6909821

Please sign in to comment.