fix dedupe text appearing on top of screen

This commit is contained in:
Abhinav 2023-02-21 18:42:22 +05:30
parent bc4dcba358
commit 3ac9a0e2e1

View file

@ -8,6 +8,7 @@ import uploadManager from 'services/upload/uploadManager';
import AddPhotoAlternateIcon from '@mui/icons-material/AddPhotoAlternateOutlined';
import FolderIcon from '@mui/icons-material/FolderOutlined';
import { UploadTypeSelectorIntent } from 'types/gallery';
const Wrapper = styled(Box)`
flex: 1;
display: flex;
@ -23,11 +24,11 @@ const Wrapper = styled(Box)`
const NonDraggableImage = styled('img')`
pointer-events: none;
`;
export default function EmptyScreen({ openUploader }) {
const deduplicateContext = useContext(DeduplicateContext);
return (
<Wrapper>
{deduplicateContext.isOnDeduplicatePage ? (
return deduplicateContext.isOnDeduplicatePage ? (
<VerticallyCentered>
<div
style={{
color: '#a6a6a6',
@ -35,8 +36,9 @@ export default function EmptyScreen({ openUploader }) {
}}>
{constants.NO_DUPLICATES_FOUND}
</div>
</VerticallyCentered>
) : (
<>
<Wrapper>
<Stack
sx={{
flex: 'none',
@ -46,10 +48,7 @@ export default function EmptyScreen({ openUploader }) {
<VerticallyCentered sx={{ flex: 'none' }}>
{constants.WELCOME_TO_ENTE()}
</VerticallyCentered>
<Typography
variant="body1"
mt={3.5}
color="text.secondary">
<Typography variant="body1" mt={3.5} color="text.secondary">
{constants.WHERE_YOUR_BEST_PHOTOS_LIVE}
</Typography>
</Stack>
@ -62,18 +61,13 @@ export default function EmptyScreen({ openUploader }) {
<span
style={{
cursor:
!uploadManager.shouldAllowNewUpload() &&
'not-allowed',
!uploadManager.shouldAllowNewUpload() && 'not-allowed',
}}>
<VerticallyCentered
paddingTop={1.5}
paddingBottom={1.5}>
<VerticallyCentered paddingTop={1.5} paddingBottom={1.5}>
<Button
color="accent"
onClick={() =>
openUploader(
UploadTypeSelectorIntent.normalUpload
)
openUploader(UploadTypeSelectorIntent.normalUpload)
}
disabled={!uploadManager.shouldAllowNewUpload()}
sx={{
@ -82,18 +76,14 @@ export default function EmptyScreen({ openUploader }) {
width: 320,
borderRadius: 0.5,
}}>
<FlexWrapper
sx={{ gap: 1 }}
justifyContent="center">
<FlexWrapper sx={{ gap: 1 }} justifyContent="center">
<AddPhotoAlternateIcon />
{constants.UPLOAD_FIRST_PHOTO}
</FlexWrapper>
</Button>
<Button
onClick={() =>
openUploader(
UploadTypeSelectorIntent.import
)
openUploader(UploadTypeSelectorIntent.import)
}
disabled={!uploadManager.shouldAllowNewUpload()}
sx={{
@ -102,9 +92,7 @@ export default function EmptyScreen({ openUploader }) {
width: 320,
borderRadius: 0.5,
}}>
<FlexWrapper
sx={{ gap: 1 }}
justifyContent="center">
<FlexWrapper sx={{ gap: 1 }} justifyContent="center">
<FolderIcon />
{constants.IMPORT_YOUR_FOLDERS}
</FlexWrapper>
@ -114,9 +102,7 @@ export default function EmptyScreen({ openUploader }) {
paddingTop={3}
paddingBottom={3}
sx={{ gap: 3 }}>
<FlexWrapper
sx={{ gap: 1 }}
justifyContent="center">
<FlexWrapper sx={{ gap: 1 }} justifyContent="center">
<a href="https://apps.apple.com/app/id1542026904">
<NonDraggableImage
height={59}
@ -134,9 +120,7 @@ export default function EmptyScreen({ openUploader }) {
/>
</a>
</FlexWrapper>
<FlexWrapper
sx={{ gap: 1 }}
justifyContent="center">
<FlexWrapper sx={{ gap: 1 }} justifyContent="center">
<a href="https://f-droid.org/packages/io.ente.photos.fdroid/">
<NonDraggableImage
height={49}
@ -158,8 +142,6 @@ export default function EmptyScreen({ openUploader }) {
</FlexWrapper>
</VerticallyCentered>
</span>
</>
)}
</Wrapper>
);
}