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:
31
src/Components/GamesList.tsx
Normal file
31
src/Components/GamesList.tsx
Normal 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;
|
||||
Reference in New Issue
Block a user