Skip to content

Commit 7d8e322

Browse files
author
molker
committed
Update OutdialCall CSS
1 parent ab03c0c commit 7d8e322

6 files changed

Lines changed: 2769 additions & 2840 deletions

File tree

packages/contact-center/cc-components/src/components/task/OutdialCall/constants.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ export const OutdialStrings = {
77
INCORRECT_DN_FORMAT: 'Incorrect format.',
88
OUTDIAL_CALL: 'Outdial Call',
99
ADDRESS_BOOK_SEARCH_PLACEHOLDER: 'Search by Name/Number',
10+
ADDRESS_BOOK_NO_RESULTS: 'No address book entries found.',
1011
};
1112

1213
// Utility Constants
1314
export const KEY_LIST = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '*', '0', '#'];
15+
export const TABS = {
16+
DIAL_PAD: 'dial_pad',
17+
ADDRESS_BOOK: 'address_book',
18+
};

packages/contact-center/cc-components/src/components/task/OutdialCall/outdial-call.style.scss

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,7 @@
33
flex-direction: column;
44
align-items: center;
55
border-radius: 0.625rem;
6-
width: 15.625rem;
7-
height: 26.5rem;
8-
9-
.keypad {
10-
width: 100%;
11-
}
6+
width: 16.5rem;
127

138
mdc-input {
149
padding-bottom: 0; // default is 1 rem, 1.5 rem needed but provided by .keys
@@ -21,23 +16,27 @@
2116
.outdial-ani-select-container {
2217
position: relative;
2318
width: 100%;
24-
}
25-
26-
.outDialCallButton {
27-
margin-top: 1.5rem;
19+
padding-bottom: 1rem;
2820
}
2921

3022
.outdial-select-arrow-icon {
3123
position: absolute;
32-
right: 0;
33-
top: 83%;
24+
right: 0.375rem;
25+
top: 71%;
3426
transform: translateY(-50%);
3527
display: flex;
3628
align-items: center;
3729
pointer-events: none;
3830
z-index: 1;
3931
}
4032

33+
#outdial-ani-option-select {
34+
width: 100%;
35+
label {
36+
margin: 0;
37+
}
38+
}
39+
4140
.outdial-ani-option-name {
4241
display: flex;
4342
align-items: center;
@@ -51,7 +50,7 @@
5150
column-gap: 1.5rem;
5251
padding: 1.5rem 0;
5352
list-style-type: none;
54-
margin: 0 20%;
53+
margin: 0;
5554
}
5655

5756
.key {
@@ -70,6 +69,13 @@
7069
}
7170
}
7271

72+
.dialpad-tab-container {
73+
display: flex;
74+
flex-direction: column;
75+
align-items: center;
76+
width: 16.5rem;
77+
}
78+
7379
.address-book-container {
7480
width: 100%;
7581
}
@@ -116,6 +122,7 @@
116122
}
117123

118124
.tab-list {
125+
padding-bottom: 1rem;
119126
mdc-button {
120127
display: none;
121128
}
@@ -125,16 +132,5 @@
125132
padding: 0;
126133
}
127134
}
128-
129-
.ani-select-input {
130-
margin-top: 1rem;
131-
}
132-
}
133-
134-
.height-auto {
135-
height: auto;
136135
}
137136

138-
.height-28-5rem {
139-
height: 28.5rem;
140-
}

packages/contact-center/cc-components/src/components/task/OutdialCall/outdial-call.tsx

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {SelectNext} from '@momentum-ui/react-collaboration';
99
import {Item} from '@react-stately/collections';
1010

1111
import {OutdialAniEntry, OutdialCallComponentProps} from '../task.types';
12-
import {OutdialStrings, KEY_LIST} from './constants';
12+
import {OutdialStrings, KEY_LIST, TABS} from './constants';
1313
import {DEFAULT_PAGE_SIZE} from '../constants';
1414
import {createInitials, debounce} from '../CallControl/CallControlCustom/call-control-custom.utils';
1515
import {useIntersectionObserver} from '../../../hooks';
@@ -37,11 +37,6 @@ const OutdialCallComponent: React.FunctionComponent<OutdialCallComponentProps> =
3737
isAddressBookEnabled = true,
3838
} = props;
3939

