Skip to content

Commit

Permalink
Reduce the size of the Follow link (#472)
Browse files Browse the repository at this point in the history
  • Loading branch information
akirk authored Feb 14, 2025
1 parent 47c7853 commit 17a5369
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 9 deletions.
2 changes: 1 addition & 1 deletion friends.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion friends.css.map

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions friends.scss
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,14 @@ h2#page-title a.dashicons {
height: .5em;
}

.follow-button span.name {
display: none;
}

.follow-button:hover span.name {
display: inline;
}

&.format-status {
div.teaser {
display: none;
Expand Down
2 changes: 1 addition & 1 deletion templates/frontend/parts/activitypub/follow-link.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
*/

?>
<a href="<?php echo esc_url( add_query_arg( 'url', $args['url'], admin_url( 'admin.php?page=add-friend' ) ) ); ?>" class="has-icon-left" title="<?php echo esc_attr( $args['summary'] ); ?>"><span class="dashicons dashicons-plus"></span><?php echo esc_html( /* translators: %s is a username. */ sprintf( __( 'Follow %s', 'friends' ), $args['name'] ) ); ?></a>
<a href="<?php echo esc_url( add_query_arg( 'url', $args['url'], admin_url( 'admin.php?page=add-friend' ) ) ); ?>" class="has-icon-left follow-button" title="<?php echo esc_attr( $args['summary'] ); ?>"><span class="dashicons dashicons-plus"></span><?php echo wp_kses( /* translators: %s is a username. */ sprintf( __( 'Follow %s', 'friends' ), '<span class="name">' . esc_html( $args['name'] ) . '</span>' ), array( 'span' => array( 'class' => true ) ) ); ?></a>
14 changes: 8 additions & 6 deletions templates/frontend/parts/header-status.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,12 @@
<?php if ( in_array( get_post_type(), apply_filters( 'friends_frontend_post_types', array() ), true ) ) : ?>
<a href="<?php echo esc_attr( $friend_user->get_local_friends_page_url() ); ?>">
<strong><?php echo esc_html( $friend_user->display_name ); ?></strong>
<?php if ( $override_author_name && trim( str_replace( $override_author_name, '', $author_name ) ) === $author_name ) : ?>
<?php echo esc_html( $override_author_name ); ?>
<?php endif; ?>
</a>
<?php if ( $override_author_name && trim( str_replace( $override_author_name, '', $author_name ) ) === $author_name ) : ?>
<a href="<?php echo esc_attr( $friend_user->get_local_friends_page_url() ); ?>">
<?php echo esc_html( $override_author_name ); ?>
</a>
<?php endif; ?>
<?php do_action( 'friends_post_author_meta', $friend_user ); ?>
<?php else : ?>
<a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>">
Expand Down Expand Up @@ -111,10 +113,10 @@
</div>
</div>
<div class="overflow col-ml-auto">
<a class="btn btn-link collapse-post" tabindex="0" title="<?php esc_html_e( 'Double or meta/shift/cmd click to toggle all', 'friends' ); ?>">
<i class="dashicons dashicons-fullscreen-exit-alt"></i>
</a>
<div class="friends-dropdown friends-dropdown-right">
<a class="btn btn-link collapse-post" tabindex="0" title="<?php esc_html_e( 'Double or meta/shift/cmd click to toggle all', 'friends' ); ?>">
<i class="dashicons dashicons-fullscreen-exit-alt"></i>
</a>
<a class="btn btn-link friends-dropdown-toggle" tabindex="0">
<i class="dashicons dashicons-menu-alt2"></i>
</a>
Expand Down

0 comments on commit 17a5369

Please sign in to comment.