-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from bodrovphone/zadelis-components
refactor with next/img
- Loading branch information
Showing
11 changed files
with
106 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,29 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import classNames from 'classnames'; | ||
import React from "react"; | ||
import PropTypes from "prop-types"; | ||
import classNames from "classnames"; | ||
import Image from "next/image"; | ||
|
||
const GifPlayer = ({ gif, still, playing, toggle, ...rest }) => ( | ||
<div | ||
className={classNames('gif_player', { 'playing': playing })} | ||
onMouseEnter={toggle} onMouseLeave={toggle} | ||
className={classNames("gif_player", { playing: playing })} | ||
onMouseEnter={toggle} | ||
onMouseLeave={toggle} | ||
> | ||
<div className="play_button" /> | ||
<img {...rest} src={playing ? (gif || still) : (still || gif)} /> | ||
<Image | ||
width={75} | ||
height={75} | ||
{...rest} | ||
src={playing ? gif || still : still || gif} | ||
/> | ||
</div> | ||
); | ||
|
||
GifPlayer.propTypes = { | ||
gif: PropTypes.string, | ||
still: PropTypes.string, | ||
playing: PropTypes.bool, | ||
toggle: PropTypes.func | ||
toggle: PropTypes.func, | ||
}; | ||
|
||
export default GifPlayer; | ||
export default GifPlayer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
f6b95da
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: