Skip to content

Commit b7bbd09

Browse files
committed
Merge branch 'develop'
2 parents a4c638c + 138fe96 commit b7bbd09

25 files changed

+66
-203
lines changed

components/drag-and-drop/index.module.scss

+1
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,7 @@
571571
max-width: 730px;
572572
height: 100%;
573573
margin: 0 auto;
574+
touch-action: none;
574575

575576
@include breakpoint-md {
576577
padding-top: 20px;

components/drag-and-drop/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import React, { useState, useEffect, useCallback, useRef } from 'react'
44
import classnames from 'classnames'
55
import { useDropzone, FileRejection } from 'react-dropzone'
66
import { CSSTransition } from 'react-transition-group'
7-
import { useDrag } from 'react-use-gesture'
7+
import { useDrag } from '@use-gesture/react'
88
import { headTemplate } from 'utils/favicon'
99
import { isTouchCapable } from 'utils/device'
1010
import { Typography } from 'components/typography'

components/favycon-info/index.module.scss

+1
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@
163163
max-width: 572px;
164164
padding: 0 16px;
165165
margin: 0 auto;
166+
touch-action: none;
166167
background: $white;
167168

168169
@include breakpoint-md {

components/favycon-info/index.tsx

+15-11
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import dynamic from 'next/dynamic'
2+
import Image from 'next/image'
23
import React, { useState, useRef } from 'react'
34
import classnames from 'classnames'
4-
import { useDrag } from 'react-use-gesture'
5+
import { useDrag } from '@use-gesture/react'
56
import { Typography } from 'components/typography'
67
import { ToolTitle } from 'components/tool-title'
7-
import { LazyImage } from 'components/lazy-image'
88
import { SvgTwitter } from 'components/svgs/svg-twitter'
99
import { SvgGithub } from 'components/svgs/svg-github'
1010

@@ -13,6 +13,10 @@ import { SvgFavycon } from 'components/svgs/svg-favycon'
1313
import { Button } from 'components/button'
1414
import { isTouchCapable } from 'utils/device'
1515

16+
import augustoLopes from '../../public/images/people/augusto-lopes.png'
17+
import ruiSaraiva from '../../public/images/people/rui-saraiva.png'
18+
import miguelTeixeira from '../../public/images/people/miguel-teixeira.png'
19+
1620
const Modal = dynamic(() => import('react-modal'))
1721

1822
const people = [
@@ -21,21 +25,21 @@ const people = [
2125
name: 'Augusto Lopes',
2226
role: 'Product Designer',
2327
social: 'twitter',
24-
placeholderHash: 'UrLqFOIUS$-o_Nt6NGRkEkt7M{RjM{NHMxof',
28+
photo: augustoLopes,
2529
},
2630
{
2731
screenName: 'ruisaraiva19',
2832
name: 'Rui Saraiva',
2933
role: 'Full-Stack Developer',
3034
social: 'twitter',
31-
placeholderHash: 'UNMQLqof_LWU?FRkkqt605fk9cjZbaWBt8of',
35+
photo: ruiSaraiva,
3236
},
3337
{
3438
screenName: 'miguellteixeira',
3539
name: 'Miguel Teixeira',
3640
role: 'Full-Stack Developer',
3741
social: 'github',
38-
placeholderHash: 'UcI~*]o0uPXS?wWAMxog8_kCQ,e-tmbIVsjF',
42+
photo: miguelTeixeira,
3943
},
4044
]
4145

@@ -141,13 +145,13 @@ const FavyconInfo = ({
141145
{people.map((person) => (
142146
<div key={person.screenName} className={styles.person}>
143147
<div className={styles.personAvatar}>
144-
<LazyImage
145-
src={`/images/people/${person.screenName}@1x.png`}
146-
srcRetina={`/images/people/${person.screenName}@2x.png`}
148+
<Image
149+
src={person.photo}
147150
alt={person.name}
148-
aspectRatio="56/56"
149-
placeholderHash={person.placeholderHash}
150-
rounded
151+
width={56}
152+
height={56}
153+
placeholder="blur"
154+
layout="intrinsic"
151155
/>
152156
</div>
153157
<div>

components/favycon-wizard/index.module.scss

+6
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,18 @@
5252
}
5353

5454
.mobileBackground {
55+
position: relative;
56+
width: 100%;
57+
height: 100vh;
58+
5559
@include breakpoint-md-up {
5660
display: none;
5761
}
5862
}
5963

6064
.desktopBackground {
65+
position: relative;
66+
6167
@include breakpoint-md {
6268
display: none;
6369
}

components/favycon-wizard/index.tsx

+23-15
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,50 @@
11
import React from 'react'
22
import PropTypes from 'prop-types'
33
import classnames from 'classnames'
4-
import { LazyImage } from 'components/lazy-image'
4+
import Image from 'next/image'
55

66
import styles from './index.module.scss'
7+
import unsplashImageMobile from '../../public/images/unsplash-vertical.jpg'
8+
import unsplashImageDesktop from '../../public/images/unsplash-horizontal.jpg'
9+
import dndLight from '../../public/images/dnd-light.png'
10+
import dndDark from '../../public/images/dnd-dark.png'
711

812
type FavyconWizardProps = {
913
children: PropTypes.ReactNodeLike
1014
showDndImage: boolean
1115
}
1216

1317
const unsplashImageProps = (isMobile: boolean) => ({
14-
src: `/images/unsplash${isMobile ? '-vertical' : ''}@1x.jpg`,
15-
srcRetina: `/images/unsplash${isMobile ? '-vertical' : ''}@2x.jpg`,
16-
placeholderHash: isMobile ? 'UT0Lxlh2ghgMeSeoe@fkflf5e.e:e.e.f6fk' : 'Un0V-,h2g#gMe,f8f9fif8f6f6f8f6f7fQfQ',
17-
alt: 'Unsplash',
18-
aspectRatio: isMobile ? '614/768' : '540/354',
19-
stretch: isMobile,
18+
src: isMobile ? unsplashImageMobile : unsplashImageDesktop,
19+
width: isMobile ? undefined : 540,
20+
height: isMobile ? undefined : 354,
2021
})
2122

2223
const dndImageProps = (isDark: boolean) => ({
23-
src: `/images/dnd-${isDark ? 'dark' : 'light'}@1x.png`,
24-
srcRetina: `/images/dnd-${isDark ? 'dark' : 'light'}@2x.png`,
25-
alt: 'Drag and drop here!',
26-
aspectRatio: '185/109',
24+
src: isDark ? dndDark : dndLight,
25+
width: 185,
26+
height: 109,
2727
})
2828

2929
const FavyconWizardComponent = ({ children, showDndImage }: FavyconWizardProps) => {
3030
return (
3131
<div className={styles.root}>
3232
<div className={styles.background}>
33-
<LazyImage className={styles.mobileBackground} {...unsplashImageProps(true)} />
34-
<LazyImage className={styles.desktopBackground} {...unsplashImageProps(false)} />
33+
<div className={styles.mobileBackground}>
34+
<Image alt="Unsplash image" placeholder="blur" layout="fill" {...unsplashImageProps(true)} />
35+
</div>
36+
<div className={styles.desktopBackground}>
37+
<Image alt="Unsplash image" placeholder="blur" layout="intrinsic" {...unsplashImageProps(false)} />
38+
</div>
3539
</div>
3640
{children}
3741
<div className={classnames(styles.image, { [styles.hide]: !showDndImage })}>
38-
<LazyImage {...dndImageProps(false)} className={styles.imageLight} />
39-
<LazyImage {...dndImageProps(true)} className={styles.imageDark} />
42+
<div className={styles.imageLight}>
43+
<Image alt="Drag and drop here!" {...dndImageProps(false)} layout="intrinsic" />
44+
</div>
45+
<div className={styles.imageDark}>
46+
<Image alt="Drag and drop here!" {...dndImageProps(true)} layout="intrinsic" />
47+
</div>
4048
</div>
4149
</div>
4250
)

components/lazy-image/index.module.scss

-52
This file was deleted.

components/lazy-image/index.tsx

-76
This file was deleted.

next.config.js

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
module.exports = {
22
poweredByHeader: false,
3+
images: {
4+
deviceSizes: [375, 750, 1125],
5+
imageSizes: [56, 112, 185, 370, 370, 375, 540, 740, 750, 1080],
6+
},
37
}

package.json

+2-6
Original file line numberDiff line numberDiff line change
@@ -43,25 +43,22 @@
4343
},
4444
"dependencies": {
4545
"@fiahfy/ico-convert": "0.0.12",
46+
"@use-gesture/react": "10.2.0",
4647
"adm-zip": "0.5.9",
4748
"blurhash": "1.1.4",
4849
"classnames": "2.3.1",
4950
"multer": "1.4.3",
5051
"next": "12.0.6",
5152
"nprogress": "0.2.0",
52-
"object-fit-images": "3.2.4",
5353
"prismjs": "1.25.0",
5454
"prop-types": "15.7.2",
5555
"react": "17.0.2",
56-
"react-blurhash": "0.1.3",
5756
"react-clipboard.js": "2.0.16",
5857
"react-dom": "17.0.2",
5958
"react-dropzone": "11.4.2",
60-
"react-lazy-images": "1.1.0",
6159
"react-modal": "3.14.4",
6260
"react-transition-group": "4.4.2",
63-
"react-use": "17.3.1",
64-
"react-use-gesture": "7.0.16"
61+
"react-use": "17.3.1"
6562
},
6663
"devDependencies": {
6764
"@babel/core": "7.16.0",
@@ -88,7 +85,6 @@
8885
"@types/multer": "1.4.7",
8986
"@types/node": "16.11.11",
9087
"@types/nprogress": "0.2.0",
91-
"@types/object-fit-images": "3.2.2",
9288
"@types/prismjs": "1.16.6",
9389
"@types/react": "17.0.37",
9490
"@types/react-modal": "3.13.1",
File renamed without changes.

public/images/dnd-dark@1x.png

-5.58 KB
Binary file not shown.
File renamed without changes.

public/images/dnd-light@1x.png

-2.78 KB
Binary file not shown.
-4.52 KB
Binary file not shown.
-4.31 KB
Binary file not shown.
File renamed without changes.
-4.9 KB
Binary file not shown.
File renamed without changes.
File renamed without changes.
-8.83 KB
Binary file not shown.

public/images/unsplash@1x.jpg

-4.91 KB
Binary file not shown.

0 commit comments

Comments
 (0)