Skip to content

Adding Devfile Demo Video #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@
// It's not accurate in the monorepo style
"import/no-extraneous-dependencies": "off",
// Import for import of components
"import/no-cycle": "off"
"import/no-cycle": "off",
// Disables the no img tag rule
"@next/next/no-img-element": "off"
},
"overrides": [
{
Expand Down
Binary file added public/images/devfileDemo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/devfileDemo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions src/components/GifPlayer/GifPlayer.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.container {
display: block;
margin-right: auto;
margin-left: auto;
width: 50%;
height: 50%;
}

@media only screen and (max-width: 1080px) {
.container {
width: 100%;
height: 100%;
}
}

@media only screen and (max-width: 1280px) {
.container {
width: 75%;
height: 75%;
}
}
23 changes: 23 additions & 0 deletions src/components/GifPlayer/GifPlayer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import React from 'react';
import { Card } from '@patternfly/react-core';
import styles from './GifPlayer.module.css';

export interface GifPlayerProps
extends React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement> {
src: string;

className?: string;

alt?: string;
}

export const GifPlayer: React.FC<GifPlayerProps> = ({
src,
className = '',
alt = 'loading...',
...props
}: GifPlayerProps) => (
<Card className={styles.container}>
<img {...props} className={className} src={src} alt={alt} />
</Card>
);
1 change: 1 addition & 0 deletions src/components/GifPlayer/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './GifPlayer';
9 changes: 9 additions & 0 deletions src/components/WhyDevfiles/WhyDevfiles.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
import { TextContainer } from 'custom-types';
import { Text, TextContent, TextVariants } from '@patternfly/react-core';
import { GifPlayer } from '@src/components';
import { useWindowDimensions } from '@src/util/client';
import styles from './WhyDevfiles.module.css';

export interface WhyDevfilesProps {
whyDevfiles: TextContainer;
}

export const WhyDevfiles: React.FC<WhyDevfilesProps> = (props: WhyDevfilesProps) => {
const minDemoSize = 480;
const { whyDevfiles } = props;
const { height, width } = useWindowDimensions();
const demoFile =
width !== undefined && height !== undefined && Math.min(height, width) < minDemoSize
? '/images/devfileDemo.png'
: '/images/devfileDemo.gif';

return (
<div className={styles.container}>
Expand All @@ -18,6 +26,7 @@ export const WhyDevfiles: React.FC<WhyDevfilesProps> = (props: WhyDevfilesProps)
<Text className={styles.bodyText}>{whyDevfiles.body}</Text>
</TextContent>
<br />
<GifPlayer width="1920px" height="1080px" src={demoFile} />
</div>
);
};
Expand Down
1 change: 1 addition & 0 deletions src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ export * from './NavBar';
export * from './Transitions';
export * from './ValueProposition';
export * from './WhyDevfiles';
export * from './GifPlayer';