Özet kart tasarımı değişti.

This commit is contained in:
2025-11-17 22:36:46 +03:00
parent 27b6ccaff8
commit cc07b02e3b
2 changed files with 41 additions and 3 deletions

View File

@@ -155,7 +155,7 @@ const EpubStep = () => {
</Stack> </Stack>
)} )}
</Box> </Box>
<Box> <Box sx={{ textAlign: 'left', width: '100%' }}>
<Typography variant="subtitle1" sx={{ fontWeight: 600 }}> <Typography variant="subtitle1" sx={{ fontWeight: 600 }}>
{bookMetadata.title} {bookMetadata.title}
</Typography> </Typography>
@@ -165,7 +165,27 @@ const EpubStep = () => {
</Typography> </Typography>
)} )}
<Typography variant="caption" color="text.secondary" display="block" mt={1}> <Typography variant="caption" color="text.secondary" display="block" mt={1}>
{[bookMetadata.publisher, bookMetadata.publishedDate, bookMetadata.pageCount ? `${bookMetadata.pageCount} sayfa` : null] {[
bookMetadata.publisher,
bookMetadata.publishedDate,
bookMetadata.pageCount ? `${bookMetadata.pageCount} sayfa` : null,
bookMetadata.language ? bookMetadata.language.toUpperCase() : null,
]
.filter(Boolean)
.join(' • ')}
</Typography>
<Typography variant="caption" color="text.secondary" display="block">
{[
(() => {
const identifiers = bookMetadata.identifiers || [];
const isbnLike =
identifiers.find((id) => id.type?.includes('ISBN_13')) ||
identifiers.find((id) => id.type?.includes('ISBN_10')) ||
identifiers[0];
return isbnLike?.identifier ? `ISBN ${isbnLike.identifier}` : null;
})(),
bookMetadata.averageRating ? `Puan ${bookMetadata.averageRating}/5` : null,
]
.filter(Boolean) .filter(Boolean)
.join(' • ')} .join(' • ')}
</Typography> </Typography>

View File

@@ -49,7 +49,17 @@ const UploadStep = () => {
const onDrop = useCallback( const onDrop = useCallback(
(acceptedFiles) => { (acceptedFiles) => {
if (!acceptedFiles.length) return; if (!acceptedFiles.length) return;
const preservedMetadata = bookMetadata;
const preservedTitle = bookTitle;
resetFromStep('upload'); resetFromStep('upload');
if (preservedMetadata) {
skipSearchRef.current = true;
setBookMetadata(preservedMetadata);
setBookTitle(preservedTitle || preservedMetadata.title || '');
} else if (preservedTitle?.trim()) {
skipSearchRef.current = true;
setBookTitle(preservedTitle);
}
const mapped = acceptedFiles.map((file, index) => ({ const mapped = acceptedFiles.map((file, index) => ({
id: crypto.randomUUID(), id: crypto.randomUUID(),
file, file,
@@ -59,7 +69,15 @@ const UploadStep = () => {
})); }));
setUploadedImages([...uploadedImages, ...mapped]); setUploadedImages([...uploadedImages, ...mapped]);
}, },
[uploadedImages, resetFromStep, setUploadedImages], [
bookMetadata,
bookTitle,
resetFromStep,
setBookMetadata,
setBookTitle,
setUploadedImages,
uploadedImages,
],
); );
const handleCoverToggle = (imageId) => { const handleCoverToggle = (imageId) => {