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