Skip to content

Commit fbfc79b

Browse files
committed
refactor: turn "phone" icon into actual element
Instead of it being an `::after` element. We are going to turn it into a button next.
1 parent 7229980 commit fbfc79b

File tree

2 files changed

+11
-15
lines changed

2 files changed

+11
-15
lines changed

packages/frontend/scss/message/_message.scss

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -97,19 +97,13 @@ $info-text-max-width: 400px;
9797
margin-inline-end: var(--call-icon-size);
9898
white-space: nowrap;
9999
font-weight: bold;
100-
&::after {
101-
content: '';
100+
.phone-icon {
102101
position: absolute;
103102
top: 18px;
104103
inset-inline-end: 8px;
105104
transform: translateY(-50%);
106105
width: var(--call-icon-size);
107106
height: var(--call-icon-size);
108-
@include mixins.color-svg(
109-
'./images/icons/phone.svg',
110-
var(--messageText),
111-
100%
112-
);
113107
}
114108
}
115109
}
@@ -240,14 +234,6 @@ $info-text-max-width: 400px;
240234
.message.incoming {
241235
margin-inline-start: 0;
242236

243-
.msg-body.call > .text::after {
244-
@include mixins.color-svg(
245-
'./images/icons/phone.svg',
246-
var(--messageText),
247-
100%
248-
);
249-
}
250-
251237
.metadata:not(.with-image-no-caption) {
252238
.email-icon {
253239
@include mixins.color-svg(

packages/frontend/src/components/message/Message.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ import { mouseEventToPosition } from '../../utils/mouseEventToPosition'
6565
import { useRovingTabindex } from '../../contexts/RovingTabindex'
6666
import { avatarInitial } from '@deltachat-desktop/shared/avatarInitial'
6767
import { getLogger } from '@deltachat-desktop/shared/logger'
68+
import Icon from '../Icon'
6869

6970
const log = getLogger('Message')
7071

@@ -815,6 +816,15 @@ export default function Message(props: {
815816
tabindexForInteractiveContents={tabindexForInteractiveContents}
816817
/>
817818
) : null}
819+
{message.viewType === 'Call' && (
820+
<Icon
821+
icon='phone'
822+
className='phone-icon'
823+
coloring='currentColor'
824+
// `size` will be overridden in CSS
825+
size={24}
826+
/>
827+
)}
818828
</div>
819829
)
820830

0 commit comments

Comments
 (0)