Skip to content
This repository was archived by the owner on Sep 9, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/components/CurrentlyReadingBook.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { sizes } from "../constants/sizes";
import { Ionicons } from "@expo/vector-icons";
import { useNavigation } from "@react-navigation/native";
import { StackNavigationProp } from "@react-navigation/stack";
import { useTranslation } from "react-i18next";

type RootStackParamList = {
BookPreview: {
Expand All @@ -20,6 +21,7 @@ type RootStackParamList = {
status: string;
favPage?: number;
favPageImage?: string;
currentPage?: number;
};
};
};
Expand All @@ -40,6 +42,7 @@ type CurrentlyReadingBookProps = {
status: string;
favPage?: number;
favPageImage?: string;
currentPage?: number;
};

const getSecureImageUrl = (url: string | undefined) => {
Expand All @@ -58,9 +61,10 @@ export const CurrentlyReadingBook = ({
status,
favPage,
favPageImage,
currentPage,
}: CurrentlyReadingBookProps) => {
const navigation = useNavigation<BookScreenNavigationProp>();

const { t } = useTranslation();
const handlePress = () => {
navigation.navigate("BookPreview", {
book: {
Expand All @@ -75,6 +79,7 @@ export const CurrentlyReadingBook = ({
status,
favPage,
favPageImage,
currentPage: currentPage !== undefined ? currentPage : 0,
},
});
};
Expand All @@ -100,7 +105,9 @@ export const CurrentlyReadingBook = ({
</Text>
<View style={styles.iconContainer}>
<Ionicons name="book-outline" size={16} color={colors.white} />
<Text style={styles.pagesText}>{pages} pages</Text>
<Text style={styles.pagesText}>
{t("current_page")}: {currentPage}
</Text>
</View>
</View>
</View>
Expand Down
19 changes: 11 additions & 8 deletions src/components/book.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type RootStackParamList = {
status: string;
favPage?: number;
favPageImage?: string;
currentPage?: number;
};
};
};
Expand All @@ -31,15 +32,12 @@ type BookScreenNavigationProp = StackNavigationProp<
>;

const getStatusIcon = (status: string) => {
switch (status.toLowerCase()) {
switch (status) {
case "read":
case "okudum":
return "checkmark-circle";
case "to read":
case "okunacak":
case "to_read":
return "time";
case "currently reading":
case "şu an okuyorum":
case "currently_reading":
return "book";
default:
return "help-circle";
Expand All @@ -57,6 +55,7 @@ export const Book = ({
status,
favPage,
favPageImage,
currentPage,
style,
}: {
title: string;
Expand All @@ -69,6 +68,7 @@ export const Book = ({
status: string;
favPage?: number;
favPageImage?: string;
currentPage?: number;
style?: object;
}) => {
const navigation = useNavigation<BookScreenNavigationProp>();
Expand All @@ -94,6 +94,7 @@ export const Book = ({
status,
favPage,
favPageImage,
currentPage: currentPage ?? 0,
},
});
};
Expand All @@ -113,7 +114,7 @@ export const Book = ({
style={styles.image}
/>
</View>
<Text style={styles.title} numberOfLines={2}>
<Text style={styles.title} numberOfLines={1}>
{title}
</Text>
<Text style={styles.author} numberOfLines={1}>
Expand Down Expand Up @@ -164,16 +165,18 @@ const styles = StyleSheet.create({
borderRadius: sizes.borderRadius,
},
title: {
fontSize: sizes.fontSizeMedium,
fontSize: sizes.fontSizeSmall,
fontWeight: "bold",
color: colors.textPrimary,
marginTop: 8,
marginBottom: 4,
maxWidth: 105,
overflow: "hidden",
},
author: {
fontSize: sizes.fontSizeSmall,
color: colors.textSecondary,
maxWidth: 105,
overflow: "hidden",
},
});
3 changes: 2 additions & 1 deletion src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,6 @@
"turkish": "Turkish",
"tap_to_change_fav_page_image": "Tap to change favorite page image",
"favPage": "Favorite Page",
"favPageNumber": "Favorite Page Number"
"favPageNumber": "Favorite Page Number",
"current_page": "Current Page"
}
3 changes: 2 additions & 1 deletion src/i18n/locales/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,6 @@
"turkish": "Türkçe",
"tap_to_change_fav_page_image": "Favori sayfa resmini değiştirmek için dokunun",
"favPage": "Favori Sayfa",
"favPageNumber": "Favori Sayfa Numarası"
"favPageNumber": "Favori Sayfa Numarası",
"current_page": "Şu Anki Sayfa"
}
Loading