-
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.
Improve defaults for Twitter preview
- Loading branch information
1 parent
17692a5
commit bb81b40
Showing
6 changed files
with
26 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
import { __ } from '@wordpress/i18n'; | ||
import { formatTweetDate } from '../helpers'; | ||
import { HeaderProps } from './types'; | ||
|
||
export const Header: React.FC< HeaderProps > = ( { name, screenName, date } ) => { | ||
return ( | ||
<div className="twitter-preview__header"> | ||
<span className="twitter-preview__name">{ name }</span> | ||
<span className="twitter-preview__screen-name">{ screenName }</span> | ||
<span className="twitter-preview__name"> | ||
{ name || __( 'Account Name', 'social-previews' ) } | ||
</span> | ||
<span className="twitter-preview__screen-name">{ screenName || '@account' }</span> | ||
<span>·</span> | ||
<span className="twitter-preview__date">{ formatTweetDate( date ) }</span> | ||
<span className="twitter-preview__date">{ formatTweetDate( date || Date.now() ) }</span> | ||
</div> | ||
); | ||
}; |
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