Link to author from book details

Co-authored-by: plmcgrn <889547+plmcgrn@users.noreply.github.com>

Closes #3356
pull/3365/head
Bogdan 2 months ago
parent 93ee466780
commit b8c295727a

@ -2,11 +2,11 @@ import PropTypes from 'prop-types';
import React from 'react';
import Link from 'Components/Link/Link';
function AuthorNameLink({ titleSlug, authorName }) {
function AuthorNameLink({ titleSlug, authorName, ...otherProps }) {
const link = `/author/${titleSlug}`;
return (
<Link to={link}>
<Link to={link} {...otherProps}>
{authorName}
</Link>
);

@ -84,9 +84,15 @@
font-size: 20px;
}
.authorLink {
composes: link from '~Components/Link/Link.css';
margin-right: 15px;
color: var(--white);
}
.duration {
margin-right: 15px;
margin-left: 10px;
}
.detailsLabel {

@ -2,6 +2,7 @@
// Please do not change this file!
interface CssExports {
'alternateTitlesIconContainer': string;
'authorLink': string;
'backdrop': string;
'backdropOverlay': string;
'cover': string;

@ -2,6 +2,7 @@ import moment from 'moment';
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import TextTruncate from 'react-text-truncate';
import AuthorNameLink from 'Author/AuthorNameLink';
import BookCover from 'Book/BookCover';
import HeartRating from 'Components/HeartRating';
import Icon from 'Components/Icon';
@ -113,7 +114,7 @@ class BookDetailsHeader extends Component {
className={styles.monitorToggleButton}
monitored={monitored}
isSaving={isSaving}
size={isSmallScreen ? 30: 40}
size={isSmallScreen ? 30 : 40}
onPress={onMonitorTogglePress}
/>
</div>
@ -131,7 +132,12 @@ class BookDetailsHeader extends Component {
</div>
<div>
{author.authorName}
<AuthorNameLink
className={styles.authorLink}
titleSlug={author.titleSlug}
authorName={author.authorName}
/>
{
!!pageCount &&
<span className={styles.duration}>

@ -2,3 +2,7 @@
margin-right: 5px;
color: var(--themeRed);
}
.rating {
margin-right: 15px;
}

@ -2,6 +2,7 @@
// Please do not change this file!
interface CssExports {
'heart': string;
'rating': string;
}
export const cssExports: CssExports;
export default cssExports;

@ -6,7 +6,7 @@ import styles from './HeartRating.css';
function HeartRating({ rating, iconSize }) {
return (
<span>
<span className={styles.rating}>
<Icon
className={styles.heart}
name={icons.HEART}

Loading…
Cancel
Save