From 16fdab905d035a9d36fd705a4e54fdfa2b4c1920 Mon Sep 17 00:00:00 2001 From: parv_gour Date: Wed, 15 Jan 2025 11:20:30 +0530 Subject: [PATCH] feat(cc-widget): added new ui based on MD react v2 --- .../contact-center/station-login/package.json | 7 +- .../station-login.presentational.tsx | 164 ++++++++++-------- .../station-login/webpack.config.js | 31 +++- 3 files changed, 130 insertions(+), 72 deletions(-) diff --git a/packages/contact-center/station-login/package.json b/packages/contact-center/station-login/package.json index d496ad19..737f7b9a 100644 --- a/packages/contact-center/station-login/package.json +++ b/packages/contact-center/station-login/package.json @@ -19,8 +19,13 @@ "test:unit": "jest" }, "dependencies": { + "@momentum-ui/react-collaboration": "^26.194.0", "@webex/cc-store": "workspace:*", - "mobx-react-lite": "^4.1.0" + "css-loader": "^7.1.2", + "mobx-react-lite": "^4.1.0", + "sass": "^1.83.1", + "sass-loader": "^16.0.4", + "style-loader": "^4.0.0" }, "devDependencies": { "@babel/core": "7.25.2", diff --git a/packages/contact-center/station-login/src/station-login/station-login.presentational.tsx b/packages/contact-center/station-login/src/station-login/station-login.presentational.tsx index 67dbce79..c6375431 100644 --- a/packages/contact-center/station-login/src/station-login/station-login.presentational.tsx +++ b/packages/contact-center/station-login/src/station-login/station-login.presentational.tsx @@ -1,81 +1,107 @@ -import React, {useEffect} from 'react'; import {StationLoginPresentationalProps} from './station-login.types'; - +import React, {useState} from 'react'; import './station-login.style.scss'; +import {Input, Checkbox, Select, ButtonCircle, Icon} from '@momentum-ui/react-collaboration'; const StationLoginPresentational: React.FunctionComponent = (props) => { - const {name, teams, loginOptions, login, logout, setDeviceType, setDialNumber, setTeam} = props; // TODO: Use the loginSuccess, loginFailure, logoutSuccess props returned fromthe API response via helper file to reflect UI changes - - useEffect(() => { - const teamsDropdown = document.getElementById('teamsDropdown') as HTMLSelectElement; - const agentLogin = document.querySelector('#LoginOption') as HTMLSelectElement; - const dialNumber = document.querySelector('#dialNumber') as HTMLInputElement; - if (teamsDropdown) { - teamsDropdown.innerHTML = ''; - if (teams) { - teams.forEach((team) => { - const option = document.createElement('option'); - option.value = team.id; - option.text = team.name; - teamsDropdown.add(option); - }); - setTeam(teamsDropdown.value); - dialNumber.value = ''; - dialNumber.disabled = true; - } - } - if (loginOptions.length > 0) { - loginOptions.forEach((options)=> { - const option = document.createElement('option'); - option.text = options; - option.value = options; - agentLogin.add(option); - }); - } - }, [teams, loginOptions]); + const {name, teams, loginOptions, login, logout} = props; + const [handleCallsUsing, setHandleCallsUsing] = useState('Dial Number'); + const [dialNumber, setDialNumber] = useState('987654321'); + const [team, setTeam] = useState('Debit card'); + const [dontShowAgain, setDontShowAgain] = useState(false); - const selectLoginOption = (event: { target: { value: string; }; }) => { - const dialNumber = document.querySelector('#dialNumber') as HTMLInputElement; - const deviceType = event.target.value; - setDeviceType(deviceType); - if (deviceType === 'AGENT_DN' || deviceType === 'EXTENSION') { - dialNumber.disabled = false; - } else { - dialNumber.disabled = true; - } + const handleConfirm = () => { + alert('Login Success! Preferences confirmed!'); }; - function updateDN() { - const dialNumber = document.querySelector('#dialNumber') as HTMLInputElement; - setDialNumber(dialNumber.value); - } + const handleSignOut = () => { + alert('Signed out!'); + }; return ( - <>

{name}

-
-
-
- Agent -
-
-
- Select Team - -
-
- Agent Login - - - - -
-
-
-
-
-
+
+

Confirm your interaction preferences

+

Check your details and confirm to save and continue.

+ + {/* Handle calls using */} +
+ + setDialNumber(e.target.value)} placeholder="Enter number" /> +
+ + {/* Team */} +
+ +