Skip to content

Commit

Permalink
Merge pull request #2414 from cozy/feat/colorFix
Browse files Browse the repository at this point in the history
Put back some changes from master
  • Loading branch information
JF-Cozy authored Jun 30, 2022
2 parents 23c8da9 + ffd8c8b commit a349053
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 8 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@
* Disable account line in import group panel to prevent accessing an account not yet ready
* Change wording for toast message when importing data from a bank is completed
* Remove icon on ReconnectTriggerButton
* Add intentsApi prop to HarvestBankAccountSettings

## 🐛 Bug Fixes

* Fix App Amirale UI issues by updating cozy-ui [[PR]](https://github.com/cozy/cozy-banks/pull/2380)
* Update trigger without fetch policy in AccountModal, while reconnecting a konnector [[PR]](https://github.com/cozy/cozy-banks/pull/2404)
* Use the right color for input text

## 🔧 Tech

Expand Down
4 changes: 2 additions & 2 deletions src/components/BarSearchInput/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { useRef, useCallback } from 'react'
import cx from 'classnames'
import Icon from 'cozy-ui/transpiled/react/Icon'
import IconButton from 'cozy-ui/transpiled/react/IconButton'
import Input from 'cozy-ui/transpiled/react/Input'
import styles from './styles.styl'

import MagnifierIcon from 'cozy-ui/transpiled/react/Icons/Magnifier'
Expand All @@ -25,7 +26,6 @@ const BarSearchInput = ({
onReset
}) => {
const inputRef = useRef()

const handleReset = useCallback(() => {
onReset && onReset(inputRef.current)
}, [onReset])
Expand All @@ -36,7 +36,7 @@ const BarSearchInput = ({
<Icon icon={MagnifierIcon} />
</IconButton>
</BarSearchIcon>
<input
<Input
ref={inputRef}
type="text"
onChange={onChange}
Expand Down
4 changes: 2 additions & 2 deletions src/components/BarSearchInput/styles.styl
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
width calc(100vw - 2rem)

input
color var(--primaryContrastTextColor)
color var(--primaryTextColor)

input::placeholder
color var(--primaryContrastTextColor)
color var(--primaryTextColor)
opacity 0.5

.SearchIcon
Expand Down
22 changes: 18 additions & 4 deletions src/ducks/settings/HarvestBankAccountSettings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,11 @@ const HarvestTrackingProvider = ({ children }) => {
/**
* Shows a modal displaying the AccountModal from Harvest
*/
const HarvestBankAccountSettings = ({ connectionId, onDismiss }) => {
const HarvestBankAccountSettings = ({
connectionId,
onDismiss,
intentsApi
}) => {
const { dialogProps } = useCozyDialog({
open: true,
size: 'medium'
Expand All @@ -182,6 +186,7 @@ const HarvestBankAccountSettings = ({ connectionId, onDismiss }) => {
<HarvestAccountModal
accountId={connectionId}
triggers={triggers}
intentsApi={intentsApi}
konnector={konnector}
accountsAndTriggers={accountsAndTriggers}
onDismiss={() => {
Expand All @@ -200,13 +205,21 @@ const HarvestBankAccountSettings = ({ connectionId, onDismiss }) => {
connectionId => (
// TODO Avoid passing reconnect in props,
// prefer to use location instead.
<EditModal connectionId={connectionId} reconnect={true} />
<EditModal
connectionId={connectionId}
reconnect={true}
intentsApi={intentsApi}
/>
)
],
[
'/accounts/:connectionId/edit',
connectionId => (
<EditModal connectionId={connectionId} reconnect={false} />
<EditModal
connectionId={connectionId}
reconnect={false}
intentsApi={intentsApi}
/>
)
]
]}
Expand All @@ -218,13 +231,14 @@ const HarvestBankAccountSettings = ({ connectionId, onDismiss }) => {
)
}

const EditModal = React.memo(({ reconnect, connectionId }) => {
const EditModal = React.memo(({ reconnect, connectionId, intentsApi }) => {
return (
<HarvestLoader connectionId={connectionId}>
{({ konnector, accountsAndTriggers }) => {
return (
<EditAccountModal
konnector={konnector}
intentsApi={intentsApi}
accountId={connectionId}
accounts={accountsAndTriggers}
reconnect={reconnect}
Expand Down

0 comments on commit a349053

Please sign in to comment.