Skip to content

Commit

Permalink
Merge branch 'new-composer-insert-image-action-missing' into 'main'
Browse files Browse the repository at this point in the history
Added back the Insert image action to the new composer

See merge request web/clients!1206
  • Loading branch information
MargeBot committed Nov 22, 2021
2 parents 37c5bea + add0732 commit 994e71b
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 35 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useState, MutableRefObject, MouseEvent } from 'react';
import { c } from 'ttag';
import { Label, generateUID, classnames, Button, Icon } from '@proton/components';
import { Label, generateUID, classnames, Button, Icon, Tooltip } from '@proton/components';
import { Recipient } from '@proton/shared/lib/interfaces/Address';
import { MessageExtended } from '../../../models/message';
import { RecipientType } from '../../../models/address';
Expand Down Expand Up @@ -75,17 +75,19 @@ const AddressesEditor = ({
>
{c('Action').t`CC BCC`}
</Button>
<Button
type="button"
onClick={handleContactModal('ToList')}
color="weak"
className="pt0-25 pb0-25 flex-item-noshrink"
shape="ghost"
icon
data-testid="composer:to-button"
>
<Icon name="user-plus" size={16} alt={c('Title').t`To`} />
</Button>
<Tooltip title={c('Action').t`Insert contacts`}>
<Button
type="button"
onClick={handleContactModal('ToList')}
color="weak"
className="pt0-25 pb0-25 flex-item-noshrink"
shape="ghost"
icon
data-testid="composer:to-button"
>
<Icon name="user-plus" size={16} alt={c('Title').t`To`} />
</Button>
</Tooltip>
</span>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
useNotifications,
Button,
Icon,
Tooltip,
} from '@proton/components';
import { noop } from '@proton/shared/lib/helpers/function';
import { ContactEmail } from '@proton/shared/lib/interfaces/contacts';
Expand Down Expand Up @@ -237,16 +238,18 @@ const AddressesInput = ({
</div>
{addContactButton ? (
<span className="flex-item-noshrink flex-align-self-start sticky-top">
<Button
type="button"
onClick={addContactAction}
color="weak"
shape="ghost"
icon
data-testid="composer:to-button"
>
<Icon name="user-plus" size={16} alt={addContactButton} />
</Button>
<Tooltip title={c('Action').t`Insert contacts`}>
<Button
type="button"
onClick={addContactAction}
color="weak"
shape="ghost"
icon
data-testid="composer:to-button"
>
<Icon name="user-plus" size={16} alt={addContactButton} />
</Button>
</Tooltip>
</span>
) : null}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { memo, Fragment, MouseEvent, FocusEvent } from 'react';
import { Message } from '@proton/shared/lib/interfaces/mail/Message';
import { getRecipients } from '@proton/shared/lib/mail/messages';
import { c } from 'ttag';
import { Label, classnames, Button, Icon } from '@proton/components';
import { Label, classnames, Button, Icon, Tooltip } from '@proton/components';
import { Recipient } from '@proton/shared/lib/interfaces/Address';
import { MapSendInfo, STATUS_ICONS_FILLS } from '../../../models/crypto';
import { RecipientType, recipientTypes } from '../../../models/address';
Expand Down Expand Up @@ -110,18 +110,20 @@ const AddressesSummary = ({ message, disabled, mapSendInfo, toggleExpanded, onFo
>
{c('Action').t`CC BCC`}
</Button>
<Button
type="button"
onClick={handleContactModal('ToList')}
onFocus={handleFocuButton}
color="weak"
className="pt0-25 pb0-25 flex-item-noshrink"
shape="ghost"
icon
data-testid="composer:to-button"
>
<Icon name="user-plus" size={16} alt={c('Title').t`To`} />
</Button>
<Tooltip title={c('Action').t`Insert contacts`}>
<Button
type="button"
onClick={handleContactModal('ToList')}
onFocus={handleFocuButton}
color="weak"
className="pt0-25 pb0-25 flex-item-noshrink"
shape="ghost"
icon
data-testid="composer:to-button"
>
<Icon name="user-plus" size={16} alt={c('Title').t`To`} />
</Button>
</Tooltip>
</span>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,15 @@ const SquireToolbar = ({
>
<Icon name="eraser" className="mauto" alt={c('Action').t`Clear all formatting`} />
</SquireToolbarButton>
<SquireToolbarSeparator />
<SquireToolbarButton
onClick={handleImage}
className="flex-item-noshrink"
title={c('Action').t`Insert image`}
tabIndex={-1}
>
<Icon name="file-image" className="mauto" alt={c('Action').t`Insert image`} />
</SquireToolbarButton>
</>
)}
</>
Expand Down

0 comments on commit 994e71b

Please sign in to comment.