Minor fixes

This commit is contained in:
Rajarshee Chatterjee
2021-07-18 18:21:25 +05:30
parent a2c6e9fe58
commit 7db4e4b872
11 changed files with 134 additions and 97 deletions
+1 -2
View File
@@ -83,11 +83,10 @@ const styles = StyleSheet.create({
flexDirection: "row",
alignItems: "center",
paddingHorizontal: 16,
marginBottom: 12,
marginBottom: 8,
borderRadius: 8,
marginHorizontal: 12,
elevation: 2,
backgroundColor: "white",
},
container: {
flex: 1,
+7 -2
View File
@@ -14,8 +14,10 @@ import {
midnightDuskTheme,
greenAppleTheme,
irisBlueTheme,
hotPinkTheme,
strawberryDaiquiri,
takoTheme,
yinYangTheme,
springBlossomTheme,
} from "../../theme/theme";
const themes = {
@@ -25,8 +27,10 @@ const themes = {
3: midnightDuskTheme,
4: greenAppleTheme,
5: irisBlueTheme,
6: hotPinkTheme,
7: strawberryDaiquiri,
8: takoTheme,
9: yinYangTheme,
10: springBlossomTheme,
};
/**
@@ -105,6 +109,7 @@ const settingsReducer = (state = initialState, action) => {
...themes[0],
colorAccent: state.theme.colorAccent,
rippleColor: state.theme.rippleColor,
colorButtonText: state.theme.colorButtonText,
id: state.theme.id,
name: state.theme.name,
}
@@ -251,7 +251,7 @@ const LibraryFilterSheet = ({
indicatorStyle={{ backgroundColor: theme.colorAccent }}
style={{ backgroundColor: theme.colorPrimary }}
renderLabel={({ route, focused, color }) => (
<Text style={{ color, margin: 8 }}>{route.title}</Text>
<Text style={{ color }}>{route.title}</Text>
)}
inactiveColor={theme.textColorSecondary}
activeColor={theme.colorAccent}
-48
View File
@@ -13,11 +13,6 @@ import { Button, Dialog, Portal } from "react-native-paper";
const AdvancedSettings = ({ navigation }) => {
const theme = useTheme();
const dispatch = useDispatch();
const [visible, setVisible] = useState(false);
const showDialog = () => setVisible(true);
const hideDialog = () => setVisible(false);
/**
* Confirm Clear Database Dialog
@@ -37,51 +32,8 @@ const AdvancedSettings = ({ navigation }) => {
onPress={showClearDatabaseDialog}
theme={theme}
/>
<ListItem
title="Clear history"
description="Delete reading history for all novels"
onPress={showDialog}
theme={theme}
/>
</ListSection>
<Portal>
<Dialog
visible={visible}
onDismiss={hideDialog}
style={{
borderRadius: 6,
backgroundColor: theme.colorPrimary,
}}
>
<Dialog.Title
style={{
letterSpacing: 0,
fontSize: 16,
color: theme.textColorPrimary,
}}
>
Are you sure? All history will be lost.
</Dialog.Title>
<Dialog.Actions>
<Button
uppercase={false}
theme={{ colors: { primary: theme.colorAccent } }}
onPress={hideDialog}
>
Cancel
</Button>
<Button
uppercase={false}
theme={{ colors: { primary: theme.colorAccent } }}
onPress={() => {
dispatch(clearAllHistoryAction());
hideDialog();
}}
>
Ok
</Button>
</Dialog.Actions>
</Dialog>
<Dialog
visible={clearDatabaseDialog}
onDismiss={hideClearDatabaseDialog}
+30 -25
View File
@@ -138,31 +138,36 @@ const ReaderSettings = ({ navigation }) => {
>
Preset Themes
</Text>
<Row>
<ToggleButton.Row
onValueChange={onValueChange}
value={reader.theme}
>
{presetThemes.map((theme) => (
<ToggleButton
key={theme.value}
icon={
reader.theme === theme.value &&
"check"
}
color={theme.textColor}
value={theme.value}
style={[
{
backgroundColor:
theme.backgroundColor,
},
styles.presetToggleButton,
]}
/>
))}
</ToggleButton.Row>
</Row>
<ScrollView
style={{ marginLeft: 16 }}
horizontal={true}
>
<Row>
<ToggleButton.Row
onValueChange={onValueChange}
value={reader.theme}
>
{presetThemes.map((theme) => (
<ToggleButton
key={theme.value}
icon={
reader.theme === theme.value &&
"check"
}
color={theme.textColor}
value={theme.value}
style={[
{
backgroundColor:
theme.backgroundColor,
},
styles.presetToggleButton,
]}
/>
))}
</ToggleButton.Row>
</Row>
</ScrollView>
</Pressable>
<ListSubHeader theme={theme}>Reader</ListSubHeader>
<ListItem
@@ -14,6 +14,9 @@ const ThemeModal = ({ themeModalVisible, hidethemeModal, dispatch, theme }) => {
{ id: 4, name: "Green Apple" },
{ id: 5, name: "Iris Blue" },
{ id: 7, name: "Strawberry Daiquiri" },
{ id: 8, name: "Tako" },
{ id: 9, name: "Yin & Yang" },
{ id: 10, name: "Spring Blossom" },
];
const renderThemeCheckboxes = () =>
@@ -156,7 +156,7 @@ const ChaptersSettingsSheet = ({
indicatorStyle={{ backgroundColor: theme.colorAccent }}
style={{ backgroundColor: theme.colorPrimary }}
renderLabel={({ route, focused, color }) => (
<Text style={{ color, margin: 8 }}>{route.title}</Text>
<Text style={{ color }}>{route.title}</Text>
)}
inactiveColor={theme.textColorSecondary}
activeColor={theme.colorAccent}
@@ -174,7 +174,7 @@ const ChaptersSettingsSheet = ({
<View
style={[
styles.contentContainer,
{ backgroundColor: theme.colorPrimary },
{ backgroundColor: theme.colorPrimaryDark },
]}
>
<TabView
+1 -1
View File
@@ -208,5 +208,5 @@ export default Updates;
const styles = StyleSheet.create({
container: { flex: 1 },
flatList: { flexGrow: 1, paddingVertical: 8 },
flatList: { flexGrow: 1, paddingBottom: 8 },
});
+16 -16
View File
@@ -253,98 +253,98 @@
},
{
"sourceId": 38,
"sourceUrl": "https://skynovel.org/",
"url": "https://skynovel.org/",
"sourceName": "SkyNovel",
"icon": "https://github.com/LNReader/lnreader-sources/blob/main/multisrc/madara/icons/skynovel.png?raw=true",
"lang": "English"
},
{
"sourceId": 39,
"sourceUrl": "https://novelcake.com/",
"url": "https://novelcake.com/",
"sourceName": "NovelCake",
"icon": "https://github.com/LNReader/lnreader-sources/blob/main/multisrc/madara/icons/novelcake.png?raw=true",
"lang": "English"
},
{
"sourceId": 40,
"sourceUrl": "https://novelsrock.com/",
"url": "https://novelsrock.com/",
"sourceName": "NovelsRock",
"icon": "https://github.com/LNReader/lnreader-sources/blob/main/multisrc/madara/icons/novelsrock.png?raw=true",
"lang": "English"
},
{
"sourceId": 41,
"sourceUrl": "https://zinnovel.com/",
"url": "https://zinnovel.com/",
"sourceName": "ZinnNovel",
"icon": "https://github.com/LNReader/lnreader-sources/blob/main/multisrc/madara/icons/zinnovel.png?raw=true",
"lang": "English"
},
{
"sourceId": 42,
"sourceUrl": "https://noveltranslate.com/",
"url": "https://noveltranslate.com/",
"sourceName": "NovelTranslate",
"icon": "https://github.com/LNReader/lnreader-sources/blob/main/multisrc/madara/icons/noveltranslate.png?raw=true",
"lang": "English"
},
{
"sourceId": 43,
"sourceUrl": "https://www.lunarletters.com/",
"url": "https://www.lunarletters.com/",
"sourceName": "LunarLetters",
"icon": "https://github.com/LNReader/lnreader-sources/blob/main/multisrc/madara/icons/lunarletters.png?raw=true",
"lang": "English"
},
{
"sourceId": 44,
"sourceUrl": "https://sleepytranslations.com/",
"url": "https://sleepytranslations.com/",
"sourceName": "SleepyTranslations",
"icon": "https://github.com/LNReader/lnreader-sources/blob/main/multisrc/madara/icons/sleepytranslations.png?raw=true",
"lang": "English"
},
{
"sourceId": 45,
"sourceUrl": "https://freenovel.me/",
"url": "https://freenovel.me/",
"sourceName": "FreeNovelMe",
"icon": "https://github.com/LNReader/lnreader-sources/blob/main/multisrc/madara/icons/freenovel.png?raw=true",
"lang": "English"
},
{
"sourceId": 46,
"sourceUrl": "https://1stkissnovel.love/",
"url": "https://1stkissnovel.love/",
"sourceName": "1stKissNovel",
"icon": "https://github.com/LNReader/lnreader-sources/blob/main/multisrc/madara/icons/1stkissnovel.png?raw=true",
"lang": "English"
},
{
"sourceId": 47,
"sourceUrl": "https://daonovel.com/",
"url": "https://daonovel.com/",
"sourceName": "DaoNovel",
"icon": "https://github.com/LNReader/lnreader-sources/blob/main/multisrc/madara/icons/daonovel.png?raw=true",
"lang": "English"
},
{
"sourceId": 48,
"sourceUrl": "https://www.wuxia.blog/",
"url": "https://www.wuxia.blog/",
"sourceName": "Wuxia.Blog",
"icon": "https://github.com/LNReader/lnreader-sources/blob/main/src/en/wuxiablog/icon.png?raw=true",
"lang": "English"
},
{
"sourceId": 49,
"sourceUrl": "https://wuxia.city/",
"url": "https://wuxia.city/",
"sourceName": "Wuxia.City",
"icon": "https://github.com/LNReader/lnreader-sources/blob/main/src/en/wuxiacity/icon.png?raw=true",
"lang": "English"
},
{
"sourceId": 50,
"sourceUrl": "https://www.novelupdates.com/",
"url": "https://www.novelupdates.com/",
"sourceName": "Novel Updates",
"icon": "https://github.com/LNReader/lnreader-sources/blob/main/src/en/novelupdates/icon.png?raw=true",
"lang": "English"
},
{
"sourceId": 51,
"sourceUrl": "https://ranobes.net/",
"url": "https://ranobes.net/",
"sourceName": "Ranobes",
"icon": "https://github.com/LNReader/lnreader-sources/blob/main/src/en/ranobes/icon.png?raw=true",
"lang": "English"
@@ -358,14 +358,14 @@
},
{
"sourceId": 53,
"sourceUrl": "https://kolnovel.com/",
"url": "https://kolnovel.com/",
"sourceName": "KolNovel",
"icon": "https://github.com/LNReader/lnreader-sources/blob/main/multisrc/wpmangastream/icons/kolnovel.png?raw=true",
"lang": "Arabic"
},
{
"sourceId": 54,
"sourceUrl": "https://rewayat-ar.site/",
"url": "https://rewayat-ar.site/",
"sourceName": "RewayatAr",
"icon": "https://github.com/LNReader/lnreader-sources/blob/main/multisrc/wpmangastream/icons/rewayatar.png?raw=true",
"lang": "Arabic"
+14
View File
@@ -6,6 +6,9 @@ const AccentColors = {
strawberryDaiquiri: "#ED4A65",
irisBlue: "#00adb5",
hotPink: "#FF3399",
tako: "#F3B375",
yinYang: "#FFFFFF",
springBlossom: "#c43c97",
};
const RippleColors = {
@@ -15,6 +18,9 @@ const RippleColors = {
strawberryDaiquiri: "rgba(237,74,101,0.12)",
irisBlue: "rgba(0,173,181,0.12)",
hotPink: "rgba(255,51,153,0.12)",
tako: "rgba(243,179,117,0.12)",
yinYang: "#rgba(255,255,255,0.12)",
springBlossom: "rgba(196,60,151,0.12)",
};
const StatusBarStyle = {
@@ -56,6 +62,14 @@ const PrimaryColors = {
colorPrimary: "#393e46",
colorPrimaryDark: "#222831",
},
tako: {
colorPrimary: "#484861",
colorPrimaryDark: "#2C2C3B",
},
springBlossom: {
colorPrimary: "#efe3f3",
colorPrimaryDark: "#f7f4f8",
},
};
export {
+59
View File
@@ -157,3 +157,62 @@ export const irisBlueTheme = {
colorButtonText: "#16151D",
statusBar: StatusBarStyle.LIGHT,
};
/**
* TakoTheme
*/
export const takoTheme = {
id: 8,
name: "Tako",
...PrimaryColors.tako,
colorAccent: AccentColors.tako,
rippleColor: RippleColors.tako,
searchBarColor: "#484861",
menuColor: "#484861",
filterColor: "#FFEB3B",
dividerColor: "rgba(255,255,255,0.1)",
colorDisabled: "#484861",
colorButtonText: "#2C2C3B",
statusBar: StatusBarStyle.LIGHT,
...TextColors.dark,
};
/**
* Yin & Yang
*/
export const yinYangTheme = {
id: 9,
name: "Yin & Yang",
...PrimaryColors.dark,
colorAccent: AccentColors.yinYang,
rippleColor: RippleColors.yinYang,
searchBarColor: "#484861",
menuColor: "#484861",
filterColor: "#FFEB3B",
dividerColor: "rgba(255,255,255,0.1)",
colorDisabled: "#484861",
colorButtonText: "#000000",
statusBar: StatusBarStyle.LIGHT,
...TextColors.dark,
};
/**
* Light
*/
export const springBlossomTheme = {
id: 10,
name: "Spring Blossom",
...PrimaryColors.springBlossom,
...TextColors.light,
colorAccent: AccentColors.springBlossom,
rippleColor: RippleColors.springBlossom,
searchBarColor: PrimaryColors.springBlossom.colorPrimary,
menuColor: "#FFFFFF",
dividerColor: "rgba(0,0,0,0.1)",
filterColor: "#FFC107",
colorDisabled: PrimaryColors.springBlossom.colorPrimary,
colorButtonText: "#FFFFFF",
statusBar: StatusBarStyle.DARK,
};