-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: move to attachment download progress content on attachment dl
- Loading branch information
Showing
3 changed files
with
178 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
104 changes: 104 additions & 0 deletions
104
...esponsesPage/storage/UnlockedResponses/DownloadWithAttachmentModal/ConfirmationScreen.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
import { BiCheck } from 'react-icons/bi' | ||
import { | ||
Badge, | ||
Button, | ||
ButtonGroup, | ||
List, | ||
ListIcon, | ||
ListItem, | ||
ModalBody, | ||
ModalFooter, | ||
ModalHeader, | ||
Stack, | ||
Text, | ||
Wrap, | ||
} from '@chakra-ui/react' | ||
|
||
import InlineMessage from '~components/InlineMessage' | ||
import { ModalCloseButton } from '~components/Modal' | ||
|
||
const InlineTextListItem = ({ | ||
children, | ||
}: { | ||
children: string | ||
}): JSX.Element => ( | ||
<ListItem display="flex" alignItems="center"> | ||
<ListIcon as={BiCheck} /> | ||
{children} | ||
</ListItem> | ||
) | ||
|
||
interface ConfirmationScreenProps { | ||
onCancel: () => void | ||
onDownload: () => void | ||
isDownloading: boolean | ||
responsesCount: number | ||
} | ||
|
||
export const ConfirmationScreen = ({ | ||
onCancel, | ||
isDownloading, | ||
onDownload, | ||
responsesCount, | ||
}: ConfirmationScreenProps): JSX.Element => { | ||
return ( | ||
<> | ||
<ModalCloseButton /> | ||
<ModalHeader color="secondary.700" pr="4.5rem"> | ||
<Wrap shouldWrapChildren direction="row" align="center"> | ||
<Text>Download responses and attachments</Text> | ||
<Badge w="fit-content" colorScheme="success"> | ||
beta | ||
</Badge> | ||
</Wrap> | ||
</ModalHeader> | ||
<ModalBody whiteSpace="pre-line" color="secondary.500"> | ||
<Stack spacing="1rem"> | ||
<Text> | ||
Separate zip files will be downloaded, <b>one for each response</b>. | ||
You can adjust the date range before proceeding. | ||
<br /> | ||
<br /> | ||
<b>Number of responses and attachments:</b>{' '} | ||
{responsesCount.toLocaleString()} | ||
<br /> | ||
<b>Estimated time:</b> 30-50 mins per 1,000 responses | ||
</Text> | ||
<InlineMessage> | ||
<Stack> | ||
<Text textStyle="subhead-1"> | ||
Downloading many attachments can be an intensive operation. | ||
</Text> | ||
<List> | ||
<InlineTextListItem> | ||
Do not use Internet Explorer | ||
</InlineTextListItem> | ||
<InlineTextListItem> | ||
Ensure network connectivity is strong | ||
</InlineTextListItem> | ||
<InlineTextListItem> | ||
Ensure device has sufficient disk space for the download | ||
</InlineTextListItem> | ||
</List> | ||
</Stack> | ||
</InlineMessage> | ||
</Stack> | ||
</ModalBody> | ||
<ModalFooter> | ||
<ButtonGroup> | ||
<Button | ||
variant="clear" | ||
colorScheme="secondary" | ||
onClick={onCancel} | ||
isDisabled={isDownloading} | ||
> | ||
Cancel | ||
</Button> | ||
<Button onClick={onDownload} isLoading={isDownloading}> | ||
Start download | ||
</Button> | ||
</ButtonGroup> | ||
</ModalFooter> | ||
</> | ||
) | ||
} |
146 changes: 64 additions & 82 deletions
146
...age/storage/UnlockedResponses/DownloadWithAttachmentModal/DownloadWithAttachmentModal.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters