Skip to content

Commit 00022df

Browse files
committed
Fix images imports
1 parent 63faa65 commit 00022df

30 files changed

+137
-348
lines changed

apps/frontpage/components/home/share/embed-integrations.tsx

+24-19
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
import type { FC } from 'react';
2-
import React, { forwardRef } from 'react';
32
import { motion, AnimatePresence } from 'framer-motion';
43
import Image from 'next/image';
54
import { AspectRatio } from '../../ui/aspect-ratio';
65
import { IntegrationsCarousel } from './integrations-carousel';
6+
import mediumPreview from './images/medium.png';
7+
import mediumLogo from './images/medium.svg';
8+
import nextPreview from './images/next.png';
9+
import nextLogo from './images/next-js.svg';
10+
import figmaPreview from './images/figma.png';
11+
import figmaLogo from './images/figma.svg';
12+
import notionPreview from './images/notion.png';
13+
import notionLogo from './images/notion.svg';
14+
import timeFramePicker from './images/time-frame-picker.svg';
715

816
const Connector: FC<{ name: string; style: React.CSSProperties }> = ({
917
name,
@@ -73,15 +81,15 @@ const embedIntegrations = [
7381
{
7482
index: 1,
7583
name: 'NextJS',
76-
image: '/home/share/next-js.svg',
84+
image: nextLogo,
7785
color: '#000',
7886
media: (
7987
// transform is to prevent the slight jump before the animation starts
8088
<AspectRatio ratio={1202 / 910} style={{ transform: 'translate(0, 0)' }}>
81-
<img
89+
<Image
8290
alt="Embed stories using iframes in your NextJS sites"
8391
className="block w-full h-auto"
84-
src="/home/share/next.png"
92+
src={nextPreview}
8593
/>
8694
<Connector
8795
key="nextjs"
@@ -94,14 +102,14 @@ const embedIntegrations = [
94102
{
95103
index: 2,
96104
name: 'Figma',
97-
image: '/home/share/figma.svg',
105+
image: figmaLogo,
98106
color: '#000',
99107
media: (
100108
<AspectRatio ratio={1202 / 910} style={{ transform: 'translate(0, 0)' }}>
101-
<img
109+
<Image
102110
alt="Use the Storybook Connect plugin to embed stories in a Figma file"
103111
className="block w-full h-auto"
104-
src="/home/share/figma.png"
112+
src={figmaPreview}
105113
/>
106114
<Connector
107115
key="figma"
@@ -114,14 +122,14 @@ const embedIntegrations = [
114122
{
115123
index: 3,
116124
name: 'Notion',
117-
image: '/home/share/notion.svg',
125+
image: notionLogo,
118126
color: '#fff',
119127
media: (
120128
<AspectRatio ratio={1202 / 910} style={{ transform: 'translate(0, 0)' }}>
121-
<img
129+
<Image
122130
alt="Embed stories in Notion documents using the oEmbed support"
123131
className="block w-full h-auto"
124-
src="/home/share/notion.png"
132+
src={notionPreview}
125133
/>
126134
<Connector
127135
key="notion"
@@ -134,36 +142,33 @@ const embedIntegrations = [
134142
{
135143
index: 4,
136144
name: 'Medium',
137-
image: '/home/share/medium.svg',
145+
image: mediumLogo,
138146
color: '#F5C347',
139147
media: (
140148
<AspectRatio ratio={1202 / 910} style={{ transform: 'translate(0, 0)' }}>
141-
<img
149+
<Image
142150
alt="Embed stories in Medium articles using the oEmbed support"
143151
className="block w-full h-auto"
144-
src="/home/share/medium.png"
152+
src={mediumPreview}
145153
/>
146154
<Connector name="Medium" style={{ top: '53%', left: '28%' }} />
147155
</AspectRatio>
148156
),
149157
},
150158
];
151159

152-
export const EmbedIntegrations = forwardRef<HTMLImageElement>((_, ref) => {
160+
export const EmbedIntegrations = () => {
153161
return (
154162
<div className="w-full relative max-w-[800px] ml-[30px] sm:ml-[30px] md:w-[150%] md:col-[2/3] lg:ml-[120px]">
155163
<IntegrationsCarousel integrations={embedIntegrations} />
156164
<Image
157165
alt=""
158166
className="block w-[56%] max-w-[440px] h-auto absolute top-[22%] left-[-30%] opacity-100 user-select-none pointer-events-none sm:left-[-60px] lg:[-120px]"
159167
height="244"
160-
ref={ref}
161-
src="/home/share/time-frame-picker.svg"
168+
src={timeFramePicker}
162169
style={{ opacity: 0 }}
163170
width="458"
164171
/>
165172
</div>
166173
);
167-
});
168-
169-
EmbedIntegrations.displayName = 'EmbedIntegrations';
174+
};

apps/frontpage/components/home/share/integrations-carousel.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { cn } from '@repo/utils';
22
import type { ComponentProps, ReactNode, FC } from 'react';
33
import React, { useState, useRef } from 'react';
4+
import Image from 'next/image';
45
import type { Button } from '../../ui/button';
56

67
interface IntegrationProps extends ComponentProps<typeof Button> {
@@ -44,7 +45,7 @@ export const IntegrationsCarousel: FC<IntegrationsCarouselProps> = ({
4445
type="button"
4546
{...integration}
4647
>
47-
<img alt={name} src={image} />
48+
<Image alt={name || ''} src={image} />
4849
</button>
4950
))}
5051
<div className="text-zinc-600">+ and more</div>

apps/frontpage/components/home/share/player.tsx

+10-5
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,18 @@ import type { FC } from 'react';
22
import React from 'react';
33
import { motion } from 'framer-motion';
44
import { cn } from '@repo/utils';
5+
import Image from 'next/image';
56
import { AspectRatio } from '../../ui/aspect-ratio';
7+
import avatar1 from './images/avatar-1.png';
8+
import avatar2 from './images/avatar-2.png';
9+
import avatar3 from './images/avatar-3.png';
10+
import avatar4 from './images/avatar-4.png';
611

712
const players = {
8-
blue: '/home/share/avatar-1.png',
9-
red: '/home/share/avatar-2.png',
10-
yellow: '/home/share/avatar-3.png',
11-
purple: '/home/share/avatar-4.png',
13+
blue: avatar1,
14+
red: avatar2,
15+
yellow: avatar3,
16+
purple: avatar4,
1217
};
1318

1419
interface PlayerProps {
@@ -117,7 +122,7 @@ export const Player: FC<PlayerProps> = ({ x, y, type, delay, count }) => (
117122
animate: { scale: 2.14285714, opacity: 0.3 },
118123
}}
119124
/>
120-
<img
125+
<Image
121126
alt="Player"
122127
className="border-2 border-white rounded-[50%] shadow-sm block w-[28%] h-auto absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2"
123128
src={players[type]}
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,64 @@
1-
import React, { forwardRef } from 'react';
2-
import type { MotionValue } from 'framer-motion';
1+
import React from 'react';
32
import { motion } from 'framer-motion';
3+
import Image from 'next/image';
44
import { Player } from './player';
5+
import StorybookMockUI from './images/storybook-mock-ui.svg';
6+
import caret from './images/caret.svg';
7+
import arrow from './images/arrow.svg';
8+
import pointerHand from './images/pointer-hand.svg';
9+
import timeFramePicker from './images/time-frame-picker.svg';
510

611
const symbolVariants = {
712
initial: { y: 20, opacity: 0 },
813
animate: { y: 0, opacity: 1 },
914
};
1015

11-
export const PublishIntegrations = forwardRef<
12-
HTMLImageElement | null,
13-
{
14-
timeFrameStyles: {
15-
x: MotionValue<string>;
16-
y: MotionValue<string>;
17-
scale: number;
18-
opacity: number;
19-
transformOrigin: string;
20-
};
21-
}
22-
>(({ timeFrameStyles }, ref) => {
16+
export const PublishIntegrations = () => {
2317
return (
2418
<motion.div
25-
className="relative w-full max-w-[800px] md:w-[150%] md:col-[2/3]"
19+
className="relative w-full max-w-[800px] md:w-[150%]"
2620
initial="initial"
2721
viewport={{ once: true }}
2822
whileInView="animate"
2923
>
30-
<div
31-
data-chromatic="ignore"
32-
style={{
33-
position: 'absolute',
34-
top: -64,
35-
left: -64,
36-
right: 0,
37-
bottom: 0,
38-
zIndex: '-1',
39-
}}
40-
/>
41-
<img
42-
alt=""
24+
<Image
25+
alt="Storybook Mock UI"
4326
className="block w-full h-auto"
44-
src="/home/share/storybook-mock-ui.svg"
45-
/>
46-
<motion.img
47-
className="block w-[46%] max-w-[440px] h-auto absolute z-[1] top-[18%] left-[37%] select-none pointer-events-none md:top-[15%] md:left-[25%]"
48-
height="244"
49-
initial={false}
50-
src="/home/share/time-frame-picker.svg"
51-
style={timeFrameStyles}
52-
width="458"
27+
src={StorybookMockUI}
5328
/>
54-
<motion.img
29+
<Image
30+
alt=""
5531
className="block w-[46%] max-w-[440px] h-auto absolute z-[1] top-[18%] left-[37%] select-none pointer-events-none md:top-[15%] md:left-[25%]"
56-
height="244"
57-
ref={ref}
58-
style={{ opacity: 0 }}
59-
width="458"
32+
src={timeFramePicker}
6033
/>
61-
<motion.img
62-
className="absolute top-[10%] left-[32%] w-auto h-[5%]"
63-
src="/home/share/pointerhand.svg"
34+
35+
<motion.div
36+
className="absolute top-[10%] left-[32%] w-auto h-[5%] z-10"
6437
transition={{ duration: 0.4, delay: 0.8 }}
6538
variants={symbolVariants}
66-
/>
39+
>
40+
<Image alt="" src={pointerHand} width={32} />
41+
</motion.div>
6742
<Player count={2} delay={1} type="blue" x="6%" y="-12%" />
68-
<motion.img
69-
alt=""
70-
className="absolute top-[64%] left-[20%] w-auto h-[5%] ms:left-[10%]"
71-
src="/home/share/arrow.svg"
43+
<motion.div
44+
className="absolute top-[64%] left-[20%] w-auto h-[5%] ms:left-[10%] z-10"
7245
transition={{ duration: 0.4, delay: 1.6 }}
7346
variants={symbolVariants}
74-
/>
47+
>
48+
<Image alt="" src={arrow} width={32} />
49+
</motion.div>
7550
<Player count={4} delay={1.8} type="red" x="-7%" y="45%" />
7651
<Player count={2} delay={3} type="yellow" x="30%" y="56%" />
77-
<motion.img
78-
className="absolute top-[20%] left-[66%] w-auto h-[5%]"
79-
src="/home/share/caret.svg"
52+
<motion.div
53+
className="absolute top-[48%] left-[66%] w-auto h-[5%] z-10"
8054
transition={{ duration: 0.4, delay: 3.6 }}
8155
variants={symbolVariants}
82-
/>
56+
>
57+
<Image alt="" src={caret} width={24} />
58+
</motion.div>
8359
<Player count={1} delay={3.8} type="purple" x="65%" y="9%" />
8460
</motion.div>
8561
);
86-
});
62+
};
8763

8864
PublishIntegrations.displayName = 'PublishIntegrations';

0 commit comments

Comments
 (0)