40-
const TABS = {
41-
DIAL_PAD: 'dial_pad',
42-
ADDRESS_BOOK: 'address_book',
43-
};
44-
4540
// State Hooks
4641
const [selectedTab, setSelectedTab] = useState(TABS.DIAL_PAD);
4742
const [destination, setDestination] = useState('');
@@ -140,7 +135,7 @@ const OutdialCallComponent: React.FunctionComponent<OutdialCallComponentProps> =
140135
}
141136
};
142137

143-
const handleDiapadTabClick = () => {
138+
const handleDialpadTabClick = () => {
144139
setSelectedAddressBookEntry(null);
145140
// Don't clear destination - preserve selected address book entry number
146141
setSelectedTab(TABS.DIAL_PAD);
@@ -252,16 +247,16 @@ const OutdialCallComponent: React.FunctionComponent<OutdialCallComponentProps> =
252247
<Spinner variant="button" />
253248
</div>
254249
) : (
255-
<p>No address book entries found.</p>
250+
<p>{OutdialStrings.ADDRESS_BOOK_NO_RESULTS}</p>
256251
)}
257252
</ul>
258253
</section>
259254
);
260255
};
261256

262-
const renderDiapad = () => {
257+
const renderDialpad = () => {
263258
return (
264-
<section className="keypad" data-testid="outdial-call-container">
259+
<>
265260
<Input
266261
className="outdial-input"
267262
id="outdial-number-input"
@@ -280,18 +275,18 @@ const OutdialCallComponent: React.FunctionComponent<OutdialCallComponentProps> =
280275
<ul className="keys" data-testid="outdial-keypad-keys">
281276
{KEY_LIST.map((key) => (
282277
<li key={key}>
283-
<Button className="key button" onClick={() => handleOnClick(key)}>
278+
<Button className="key" onClick={() => handleOnClick(key)}>
284279
{key}
285280
</Button>
286281
</li>
287282
))}
288283
</ul>
289-
</section>
284+
</>
290285
);
291286
};
292287

293288
return (
294-
<article className={`outdial-container ${isAddressBookEnabled ? 'height-28-5rem' : ''}`}>
289+
<article className="outdial-container" data-testid="outdial-call-container">
295290
{isAddressBookEnabled && (
296291
<>
297292
<TabList activeTabId={selectedTab} dataAriaLabel="Outdial call tabs" className="tab-list">
@@ -308,29 +303,34 @@ const OutdialCallComponent: React.FunctionComponent<OutdialCallComponentProps> =
308303
tabId={TABS.DIAL_PAD}
309304
aria-controls={TABS.DIAL_PAD}
310305
variant="glass"
311-
onClick={handleDiapadTabClick}
306+
onClick={handleDialpadTabClick}
312307
></Tab>
313308
</TabList>
314309

315310
{selectedTab === TABS.ADDRESS_BOOK && (
316-
<div
311+
<section
317312
id={TABS.ADDRESS_BOOK}
318313
role="tabpanel"
319314
aria-labelledby={TABS.ADDRESS_BOOK}
320315
className="address-book-container"
321316
>
322317
{renderAddressBook()}
323-
</div>
318+
</section>
324319
)}
325320
{selectedTab === TABS.DIAL_PAD && (
326-
<div id={TABS.DIAL_PAD} role="tabpanel" aria-labelledby={TABS.DIAL_PAD} className="keypad">
327-
{renderDiapad()}
328-
</div>
321+
<section
322+
id={TABS.DIAL_PAD}
323+
role="tabpanel"
324+
aria-labelledby={TABS.DIAL_PAD}
325+
className="dialpad-tab-container"
326+
>
327+
{renderDialpad()}
328+
</section>
329329
)}
330330
</>
331331
)}
332332

333-
{!isAddressBookEnabled && renderDiapad()}
333+
{!isAddressBookEnabled && renderDialpad()}
334334

335335
<div className="outdial-ani-select-container">
336336
<Icon
@@ -371,7 +371,6 @@ const OutdialCallComponent: React.FunctionComponent<OutdialCallComponentProps> =
371371
<Button
372372
data-testid="outdial-call-button"
373373
prefixIcon={'handset-regular'}
374-
className="outDialCallButton"
375374
onClick={() => {
376375
startOutdial(destination, selectedANI);
377376
// Clear input field after initiating the call

0 commit comments

Comments
 (0)