Skip to content

Commit

Permalink
+ Optimize Images
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuzaki01 committed Sep 14, 2023
1 parent cf2c1f8 commit a9677f6
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 22 deletions.
6 changes: 4 additions & 2 deletions components/common/ActivityTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,9 @@ const ActivityTableRow: FC<ActivityTableRowProps> = ({ activity }) => {
<Flex align="center">
{imageSrc && (
<Image
style={{ borderRadius: '4px', objectFit: 'cover' }}
style={{ borderRadius: '4px' }}
loader={({ src }) => src}
unoptimized
src={imageSrc}
alt={`${activity.token?.tokenName} Token Image`}
width={48}
Expand Down Expand Up @@ -374,8 +375,9 @@ const ActivityTableRow: FC<ActivityTableRowProps> = ({ activity }) => {
<Flex align="center">
{imageSrc && (
<Img
style={{ borderRadius: '4px', objectFit: 'cover' }}
style={{ borderRadius: '4px' }}
loader={({ src }) => src}
unoptimized
src={imageSrc}
alt="Activity Token Image"
width={48}
Expand Down
2 changes: 1 addition & 1 deletion components/common/MobileTokenFilters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,10 @@ export const MobileTokenFilters: FC<Props> = ({
<Image
style={{
borderRadius: '4px',
objectFit: 'cover',
aspectRatio: '1/1',
}}
loader={({ src }) => src}
unoptimized
src={optimizeImage(
collection?.collection?.image as string,
250
Expand Down
2 changes: 1 addition & 1 deletion components/common/TokenFilters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ export const TokenFilters: FC<Props> = ({
<Image
style={{
borderRadius: '4px',
objectFit: 'cover',
aspectRatio: '1/1',
}}
unoptimized
loader={({ src }) => src}
src={optimizeImage(
collection?.collection?.image as string,
Expand Down
4 changes: 0 additions & 4 deletions components/home/CollectionTopSellingTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ const RecentSalesCell: FC<{
borderRadius: 8,
width: 56,
height: 56,
objectFit: 'cover',
}}
/>
</Flex>
Expand Down Expand Up @@ -292,7 +291,6 @@ const AllSalesTableRow: FC<CollectionTableRowProps> = ({
borderRadius: 8,
width: 48,
height: 48,
objectFit: 'cover',
}}
alt="Collection Image"
width={48}
Expand Down Expand Up @@ -466,7 +464,6 @@ const SaleTableRow: FC<CollectionTableRowProps> = ({
borderRadius: 8,
width: 48,
height: 48,
objectFit: 'cover',
}}
alt="Collection Image"
width={48}
Expand Down Expand Up @@ -630,7 +627,6 @@ const MintTableRow: FC<CollectionTableRowProps> = ({
borderRadius: 8,
width: 48,
height: 48,
objectFit: 'cover',
}}
alt="Collection Image"
width={48}
Expand Down
4 changes: 2 additions & 2 deletions components/navbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,12 @@ const Navbar = () => {
<Flex align="center" css={{ flex: 1 }}>
<Link href={`/${routePrefix}`}>
<Box css={{ width: 112, cursor: 'pointer' }}>
{<Image
<Image
src="/nftearth-icon.svg"
width={50}
height={50}
alt="NFTEarth"
/>}
/>
</Box>
</Link>
<Flex css={{ flex: 1, px: '$5', maxWidth: 600 }}>
Expand Down
4 changes: 2 additions & 2 deletions components/portfolio/ListingsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,9 @@ const ListingTableRow: FC<ListingTableRowProps> = ({
<Img
css={{
borderRadius: '4px',
objectFit: 'cover',
aspectRatio: '1/1',
}}
unoptimized
loader={({ src }) => src}
src={imageSrc}
alt={`${listing?.id}`}
Expand Down Expand Up @@ -299,9 +299,9 @@ const ListingTableRow: FC<ListingTableRowProps> = ({
<Img
css={{
borderRadius: '4px',
objectFit: 'cover',
aspectRatio: '1/1',
}}
unoptimized
loader={({ src }) => src}
src={imageSrc as string}
alt={`${criteriaData?.token?.name}`}
Expand Down
4 changes: 2 additions & 2 deletions components/portfolio/OffersTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@ const OfferTableRow: FC<OfferTableRowProps> = ({ offer, isOwner, mutate }) => {
<Img
css={{
borderRadius: '4px',
objectFit: 'cover',
aspectRatio: '1/1',
}}
unoptimized
loader={({ src }) => src}
src={imageSrc}
alt={`${offer?.id}`}
Expand Down Expand Up @@ -324,9 +324,9 @@ const OfferTableRow: FC<OfferTableRowProps> = ({ offer, isOwner, mutate }) => {
<Img
css={{
borderRadius: '4px',
objectFit: 'cover',
aspectRatio: '1/1',
}}
unoptimized
loader={({ src }) => src}
src={imageSrc}
alt={`${criteriaData?.token?.name}`}
Expand Down
2 changes: 1 addition & 1 deletion components/portfolio/PortfolioTokenCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,9 @@ export default ({
<Image
style={{
borderRadius: '4px',
objectFit: 'cover',
aspectRatio: '1/1',
}}
unoptimized
loader={({ src }) => src}
src={collectionImage}
alt={`${token?.token?.name}`}
Expand Down
4 changes: 2 additions & 2 deletions components/portfolio/TokenTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,9 @@ const TokenTableRow: FC<TokenTableRowProps> = ({
<Image
style={{
borderRadius: '4px',
objectFit: 'cover',
aspectRatio: '1/1',
}}
unoptimized
loader={({src}) => src}
src={imageSrc}
alt={`${token?.token?.name}`}
Expand Down Expand Up @@ -662,9 +662,9 @@ const TokenTableRow: FC<TokenTableRowProps> = ({
<Image
style={{
borderRadius: '4px',
objectFit: 'cover',
aspectRatio: '1/1',
}}
unoptimized
loader={({src}) => src}
src={imageSrc}
alt={`${token?.token?.name}`}
Expand Down
1 change: 0 additions & 1 deletion components/rankings/CollectionRankingsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ const RankingsTableRow: FC<RankingsTableRowProps> = ({
borderRadius: 8,
width: 56,
height: 56,
objectFit: 'cover',
}}
alt="Collection Image"
width={56}
Expand Down
1 change: 0 additions & 1 deletion pages/[chain]/collection/[contract].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ const CollectionPage: NextPage<Props> = ({ id, ssr }) => {
width: 64,
height: 64,
borderRadius: 8,
objectFit: 'cover',
}}
alt="Collection Page Image"
/>
Expand Down
5 changes: 3 additions & 2 deletions pages/[chain]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,13 @@ const IndexPage: NextPage<Props> = ({ ssr }) => {
{
startTime,
fillType,
limit: 20,
limit: 10,
includeRecentSales: true,
},
{
revalidateOnMount: true,
refreshInterval: 300000,
loadingTimeout: 30 * 1000,
fallbackData: [
ssr.topSellingCollections[marketplaceChain.id].collections,
],
Expand Down Expand Up @@ -266,7 +267,7 @@ export const getStaticProps: GetStaticProps<{
{
startTime: startTime,
fillType: 'sale',
limit: 20,
limit: 10,
includeRecentSales: true,
}

Expand Down
2 changes: 1 addition & 1 deletion pages/portfolio/[[...address]].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ const IndexPage: NextPage = () => {

useEffect(() => {
router.query.tab = tabValue
router.push(router, undefined, { shallow: true })
router.push(router.pathname, undefined, { shallow: true })
}, [tabValue])

if (!isMounted) {
Expand Down

0 comments on commit a9677f6

Please sign in to comment.