fix: Add Empty Summary placeholder and show Full Novel Title (Closes #355)
This commit is contained in:
@@ -116,7 +116,6 @@ const NovelTitle = ({ theme, children, onLongPress, onPress }) => (
|
||||
<Text
|
||||
onLongPress={onLongPress}
|
||||
onPress={onPress}
|
||||
numberOfLines={2}
|
||||
style={[styles.novelTitle, { color: theme.textColorPrimary }]}
|
||||
>
|
||||
{children}
|
||||
@@ -124,10 +123,7 @@ const NovelTitle = ({ theme, children, onLongPress, onPress }) => (
|
||||
);
|
||||
|
||||
const NovelAuthor = ({ theme, children }) => (
|
||||
<Text
|
||||
style={[styles.novelAuthor, { color: theme.textColorSecondary }]}
|
||||
numberOfLines={2}
|
||||
>
|
||||
<Text style={[styles.novelAuthor, { color: theme.textColorSecondary }]}>
|
||||
{children}
|
||||
</Text>
|
||||
);
|
||||
@@ -242,11 +238,8 @@ const styles = StyleSheet.create({
|
||||
marginBottom: 0,
|
||||
paddingTop: 90,
|
||||
},
|
||||
coverImage: {
|
||||
height: 270,
|
||||
},
|
||||
coverImage: {},
|
||||
linearGradient: {
|
||||
height: 271,
|
||||
flex: 1,
|
||||
},
|
||||
novelThumbnail: {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { getString } from '@strings/translations';
|
||||
import React, { useState } from 'react';
|
||||
import { Pressable, StyleSheet, Text, View } from 'react-native';
|
||||
import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||
@@ -19,7 +20,11 @@ const NovelSummary: React.FC<NovelSummaryProps> = ({
|
||||
const iconBackground = `${theme.colorPrimaryDark}D1`;
|
||||
|
||||
const [expanded, setExpanded] = useState(isExpanded);
|
||||
const toggleExpanded = () => setExpanded(!expanded);
|
||||
const toggleExpanded = () => {
|
||||
if (summary) {
|
||||
setExpanded(!expanded);
|
||||
}
|
||||
};
|
||||
|
||||
const bottom = expanded ? 0 : 4;
|
||||
const containerBottomPadding = expanded ? 24 : 8;
|
||||
@@ -36,24 +41,26 @@ const NovelSummary: React.FC<NovelSummaryProps> = ({
|
||||
style={[styles.summaryText, { color: textColor }]}
|
||||
numberOfLines={expanded ? Number.MAX_SAFE_INTEGER : 3}
|
||||
>
|
||||
{summary}
|
||||
{summary || getString('novelScreen.noSummary')}
|
||||
</Text>
|
||||
<View
|
||||
style={[
|
||||
styles.iconContainer,
|
||||
{
|
||||
backgroundColor: iconBackground,
|
||||
bottom,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<MaterialCommunityIcons
|
||||
name={expanded ? 'chevron-up' : 'chevron-down'}
|
||||
color={theme.textColorPrimary}
|
||||
size={24}
|
||||
style={[{ backgroundColor: theme.colorPrimaryDark }, styles.icon]}
|
||||
/>
|
||||
</View>
|
||||
{summary ? (
|
||||
<View
|
||||
style={[
|
||||
styles.iconContainer,
|
||||
{
|
||||
backgroundColor: iconBackground,
|
||||
bottom,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<MaterialCommunityIcons
|
||||
name={expanded ? 'chevron-up' : 'chevron-down'}
|
||||
color={theme.textColorPrimary}
|
||||
size={24}
|
||||
style={[{ backgroundColor: theme.colorPrimaryDark }, styles.icon]}
|
||||
/>
|
||||
</View>
|
||||
) : null}
|
||||
</Pressable>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -91,6 +91,7 @@
|
||||
"continueReading": "Continue reading",
|
||||
"chapters": "chapters",
|
||||
"migrate": "Migrate",
|
||||
"noSummary": "No summary",
|
||||
"bottomSheet": {
|
||||
"filter": "Filter",
|
||||
"sort": "Sort",
|
||||
|
||||
@@ -72,6 +72,7 @@ export interface StringMap {
|
||||
'novelScreen.continueReading': 'string';
|
||||
'novelScreen.chapters': 'string';
|
||||
'novelScreen.migrate': 'string';
|
||||
'novelScreen.noSummary': 'string';
|
||||
'novelScreen.bottomSheet.filter': 'string';
|
||||
'novelScreen.bottomSheet.sort': 'string';
|
||||
'novelScreen.bottomSheet.display': 'string';
|
||||
|
||||
Reference in New Issue
Block a user