From cc94bbd152fa4945f453622b1dd27094f0b9dc28 Mon Sep 17 00:00:00 2001 From: Rajarshee Chatterjee Date: Sat, 10 Dec 2022 09:34:29 +0530 Subject: [PATCH] fix: Tweak Chapter Drawer UI --- .../reader/components/ChapterDrawer.js | 159 ++++++++---------- strings/languages/en/strings.json | 3 +- strings/types/index.ts | 4 + 3 files changed, 78 insertions(+), 88 deletions(-) diff --git a/src/screens/reader/components/ChapterDrawer.js b/src/screens/reader/components/ChapterDrawer.js index a9feb562..4edab15b 100644 --- a/src/screens/reader/components/ChapterDrawer.js +++ b/src/screens/reader/components/ChapterDrawer.js @@ -1,16 +1,16 @@ import React, { useEffect, useMemo, useRef, useState } from 'react'; -import { StyleSheet, View } from 'react-native'; -import { Text, TouchableRipple } from 'react-native-paper'; +import { StyleSheet, View, Pressable } from 'react-native'; +import { Text } from 'react-native-paper'; import color from 'color'; import { useTheme } from '@hooks/useTheme'; import { FlashList } from '@shopify/flash-list'; import { Button, LoadingScreenV2 } from '@components/index'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; -import { LinearGradient } from 'expo-linear-gradient'; import { getString } from '@strings/translations'; import { useNovel, useSettings, usePreferences } from '@hooks/reduxHooks'; import { useDispatch } from 'react-redux'; import { setNovel, getNovelAction } from '@redux/novel/novel.actions'; +import { dividerColor } from '@theme/colors'; const ChapterDrawer = ({ state: st, navigation }) => { const theme = useTheme(); @@ -87,59 +87,48 @@ const ChapterDrawer = ({ state: st, navigation }) => { ...item, }); }; - const renderItem = ({ item }) => { - let current = {}; - if (item.chapterId === currentChapterId) { - current = { - backgroundColor: color(theme.secondaryContainer).alpha(0.5).string(), - }; - } - return ( - ( + + changeChapter(item)} - borderless={true} + style={styles.chapterCtn} > - + {item.chapterName} - - ); - }; - const ListHeader = () => { - return ( - <> - - - - ); - }; + {item.releaseDate && ( + {item.releaseDate} + )} + + + ); + const ListFooter = () => { return ( - <> - +