Skip to content

Commit

Permalink
Merge pull request #201 from cozy/fix--Handle-Amirale-App-UI-update
Browse files Browse the repository at this point in the history
fix: Handle Amirale App UI update
  • Loading branch information
acezard authored May 25, 2022
2 parents c353df7 + 1db53f3 commit d9aca5b
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 1 deletion.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"babel-preset-cozy-app": "^1.6.0",
"cozy-client": "^16.10.2",
"cozy-flags": "2.6.0",
"cozy-intent": "^2.0.2",
"cozy-ui": "^42.3.0",
"enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.14.0",
Expand Down Expand Up @@ -86,6 +87,7 @@
"peerDependencies": {
"cozy-client": "^16.10.2",
"cozy-flags": "^2.6.0",
"cozy-intent": "^2.0.2",
"cozy-ui": "^42.3.0",
"react": "^16.8.3",
"react-dom": "^16.9.0"
Expand Down
28 changes: 27 additions & 1 deletion src/components/UnlockForm.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState, useCallback, useMemo } from 'react'
import React, { useState, useCallback, useMemo, useEffect } from 'react'
import cx from 'classnames'
import get from 'lodash/get'
import PropTypes from 'prop-types'
Expand All @@ -13,6 +13,7 @@ import Icon from 'cozy-ui/transpiled/react/Icon'
import CozyTheme from 'cozy-ui/transpiled/react/CozyTheme'
import { IllustrationDialog } from 'cozy-ui/transpiled/react/CozyDialogs'
import KeychainIcon from 'cozy-ui/transpiled/react/Icons/Keychain'
import { useWebviewIntent } from 'cozy-intent'

import CloudIcon from './IconCozySecurity'
import PasswordField from './PasswordField'
Expand Down Expand Up @@ -77,6 +78,31 @@ const UnlockForm = props => {

const canAuthWithOIDC = canClientAuthWithOIDC(client)

const webviewIntent = useWebviewIntent()

useEffect(() => {
webviewIntent &&
webviewIntent.call(
'setFlagshipUI',
{
bottomTheme: 'light',
topTheme: 'light'
},
'cozy-keys-lib/UnlockForm'
)

return () =>
webviewIntent &&
webviewIntent.call(
'setFlagshipUI',
{
bottomTheme: 'light',
topTheme: 'light'
},
'cozy-keys-lib/UnlockForm'
)
}, [webviewIntent])

return (
<CozyTheme variant="inverted">
<IllustrationDialog
Expand Down
12 changes: 12 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4035,6 +4035,13 @@ [email protected]:
dependencies:
microee "^0.0.6"

cozy-intent@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/cozy-intent/-/cozy-intent-2.0.2.tgz#81330389c7b8cfc1433608a435873b362691931c"
integrity sha512-E+9WqbYhFiV/KCGFArSJu/jcvdliI58Vfa3ajrJFRV2AsPtej6wN5qfn6Wex53xpdTAZSjLfmYAQLNt0cl6xGw==
dependencies:
post-me "0.4.5"

[email protected]:
version "0.5.4"
resolved "https://registry.yarnpkg.com/cozy-interapp/-/cozy-interapp-0.5.4.tgz#2573f1800f073c84c289267d04234954d88eae0c"
Expand Down Expand Up @@ -8841,6 +8848,11 @@ posix-character-classes@^0.1.0:
resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab"
integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=

[email protected]:
version "0.4.5"
resolved "https://registry.yarnpkg.com/post-me/-/post-me-0.4.5.tgz#6171b721c7b86230c51cfbe48ddea047ef8831ce"
integrity sha512-XgPdktF/2M5jglgVDULr9NUb/QNv3bY3g6RG22iTb5MIMtB07/5FJB5fbVmu5Eaopowc6uZx7K3e7x1shPwnXw==

prelude-ls@~1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
Expand Down

0 comments on commit d9aca5b

Please sign in to comment.