Skip to content

Commit

Permalink
Merge branch 'main' into feature/listener
Browse files Browse the repository at this point in the history
  • Loading branch information
dennispassway committed Jan 28, 2021
2 parents 71d193a + 9cbaffe commit e2523fb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/MediaGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export const MediaGrid = ({

const ImageItem = ({ alt, onClick, onDoubleClick, selected, url }: MediaItemProps) => (
<StyledMediaItem selected={selected} onClick={(e) => onClick(e)} onDoubleClick={onDoubleClick}>
<img alt={alt} src={`${url}?w=150&h=150&fit=crop&auto=format&q=80`} />
<img alt={alt} src={`${url}?w=150&h=150&fit=crop&auto=format&q=80`} loading="lazy" />
</StyledMediaItem>
);

Expand Down
2 changes: 1 addition & 1 deletion src/components/MediaList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ const MediaRow = ({
<div>
<StyledThumbnailContainer>
{_type === 'sanity.imageAsset' ? (
<StyledImage alt={alt} src={`${url}?w=100&h=100&fit=crop&auto=format&q=80`} />
<StyledImage alt={alt} src={`${url}?w=100&h=100&fit=crop&auto=format&q=80`} loading="lazy" />
) : (
<StyledFile>
<Icon type="file" />
Expand Down
4 changes: 2 additions & 2 deletions src/shared/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ export function formatSize(size: number) {

export function formatDate(date: string) {
const d = new Date(date);
const months = ['Jan', 'Feb', 'Mar', 'Apr', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
return `${months[d.getMonth() - 1]} ${d.getDate()}, ${d.getFullYear()}`;
const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
return `${months[d.getMonth()]} ${d.getDate()}, ${d.getFullYear()}`;
}

0 comments on commit e2523fb

Please sign in to comment.