Skip to content

Commit ba7db00

Browse files
committed
Add share link to date
1 parent 0ff3b3e commit ba7db00

File tree

7 files changed

+26
-12
lines changed

7 files changed

+26
-12
lines changed

assets/app.css

+5-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,11 @@
181181
flex-wrap: nowrap;
182182
-webkit-box-align: start;
183183
-ms-flex-align: start;
184-
align-items: flex-start; }
184+
align-items: flex-start;
185+
text-decoration: none; }
186+
187+
.liveblog-meta-time {
188+
display: block; }
185189

186190
.liveblog-meta-time span {
187191
display: block; }

assets/app.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/app.js.map

+1-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/theme.css

+8-1
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,18 @@
3131
color: #666;
3232
}
3333

34-
.liveblog-meta-time {
34+
.entry-content .liveblog-meta-time {
3535
-ms-flex-preferred-size: 60px;
3636
flex-basis: 60px;
3737
}
3838

39+
.entry-content .liveblog-meta-time,
40+
.entry-content .liveblog-meta-time:hover,
41+
.entry-content .liveblog-meta-time:focus {
42+
-webkit-box-shadow: none;
43+
box-shadow: none;
44+
}
45+
3946
.liveblog-meta-time span {
4047
font-size: 10px;
4148
line-height: 12px;

classes/class-wpcom-liveblog-entry.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,9 @@ public function get_timestamp() {
9595

9696
public function for_json() {
9797
$entry_id = $this->replaces ? $this->replaces : $this->get_id();
98-
$avatar_size = apply_filters( 'liveblog_entry_avatar_size', self::default_avatar_size );
99-
$css_classes = implode( ' ', get_comment_class( '', $entry_id, $this->comment->comment_post_ID ) );
98+
$avatar_size = apply_filters( 'liveblog_entry_avatar_size', self::default_avatar_size );
99+
$css_classes = implode( ' ', get_comment_class( '', $entry_id, $this->comment->comment_post_ID ) );
100+
$share_link = get_permalink( $this->get_post_id() ) . '#' . $entry_id;
100101
$entry = array(
101102
'id' => $entry_id,
102103
'type' => $this->get_type(),
@@ -108,6 +109,7 @@ public function for_json() {
108109
'avatar_img' => get_avatar( $this->comment->comment_author_email, $avatar_size ),
109110
'author_link' => get_comment_author_link( $entry_id ),
110111
'entry_time' => get_comment_date( 'U', $entry_id ),
112+
'share_link' => $share_link,
111113
);
112114
$entry = apply_filters( 'liveblog_entry_for_json', $entry, $this );
113115
return (object) $entry;

src/react/containers/EntryContainer.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ class EntryContainer extends Component {
7373
className={`liveblog-entry ${entry.key_event ? 'is-key-event' : ''} ${entry.css_classes}`}
7474
>
7575
<header className="liveblog-meta">
76-
<div className="liveblog-meta-time">
76+
<a className="liveblog-meta-time" href={entry.share_link} target="_blank">
7777
<span>{timeAgo(entry.entry_time)}</span>
7878
<span>{formattedTime(entry.entry_time)}</span>
79-
</div>
79+
</a>
8080
<div className="liveblog-meta-author">
8181
<div
8282
className="liveblog-meta-authour-avatar"

src/styles/core/app/_entry.scss

+5
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
display: flex;
99
flex-wrap: nowrap;
1010
align-items: flex-start;
11+
text-decoration: none;
12+
}
13+
14+
.liveblog-meta-time {
15+
display: block;
1116
}
1217

1318
.liveblog-meta-time span {

0 commit comments

Comments
 (0)