diff --git a/apps/widget/src/components/widget/Phases/ImageImport/ImageUpload.Styles.tsx b/apps/widget/src/components/widget/Phases/ImageImport/ImageUpload.Styles.tsx new file mode 100644 index 000000000..6b712b738 --- /dev/null +++ b/apps/widget/src/components/widget/Phases/ImageImport/ImageUpload.Styles.tsx @@ -0,0 +1,10 @@ +import { createStyles } from '@mantine/core'; + +export const useStyles = createStyles(() => ({ + stickyFooter: { + position: 'sticky', + zIndex: 1000, + bottom: 0, + top: 0, + }, +})); diff --git a/apps/widget/src/components/widget/Phases/ImageImport/ImageUpload.tsx b/apps/widget/src/components/widget/Phases/ImageImport/ImageUpload.tsx index 4da432f9b..981f426a6 100644 --- a/apps/widget/src/components/widget/Phases/ImageImport/ImageUpload.tsx +++ b/apps/widget/src/components/widget/Phases/ImageImport/ImageUpload.tsx @@ -1,6 +1,6 @@ import { Controller } from 'react-hook-form'; -import { useLocalStorage } from '@mantine/hooks'; -import { Alert, Flex, Stack, Text } from '@mantine/core'; +import { useLocalStorage, useMediaQuery } from '@mantine/hooks'; +import { Alert, Flex, Stack, Text, Box, useMantineTheme } from '@mantine/core'; import { ReactNode, useEffect, useRef, useState } from 'react'; import { Warning } from '@icons'; @@ -11,6 +11,7 @@ import { colors, variables } from '@config'; import { logAmplitudeEvent } from '@amplitude'; import { FileDropzone } from '@ui/FileDropzone'; import { Footer } from 'components/Common/Footer'; +import { useStyles } from './ImageUpload.Styles'; import { useImageUpload } from '@hooks/ImageUpload/useImageUpload'; import { ImageWithIndicator } from '@ui/ImageWithIndicator'; @@ -20,6 +21,10 @@ interface ImageUploadProps { } export function ImageUpload({ goToUpload, texts }: ImageUploadProps) { + const { classes } = useStyles(); + const theme = useMantineTheme(); + const isLargerThanSm = useMediaQuery(`(min-width: ${theme.breakpoints.sm}px)`); + const [showAlert, setShowAlert] = useLocalStorage({ key: variables.SHOW_IMAGE_ALERT_STORAGE_KEY, defaultValue: true, @@ -50,7 +55,7 @@ export function ImageUpload({ goToUpload, texts }: ImageUploadProps) { <> - {showAlert && ( + {showAlert && isLargerThanSm && ( + {Object.entries( @@ -111,11 +117,14 @@ export function ImageUpload({ goToUpload, texts }: ImageUploadProps) { ))} -