Skip to content

Commit b705085

Browse files
authored
chore: reduce cloudinary usage (#858)
* update assets types file * replace videos by images in hands section * optimize jobs assets * optimize hero mobile asset * Reduce Cloudinary usage Reduced usage of Cloudinary in the application. * address feedback * regenerate asset types for * remove unused cloudinary script from * remove unused env:check * add missing cloudinary script to * regenerate asset types for
1 parent 7f54964 commit b705085

File tree

10 files changed

+124
-3237
lines changed

10 files changed

+124
-3237
lines changed

.changeset/seven-olives-design.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"status.app": patch
3+
---
4+
5+
chore: reduce cloudinary usage

apps/portfolio/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"format": "prettier --write .",
1313
"typecheck": "tsc",
1414
"env:check": "node -r dotenv/config ./src/config/env.server.mjs dotenv_config_path=./.env && node -r dotenv/config ./src/config/env.client.mjs dotenv_config_path=./.env && :",
15+
"sync:cloudinary": "DOTENV_CONFIG_PATH='.env.local' node -r dotenv/config scripts/generate-cloudinary-type.mjs && prettier -w 'src/app/_components/assets/types.ts'",
1516
"clean": "rimraf .next .vercel/output node_modules .turbo"
1617
},
1718
"dependencies": {

packages/status-network/scripts/generate-cloudinary-type.mjs renamed to apps/portfolio/scripts/generate-cloudinary-type.mjs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ const fetchResources = async url => {
3333
{
3434
headers: {
3535
Authorization: `Basic ${btoa(
36-
`${env.data.CLOUDINARY_API_KEY}:${env.data.CLOUDINARY_API_SECRET}`,
36+
`${env.data.CLOUDINARY_API_KEY}:${env.data.CLOUDINARY_API_SECRET}`
3737
)}`,
3838
},
39-
},
39+
}
4040
)
4141

4242
const { resources, next_cursor } = await response.json()
@@ -46,7 +46,7 @@ const fetchResources = async url => {
4646
nextCursor = next_cursor
4747
} else {
4848
console.warn(
49-
'Empty or undefined response received. Consider running the script again.',
49+
'Empty or undefined response received. Consider running the script again.'
5050
)
5151
break
5252
}
@@ -56,19 +56,19 @@ const fetchResources = async url => {
5656
}
5757

5858
const [images, videos, zipFiles] = await Promise.all(
59-
RESOURCE_URLS.map(async url => fetchResources(url)),
59+
RESOURCE_URLS.map(async url => fetchResources(url))
6060
)
6161

6262
fs.writeFile(
63-
'src/components/image/types.ts',
63+
'src/app/_components/assets/types.ts',
6464
`
6565
export type ImageType =
6666
${images
6767
.map(
6868
i =>
6969
`{ id: '${i.public_id}:${i.width}:${i.height}', alt: "${
7070
i.context?.custom?.alt ?? ''
71-
}" }`,
71+
}" }`
7272
)
7373
.join(' | ')}
7474
@@ -85,5 +85,5 @@ export type VideoId = ${[...videos]
8585
.map(z => `'${z.public_id}'`)
8686
.sort()
8787
.join(' | ')}
88-
`,
88+
`
8989
)

apps/portfolio/src/app/_components/assets/types.ts

Lines changed: 46 additions & 1030 deletions
Large diffs are not rendered by default.

apps/status.app/src/app/(website)/_components/hands-section.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Text } from '@status-im/components'
22

3-
import { Icon, Video } from '~components/assets'
3+
import { Icon, Image } from '~components/assets'
44

55
import type { ImageId } from '~components/assets'
66

@@ -9,18 +9,18 @@ const HandsSection = () => {
99
<div className="relative z-20 bg-white-100">
1010
<div className="container-lg relative pb-24 pt-40 xl:pb-40 xl:pt-20">
1111
<div className="relative grid aspect-[0.44] place-content-center 2md:aspect-[1.715]">
12-
{/* MOBILE VIDEO */}
1312
<div className="absolute -inset-x-6 top-10 scale-[1.7] sm:scale-150 2md:hidden">
14-
<Video
15-
id="Non Beta Release/Animations/Wallet_01_Mobile:990:1467"
16-
posterId="Non Beta Release/Animations/Frames/Wallet_01_Mobile_Frame:990:1467"
13+
<Image
14+
id="Non Beta Release/Animations/Frames/Wallet_01_Mobile_Frame:990:1467"
15+
alt=""
16+
aria-hidden="true"
1717
/>
1818
</div>
19-
{/* DESKTOP VIDEO */}
2019
<div className="absolute -inset-x-10 top-10 z-0 hidden h-full scale-[1.15] 2md:block">
21-
<Video
22-
id="Non Beta Release/Animations/Wallet_01:2256:1178"
23-
posterId="Non Beta Release/Animations/Frames/Wallet_01_Frame:2256:1178"
20+
<Image
21+
id="Non Beta Release/Animations/Frames/Wallet_01_Frame:2256:1178"
22+
alt=""
23+
aria-hidden="true"
2424
/>
2525
</div>
2626

apps/status.app/src/app/(website)/jobs/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,13 @@ export default async function JobsPage() {
8989
<div className="mx-auto mb-12 mt-8 max-w-[1224px] px-5 2md:mb-0 2md:mt-[-72px] 2md:px-0">
9090
<div className="relative z-[2] 2md:mx-[-18%]">
9191
<Image
92-
id="Jobs/Top Section/Jobs_01:5113:2971"
92+
id="Jobs/Top Section/Jobs_01-optimized:2448:1422"
9393
alt=""
9494
className="hidden 2md:block"
9595
priority
9696
/>
9797
<Image
98-
id="Jobs/Top Section/Jobs_01_Mobile:1745:1867"
98+
id="Jobs/Top Section/Jobs_01_Mobile-optimized:1745:1867"
9999
alt=""
100100
className="2md:hidden"
101101
/>

apps/status.app/src/app/(website)/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export default async function HomePage() {
109109
</div>
110110
</div>
111111
<Image
112-
id="Non Beta Release/Illustrations/Hero_Non_Beta_Release_Mobile_Long:4662:2579"
112+
id="Non Beta Release/Illustrations/Hero_Non_Beta_Release_Mobile_Long-optimized:1470:813"
113113
alt=""
114114
aria-hidden
115115
width={735}

0 commit comments

Comments
 (0)