-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Customer Home: Promote Free Photo Library (#39506)
Promotes the Free Photo Library in the Customer Home with a video demonstrating how to use it and a link to the support document on it
- Loading branch information
Showing
5 changed files
with
105 additions
and
0 deletions.
There are no files selected for viewing
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
BIN
+50.1 KB
client/assets/images/customer-home/free-photo-library-video-prompt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
77 changes: 77 additions & 0 deletions
77
client/my-sites/customer-home/free-photo-library-card/index.jsx
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 |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import React, { Fragment, useState } from 'react'; | ||
import { useTranslate } from 'i18n-calypso'; | ||
import { Button, Card, Dialog } from '@automattic/components'; | ||
import { isDesktop } from '@automattic/viewport'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import CardHeading from 'components/card-heading'; | ||
import { localizeUrl } from 'lib/i18n-utils'; | ||
|
||
/** | ||
* Style dependencies | ||
*/ | ||
import './style.scss'; | ||
|
||
/** | ||
* Image dependencies | ||
*/ | ||
import freePhotoLibraryThumbnail from 'assets/images/customer-home/free-photo-library-thumbnail.png'; | ||
import freePhotoLibraryVideoPrompt from 'assets/images/customer-home/free-photo-library-video-prompt.png'; | ||
|
||
const FreePhotoLibraryCard = () => { | ||
const [ showDialog, setShowDialog ] = useState( false ); | ||
const translate = useTranslate(); | ||
|
||
const toggleDialog = () => setShowDialog( ! showDialog ); | ||
|
||
return ( | ||
<Fragment> | ||
<Dialog additionalClassNames="free-photo-library-card__dialog" isVisible={ showDialog }> | ||
<video | ||
className="free-photo-library-card__demonstration-video" | ||
controls | ||
muted | ||
autoPlay | ||
poster={ freePhotoLibraryThumbnail } | ||
> | ||
<source | ||
src="https://wpcom.files.wordpress.com/2020/02/free-photo-library-demonstration.mp4" | ||
type="video/mp4" | ||
/> | ||
</video> | ||
<div className="free-photo-library-card__dialog-close"> | ||
<Button onClick={ toggleDialog }>{ translate( 'Close' ) }</Button> | ||
</div> | ||
</Dialog> | ||
<Card className="free-photo-library-card"> | ||
{ isDesktop() && ( | ||
<button onClick={ toggleDialog }> | ||
<img | ||
className="free-photo-library-card__demonstration-image" | ||
src={ freePhotoLibraryVideoPrompt } | ||
alt={ translate( 'Free Photo Library demonstration' ) } | ||
/> | ||
</button> | ||
) } | ||
<CardHeading>{ translate( 'Over 40,000 Free Photos' ) }</CardHeading> | ||
<p className="free-photo-library-card__text customer-home__card-subheader"> | ||
{ translate( | ||
'The WordPress.com Free Photo Library integrates ' + | ||
'your site with beautiful copyright-free photos to ' + | ||
'create stunning designs.' | ||
) } | ||
</p> | ||
<Button href={ localizeUrl( 'https://support.wordpress.com/free-photo-library/' ) }> | ||
{ translate( 'Learn more' ) } | ||
</Button> | ||
</Card> | ||
</Fragment> | ||
); | ||
}; | ||
|
||
export default FreePhotoLibraryCard; |
26 changes: 26 additions & 0 deletions
26
client/my-sites/customer-home/free-photo-library-card/style.scss
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
.free-photo-library-card { | ||
.free-photo-library-card__demonstration-image { | ||
cursor: pointer; | ||
margin-bottom: 12px; | ||
width: 100%; | ||
} | ||
|
||
.button { | ||
float: right; | ||
} | ||
} | ||
|
||
.free-photo-library-card__dialog-close { | ||
margin-top: 12px; | ||
text-align: right; | ||
} | ||
|
||
.free-photo-library-card__demonstration-video { | ||
max-height: 600px; | ||
max-width: 800px; | ||
width: 100%; | ||
|
||
&:focus { | ||
outline: none; | ||
} | ||
} |
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