Skip to content

Commit befe2eb

Browse files
feat(HeaderComponent): Implement horizontal layout for cover image and details; enhance styles for better presentation
feat(Redux): Add clearSearch action to reset search state; update blacklist in persistConfig to include 'Search' refactor(Library): Remove unused flatListRef and import for cleaner code
1 parent 0d3dead commit befe2eb

4 files changed

Lines changed: 70 additions & 67 deletions

File tree

src/Redux/Reducers/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,9 @@ const Reducers = createSlice({
240240
state.Search = [action.payload, ...state.Search];
241241
// state.Search.push(action.payload);
242242
},
243+
clearSearch: state => {
244+
state.Search = [];
245+
},
243246
StopLoading: state => {
244247
state.loading = false;
245248
},
@@ -571,6 +574,7 @@ export const {
571574
DeleteDownloadedComicBook,
572575
updateDownloadedComicBook,
573576
clearHistory,
577+
clearSearch,
574578
setScrollPreference,
575579
rewardAdsShown,
576580
markOfflineMovedAlertSeen,

src/Redux/Store/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const persistConfig = {
1414
key: 'root',
1515
version: 1,
1616
storage: storage,
17-
blacklist: ['error', 'status', 'loading', 'downTime', 'hasRewardAdsShown'],
17+
blacklist: ['error', 'status', 'loading', 'downTime', 'hasRewardAdsShown', 'Search'],
1818
// Important: Don't write until rehydration is complete
1919
writeDelayed: true,
2020
};

src/Screens/Comic/Details/Components/HeaderComponent.js

Lines changed: 65 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import {
1515
} from 'react-native-responsive-screen';
1616
import {useDispatch, useSelector} from 'react-redux';
1717

18-
1918
import LinearGradient from 'react-native-linear-gradient';
2019
import Ionicons from 'react-native-vector-icons/Ionicons';
2120

@@ -138,12 +137,9 @@ const HeaderComponent = memo(
138137
</View>
139138
</View>
140139

141-
{/* Cover Image Section */}
142-
<View
143-
style={[
144-
styles.coverSection,
145-
Platform.isPad && {marginTop: widthPercentageToDP('10%')},
146-
]}>
140+
{/* Horizontal Layout: Cover Image Left, Details Right */}
141+
<View style={styles.contentSection}>
142+
{/* Left - Cover Image */}
147143
<View style={styles.coverContainer}>
148144
<Image
149145
style={styles.coverImage}
@@ -156,33 +152,37 @@ const HeaderComponent = memo(
156152
<View style={styles.shineOverlay} />
157153
</View>
158154

159-
<Text style={styles.comicTitle}>
160-
{ComicDetail?.title ?? title}
161-
</Text>
162-
</View>
155+
{/* Right - Comic Info */}
156+
<View style={styles.infoContainer}>
157+
<Text style={styles.comicTitle} numberOfLines={2}>
158+
{ComicDetail?.title ?? title}
159+
</Text>
163160

164-
{/* Meta Info Section */}
165-
<View style={styles.metaSection}>
166-
<Text style={styles.metaText}>{formatMetaInfo()}</Text>
167-
168-
{/* Genre Tags */}
169-
{Array.isArray(ComicDetail?.genres) && ComicDetail.genres.length > 0 && (
170-
<View style={styles.genreContainer}>
171-
{ComicDetail.genres.slice(0, 3).map((genre, idx) => (
172-
<View key={idx} style={styles.genrePill}>
173-
<Text style={styles.genreText}>{genre}</Text>
174-
</View>
175-
))}
176-
</View>
177-
)}
178-
179-
{ComicDetail?.summary ? (
180-
<View style={styles.descriptionContainer}>
181-
<DescriptionView vol={ComicDetail?.summary} />
182-
</View>
183-
) : null}
161+
{/* Meta Info */}
162+
<Text style={styles.metaText} numberOfLines={2}>
163+
{formatMetaInfo()}
164+
</Text>
165+
166+
{/* Genre Tags */}
167+
{Array.isArray(ComicDetail?.genres) && ComicDetail.genres.length > 0 && (
168+
<View style={styles.genreContainer}>
169+
{ComicDetail.genres.slice(0, 2).map((genre, idx) => (
170+
<View key={idx} style={styles.genrePill}>
171+
<Text style={styles.genreText}>{genre}</Text>
172+
</View>
173+
))}
174+
</View>
175+
)}
176+
</View>
184177
</View>
185178

179+
{/* Description - Below the horizontal layout */}
180+
{ComicDetail?.summary ? (
181+
<View style={styles.descriptionContainer}>
182+
<DescriptionView vol={ComicDetail?.summary} />
183+
</View>
184+
) : null}
185+
186186
{/* Tab Bar */}
187187
<View style={styles.tabBarContainer}>
188188
<View style={styles.tabBar}>
@@ -222,7 +222,7 @@ const styles = StyleSheet.create({
222222
top: 0,
223223
left: 0,
224224
right: 0,
225-
height: heightPercentageToDP('38%'),
225+
height: heightPercentageToDP('30%'),
226226
overflow: 'hidden',
227227
},
228228
backgroundImage: {
@@ -300,77 +300,78 @@ const styles = StyleSheet.create({
300300
justifyContent: 'center',
301301
alignItems: 'center',
302302
},
303-
coverSection: {
304-
alignItems: 'center',
305-
marginTop: -4,
303+
// New horizontal layout styles
304+
contentSection: {
305+
flexDirection: 'row',
306+
alignItems: 'flex-start',
307+
paddingHorizontal: 16,
308+
marginTop: 8,
309+
gap: 16,
306310
},
307311
coverContainer: {
308-
borderRadius: 12,
312+
borderRadius: 10,
309313
backgroundColor: 'rgba(255, 255, 255, 0.1)',
310-
padding: 6,
314+
padding: 4,
311315
shadowColor: '#000',
312-
shadowOffset: {width: 0, height: 6},
313-
shadowOpacity: 0.35,
314-
shadowRadius: 12,
315-
elevation: 10,
316+
shadowOffset: {width: 0, height: 4},
317+
shadowOpacity: 0.3,
318+
shadowRadius: 8,
319+
elevation: 8,
316320
},
317321
coverImage: {
318-
width: widthPercentageToDP('28%'),
319-
height: heightPercentageToDP('20%'),
322+
width: widthPercentageToDP('22%'),
323+
height: heightPercentageToDP('16%'),
320324
borderRadius: 8,
321325
},
322326
shineOverlay: {
323327
position: 'absolute',
324-
top: 6,
325-
left: 6,
326-
right: 6,
328+
top: 4,
329+
left: 4,
330+
right: 4,
327331
height: '50%',
328332
backgroundColor: 'rgba(255,255,255,0.05)',
329333
borderTopLeftRadius: 8,
330334
borderTopRightRadius: 8,
331335
},
336+
infoContainer: {
337+
flex: 1,
338+
justifyContent: 'flex-start',
339+
paddingTop: 4,
340+
},
332341
comicTitle: {
333-
fontSize: 18,
342+
fontSize: 17,
334343
fontWeight: '700',
335344
color: '#fff',
336-
textAlign: 'center',
337-
marginTop: 12,
338345
marginBottom: 6,
339-
paddingHorizontal: 24,
340-
},
341-
metaSection: {
342-
paddingHorizontal: 20,
343-
gap: 4,
344-
marginTop: 4,
346+
lineHeight: 22,
345347
},
346348
metaText: {
347349
fontSize: 12,
348350
color: 'rgba(255, 255, 255, 0.7)',
349-
textAlign: 'center',
350351
lineHeight: 18,
352+
marginBottom: 8,
351353
},
352354
genreContainer: {
353355
flexDirection: 'row',
354356
flexWrap: 'wrap',
355-
justifyContent: 'center',
356-
gap: 8,
357-
marginTop: 4,
357+
gap: 6,
358358
},
359359
genrePill: {
360360
backgroundColor: 'rgba(255, 255, 255, 0.1)',
361-
paddingHorizontal: 12,
362-
paddingVertical: 5,
363-
borderRadius: 16,
361+
paddingHorizontal: 10,
362+
paddingVertical: 4,
363+
borderRadius: 12,
364364
borderWidth: 1,
365365
borderColor: 'rgba(255, 255, 255, 0.1)',
366366
},
367367
genreText: {
368-
fontSize: 11,
368+
fontSize: 10,
369369
color: 'rgba(255, 255, 255, 0.8)',
370370
fontWeight: '500',
371371
},
372372
descriptionContainer: {
373-
marginTop: 8,
373+
marginTop: 12,
374+
paddingHorizontal: 16,
374375
},
375376
tabBarContainer: {
376377
marginTop: 12,

src/Screens/Comic/Library/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import {NAVIGATION} from '../../../Constants';
2626
import {useSelector, useDispatch} from 'react-redux';
2727
import {getComicsHome} from '../APIs/Home';
2828
import HistoryCard from './Components/HistoryCard';
29-
import {AppendAd} from '../../../InkNest-Externals/Ads/AppendAd';
3029
import AnimeAdbanner from '../../../Components/UIComp/AnimeAdBanner/AnimeAdbanner';
3130
import {clearHistory} from '../../../Redux/Reducers';
3231
import {ComicHostName} from '../../../Utils/APIs';
@@ -41,7 +40,6 @@ const getSectionColor = (index) => {
4140
};
4241

4342
export function Library({navigation}) {
44-
const flatListRef = useRef(null);
4543
const [comicsData, setComicsData] = useState({});
4644
const [loading, setLoading] = useState(false);
4745
const [type, setType] = useState('readcomicsonline');

0 commit comments

Comments
 (0)