File tree Expand file tree Collapse file tree 14 files changed +68
-27
lines changed
sections/platform-section/features Expand file tree Collapse file tree 14 files changed +68
-27
lines changed Original file line number Diff line number Diff line change @@ -4,9 +4,11 @@ Marketing website for Commit (commit.dev)
44### Importing static images
55
66** 1)** Place the image you want to display in the ` /static/ ` folder
7- ** 2)** Display the image with [ ` <Image > ` ] ( ./components/media/image.js ) component:
7+ ** 2)** Display the image with [ ` <StaticImage > ` ] ( ./components/media/static- image.js ) component:
88``` jsx
9- < Image {... getStaticImage (' my-image-name.png' )} alt= " My image" / >
9+ import { StaticImage } from ' components'
10+
11+ < StaticImage name= " my-image-name.png" alt= " My image" / >
1012```
1113
1214Images are automatically generated at build time and lazy-loaded at run time.
@@ -34,9 +36,11 @@ Processing ~/path/to/video.mov (13.4 MB)...
3436 -- generated static/videos/video.mp4 (1.28 MB)
3537```
3638
37- ** 3)** Use generated files with [ ` <BackgroundVideo > ` ] ( ./components/media/video.js ) component:
39+ ** 3)** Use generated files with [ ` <StaticBackgroundVideo > ` ] ( ./components/media/background- video.js ) component:
3840``` jsx
39- < BackgroundVideo {... getStaticVideo (' video' )} alt= " My background video" / >
41+ import { StaticBackgroundVideo } from ' components'
42+
43+ < StaticBackgroundVideo name= " video" alt= " My background video" / >
4044```
4145
4246Videos are lazy-loaded at run time.
Original file line number Diff line number Diff line change @@ -13,3 +13,4 @@ export { default as SocialIcons } from './social-icons'
1313export { default as Testimonials } from './testimonials'
1414export { default as Text } from './text'
1515export { default as TextArea } from './textarea'
16+ export * from './media'
Original file line number Diff line number Diff line change 1+ import { Video } from './video'
2+
3+ function BackgroundVideo ( props ) {
4+ return < Video muted data-autoplay = "" loop playsinline { ...props } />
5+ }
6+
7+ export { BackgroundVideo }
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change @@ -56,4 +56,4 @@ Image.propTypes = {
5656 className : string ,
5757}
5858
59- export default Image
59+ export { Image }
Original file line number Diff line number Diff line change @@ -17,6 +17,10 @@ const GlobalMediaStyles = createGlobalStyle`
1717 ${ lazyStyles }
1818`
1919
20- export { default as Image } from './image'
21- export { Video , BackgroundVideo } from './video'
20+ export { Image } from './image'
21+ export { StaticImage } from './static-image'
22+ export { Video } from './video'
23+ export { StaticVideo } from './static-video'
24+ export { BackgroundVideo } from './background-video'
25+ export { StaticBackgroundVideo } from './static-background-video'
2226export { GlobalMediaStyles }
Original file line number Diff line number Diff line change 1+ import { StaticVideo } from './static-video'
2+
3+ function StaticBackgroundVideo ( props ) {
4+ return < StaticVideo muted data-autoplay = "" loop playsinline { ...props } />
5+ }
6+
7+ export { StaticBackgroundVideo }
Original file line number Diff line number Diff line change 1+ import { string } from 'prop-types'
2+
3+ import { getStaticImage } from './get-static-image'
4+ import { Image } from './image'
5+
6+ function StaticImage ( { name, ...otherProps } ) {
7+ return < Image { ...getStaticImage ( name ) } { ...otherProps } />
8+ }
9+
10+ StaticImage . propTypes = {
11+ name : string ,
12+ }
13+
14+ export { StaticImage }
Original file line number Diff line number Diff line change 1+ import { string } from 'prop-types'
2+
3+ import { getStaticVideo } from './get-static-video'
4+ import { Video } from './video'
5+
6+ function StaticVideo ( { name, ...otherProps } ) {
7+ return < Video { ...getStaticVideo ( name ) } { ...otherProps } />
8+ }
9+
10+ StaticVideo . propTypes = {
11+ name : string ,
12+ }
13+
14+ export { StaticVideo }
You can’t perform that action at this time.
0 commit comments