mirror of
https://github.com/usatiuk/photos.git
synced 2025-10-28 23:37:48 +01:00
sort pictures by most recent
This commit is contained in:
@@ -29,9 +29,9 @@ export const OverviewComponent: React.FunctionComponent<IOverviewComponentProps>
|
||||
return <LoadingStub spinner={props.fetchingSpinner} />;
|
||||
}
|
||||
|
||||
const photos = props.photos.map((photo) => (
|
||||
<PhotoCard key={photo.id} photo={photo} />
|
||||
));
|
||||
const photos = props.photos
|
||||
.sort((a, b) => b.shotAt - a.shotAt)
|
||||
.map((photo) => <PhotoCard key={photo.id} photo={photo} />);
|
||||
|
||||
return (
|
||||
<div id="overview">
|
||||
|
||||
@@ -42,7 +42,7 @@ export class PhotoCardComponent extends React.PureComponent<
|
||||
}
|
||||
*/
|
||||
public render(): JSX.Element {
|
||||
const isUploaded = this.props.photo.uploaded;
|
||||
const fileExists = this.props.photo.uploaded;
|
||||
return (
|
||||
<Card
|
||||
className="photoCard"
|
||||
@@ -53,7 +53,7 @@ export class PhotoCardComponent extends React.PureComponent<
|
||||
}
|
||||
*/
|
||||
>
|
||||
{isUploaded ? (
|
||||
{fileExists ? (
|
||||
<img src={getPhotoThumbPath(this.props.photo, 512)}></img>
|
||||
) : (
|
||||
<Spinner />
|
||||
|
||||
Reference in New Issue
Block a user