Profile page shows guests and lets you delete them. History page shows times in the appropriate format. IntlDatetime set up for each locale.

This commit is contained in:
Daniel Ledda
2020-05-25 22:54:15 +02:00
parent 0fe94c3066
commit 901cb04955
16 changed files with 287 additions and 97 deletions

View File

@@ -0,0 +1,31 @@
import {List, ListItem} from "semantic-ui-react";
import React from "react";
import UserContext from "../Contexts/UserContext";
interface GamesListProps {
loading: boolean;
gamesList: any[];
}
const GamesList: React.FunctionComponent<GamesListProps> = (props) => {
const {loading, gamesList} = props;
const Uctx = React.useContext(UserContext);
const listItems = gamesList.map(listing =>
<ListItem key={listing.createdAt}>
Game played on: {Uctx.dateTimeFormatter.format(new Date(listing.createdAt))}
</ListItem>
);
return (
<>
{loading ? (
<p>{Uctx.strings.historyPage.loading}</p>
) : (
<List bulleted={true}>
{listItems}
</List>
)}
</>
);
};
export default GamesList;