-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This component is used when you want to scan a document from your mobile via a web browser.
- Loading branch information
Showing
7 changed files
with
114 additions
and
26 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
packages/cozy-mespapiers-lib/src/assets/icons/IlluCozyCloud.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
60 changes: 60 additions & 0 deletions
60
packages/cozy-mespapiers-lib/src/components/ModelSteps/Scan/InstallAppModal.jsx
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,60 @@ | ||
import PropTypes from 'prop-types' | ||
import React from 'react' | ||
|
||
import { getPlatform } from 'cozy-device-helper' | ||
import Box from 'cozy-ui/transpiled/react/Box' | ||
import Button from 'cozy-ui/transpiled/react/Buttons' | ||
import { Dialog } from 'cozy-ui/transpiled/react/CozyDialogs' | ||
import Empty from 'cozy-ui/transpiled/react/Empty' | ||
import { useI18n } from 'cozy-ui/transpiled/react/I18n' | ||
|
||
import IlluCozyCloud from '../../../assets/icons/IlluCozyCloud.svg' | ||
import { getLinkByPlatform } from '../helpers' | ||
|
||
const InstallAppModal = ({ onBack }) => { | ||
const { t } = useI18n() | ||
const platform = getPlatform() | ||
const link = getLinkByPlatform(platform) | ||
|
||
return ( | ||
<Dialog | ||
open | ||
transitionDuration={0} | ||
onBack={onBack} | ||
content={ | ||
<Box | ||
display="flex" | ||
flexDirection="column" | ||
justifyContent="center" | ||
height="100%" | ||
data-testid="InstallAppModal" | ||
> | ||
<Empty | ||
icon={IlluCozyCloud} | ||
iconSize="large" | ||
title={t('InstallAppModal.title')} | ||
text={ | ||
<> | ||
<span className="u-db">{t('InstallAppModal.text')}</span> | ||
<Button | ||
className="u-mt-1-half" | ||
label={t(`InstallAppModal.action.${platform}`)} | ||
component="a" | ||
href={link} | ||
target="_blank" | ||
rel="noopener" | ||
/> | ||
</> | ||
} | ||
/> | ||
</Box> | ||
} | ||
/> | ||
) | ||
} | ||
|
||
InstallAppModal.propTypes = { | ||
onBack: PropTypes.func | ||
} | ||
|
||
export default InstallAppModal |
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
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
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
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
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