-
Notifications
You must be signed in to change notification settings - Fork 1
UI Changes #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
UI Changes #2
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,45 +1,88 @@ | ||||||||||||||||||||||
@import url(https://fonts.googleapis.com/css?family=Roboto:400,100); | ||||||||||||||||||||||
|
||||||||||||||||||||||
/* Color Scheme */ | ||||||||||||||||||||||
:root { | ||||||||||||||||||||||
--primary: #2196F3; | ||||||||||||||||||||||
--primary-variant: #1976D2; | ||||||||||||||||||||||
--secondary: #26A69A; | ||||||||||||||||||||||
--background: #F0F2F5; | ||||||||||||||||||||||
--surface: #FFFFFF; | ||||||||||||||||||||||
--text-primary: #212121; | ||||||||||||||||||||||
--text-secondary: #757575; | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
/* Global Styles */ | ||||||||||||||||||||||
body{ | ||||||||||||||||||||||
font-family: 'Roboto'; | ||||||||||||||||||||||
background-color: var(--background); | ||||||||||||||||||||||
font-size: 16px; | ||||||||||||||||||||||
line-height: 1.5; | ||||||||||||||||||||||
color: var(--text-primary); | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
nav.navbar{ | ||||||||||||||||||||||
nav.navbar { | ||||||||||||||||||||||
display: flex; | ||||||||||||||||||||||
align-items: center; | ||||||||||||||||||||||
min-height: 65px; | ||||||||||||||||||||||
background-color: var(--primary); | ||||||||||||||||||||||
color: var(--surface); | ||||||||||||||||||||||
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1); | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
.alert-danger{ | ||||||||||||||||||||||
background-color: #F2DEDE; /* very pale pink */ | ||||||||||||||||||||||
color: #8A4A4A; /* muted red */ | ||||||||||||||||||||||
padding: 15px; | ||||||||||||||||||||||
border-radius: 5px; | ||||||||||||||||||||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); | ||||||||||||||||||||||
border: none; | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
.login-container{ | ||||||||||||||||||||||
margin-top: 100px; | ||||||||||||||||||||||
display: flex; | ||||||||||||||||||||||
justify-content: center; | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
|
||||||||||||||||||||||
.info-container{ | ||||||||||||||||||||||
margin:50px; | ||||||||||||||||||||||
margin-top: 100px; | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
.login{ | ||||||||||||||||||||||
width: 400px; | ||||||||||||||||||||||
padding: 40px; | ||||||||||||||||||||||
background-color: #F7F7F7; | ||||||||||||||||||||||
margin: 0 auto 10px; | ||||||||||||||||||||||
border-radius: 2px; | ||||||||||||||||||||||
box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3); | ||||||||||||||||||||||
overflow: hidden; | ||||||||||||||||||||||
width: 400px; | ||||||||||||||||||||||
padding: 40px; | ||||||||||||||||||||||
background-color: var(--surface); | ||||||||||||||||||||||
margin: 0 auto 10px; | ||||||||||||||||||||||
border-radius: 8px; | ||||||||||||||||||||||
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1); | ||||||||||||||||||||||
overflow: hidden; | ||||||||||||||||||||||
} | ||||||||||||||||||||||
.name{ | ||||||||||||||||||||||
color: #fff; | ||||||||||||||||||||||
color: var(--surface); | ||||||||||||||||||||||
margin: 0 15px; | ||||||||||||||||||||||
font-weight: bold; | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
.message{ | ||||||||||||||||||||||
margin-top: 10px; | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
.loading{ | ||||||||||||||||||||||
margin-right: 10px; | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
/*Form*/ | ||||||||||||||||||||||
|
||||||||||||||||||||||
input[type="text"], input[type="password"] { | ||||||||||||||||||||||
border: 1px solid var(--text-secondary); | ||||||||||||||||||||||
border-radius: 4px; | ||||||||||||||||||||||
padding: 8px; | ||||||||||||||||||||||
margin-bottom: 10px; | ||||||||||||||||||||||
width: 100%; | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
/* Progress Bar */ | ||||||||||||||||||||||
/* Thanks to https://codepen.io/holdencreative/pen/vEVbwv */ | ||||||||||||||||||||||
.progress-loader { | ||||||||||||||||||||||
|
@@ -50,11 +93,11 @@ nav.navbar{ | |||||||||||||||||||||
background-color: #acece6; | ||||||||||||||||||||||
background-clip: padding-box; | ||||||||||||||||||||||
overflow: hidden; } | ||||||||||||||||||||||
.progress-loader .determinate { | ||||||||||||||||||||||
position: absolute; | ||||||||||||||||||||||
background-color: inherit; | ||||||||||||||||||||||
top: 0; | ||||||||||||||||||||||
bottom: 0; | ||||||||||||||||||||||
.progress-loader .determinate { | ||||||||||||||||||||||
position: absolute; | ||||||||||||||||||||||
background-color: inherit; | ||||||||||||||||||||||
top: 0; | ||||||||||||||||||||||
bottom: 0; | ||||||||||||||||||||||
background-color: #26a69a; | ||||||||||||||||||||||
transition: width .3s linear; } | ||||||||||||||||||||||
.progress-loader .indeterminate { | ||||||||||||||||||||||
|
@@ -127,87 +170,108 @@ nav.navbar{ | |||||||||||||||||||||
.dialer { | ||||||||||||||||||||||
margin: 20px auto 0; | ||||||||||||||||||||||
width: 280px; | ||||||||||||||||||||||
text-align: center; | ||||||||||||||||||||||
box-shadow: 20px 20px 10px grey; | ||||||||||||||||||||||
text-align: center; | ||||||||||||||||||||||
background-color: var(--surface); | ||||||||||||||||||||||
border-radius: 10px; | ||||||||||||||||||||||
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1); | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
.StatusArea { | ||||||||||||||||||||||
padding-top: 7px; | ||||||||||||||||||||||
height: 120px; | ||||||||||||||||||||||
width: 280px; | ||||||||||||||||||||||
padding: 15px; | ||||||||||||||||||||||
width: 100%; | ||||||||||||||||||||||
Comment on lines
180
to
+182
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix property override in StatusArea There's a conflict between padding-top and padding properties which may lead to unexpected styling. According to the static analysis hint, you should remove the redundant padding-top property: .StatusArea {
- padding-top: 7px;
padding: 15px;
width: 100%;
/* rest of the properties */
} 📝 Committable suggestion
Suggested change
🧰 Tools🪛 Biome (1.9.4)[error] 172-172: Unexpected shorthand property padding after padding-top (lint/suspicious/noShorthandPropertyOverrides) |
||||||||||||||||||||||
text-align: center; | ||||||||||||||||||||||
font-size: 16px; | ||||||||||||||||||||||
background-color: #0470bf; | ||||||||||||||||||||||
color: white; | ||||||||||||||||||||||
background-color: var(--primary); | ||||||||||||||||||||||
color: var(--surface); | ||||||||||||||||||||||
font-weight: bold; | ||||||||||||||||||||||
border-style: outset; | ||||||||||||||||||||||
border-color: #599ef2; | ||||||||||||||||||||||
border-top-left-radius: 10px; | ||||||||||||||||||||||
border-top-right-radius: 10px; | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
.functionArea { | ||||||||||||||||||||||
display: grid; | ||||||||||||||||||||||
grid-template-columns: repeat(2, 1fr); | ||||||||||||||||||||||
grid-auto-rows: minmax(2px, auto); | ||||||||||||||||||||||
grid-auto-rows: minmax(60px, auto); | ||||||||||||||||||||||
text-align: center; | ||||||||||||||||||||||
background-color: #eaeaea; | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
.keypad { | ||||||||||||||||||||||
display: grid; | ||||||||||||||||||||||
grid-template-columns: repeat(3, 1fr); | ||||||||||||||||||||||
grid-auto-rows: minmax(80px, auto); | ||||||||||||||||||||||
grid-auto-rows: minmax(70px, auto); | ||||||||||||||||||||||
text-align: center; | ||||||||||||||||||||||
background-color: #eaeaea; | ||||||||||||||||||||||
gap: 5px; /* Keep horizontal gap at 5px */ | ||||||||||||||||||||||
row-gap: 3px; /* Reduce vertical gap to 3px */ | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
.button { | ||||||||||||||||||||||
margin: 18px auto 0; | ||||||||||||||||||||||
border-radius: 4px; | ||||||||||||||||||||||
margin: 10px auto; | ||||||||||||||||||||||
border-radius: 8px; | ||||||||||||||||||||||
width: 85%; | ||||||||||||||||||||||
height: 70%; | ||||||||||||||||||||||
padding: 8px; | ||||||||||||||||||||||
background: #027cd5; | ||||||||||||||||||||||
color: white; | ||||||||||||||||||||||
border-color: #599ef2; | ||||||||||||||||||||||
border-style: outset; | ||||||||||||||||||||||
display: flex; | ||||||||||||||||||||||
align-items: center; | ||||||||||||||||||||||
justify-content: center; | ||||||||||||||||||||||
flex-direction: column; | ||||||||||||||||||||||
background-color: #E3F2FD; /* Lighter blue */ | ||||||||||||||||||||||
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.2); /* Subtle shadow */ | ||||||||||||||||||||||
color: var(--text-primary); | ||||||||||||||||||||||
border: none; | ||||||||||||||||||||||
font-weight: bold; | ||||||||||||||||||||||
font-size: 18px; | ||||||||||||||||||||||
|
||||||||||||||||||||||
|
||||||||||||||||||||||
|
||||||||||||||||||||||
cursor: pointer; | ||||||||||||||||||||||
font-family: 'Roboto', serif; | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
.button:hover { | ||||||||||||||||||||||
background: #166095; | ||||||||||||||||||||||
background: var(--primary); | ||||||||||||||||||||||
|
||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
input[type="display"] { | ||||||||||||||||||||||
height: 60px; | ||||||||||||||||||||||
width: 280px; | ||||||||||||||||||||||
text-align: center; | ||||||||||||||||||||||
font-size: 22px; | ||||||||||||||||||||||
background-color: #0470bf; | ||||||||||||||||||||||
color: white; | ||||||||||||||||||||||
font-weight: bold; | ||||||||||||||||||||||
outline: none !important; | ||||||||||||||||||||||
border-style: none; | ||||||||||||||||||||||
height: 60px; /* Keep the fixed height */ | ||||||||||||||||||||||
width: 100%; /* Fill available width */ | ||||||||||||||||||||||
font-size: 22px; /* Keep the font size */ | ||||||||||||||||||||||
background-color: #E3F2FD; /* Keep the background color */ | ||||||||||||||||||||||
color: var(--text-primary); /* Keep the text color */ | ||||||||||||||||||||||
font-weight: bold; /* Keep the font weight */ | ||||||||||||||||||||||
white-space: nowrap; /* Prevent text from wrapping */ | ||||||||||||||||||||||
overflow-x: auto; /* Enable horizontal scrolling */ | ||||||||||||||||||||||
text-align: center; /* Align to center */ | ||||||||||||||||||||||
border: none; | ||||||||||||||||||||||
outline: none; | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
.functionButton { | ||||||||||||||||||||||
margin: 10px auto; | ||||||||||||||||||||||
width: 60px; | ||||||||||||||||||||||
height: 60px; | ||||||||||||||||||||||
background-color: #eaeaea; | ||||||||||||||||||||||
border-style: none; | ||||||||||||||||||||||
outline: none !important; | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
.functionButton:hover { | ||||||||||||||||||||||
opacity: 0.50; | ||||||||||||||||||||||
} | ||||||||||||||||||||||
width: 85%; | ||||||||||||||||||||||
background-color: var(--surface); /* Match number button background */ | ||||||||||||||||||||||
border: none; /* Remove border */ | ||||||||||||||||||||||
border-radius: 8px; /* Match number button border-radius */ | ||||||||||||||||||||||
outline: none !important; | ||||||||||||||||||||||
display: flex; | ||||||||||||||||||||||
align-items: center; | ||||||||||||||||||||||
justify-content: center; | ||||||||||||||||||||||
position: relative; | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
.functionButton:hover { | ||||||||||||||||||||||
background-color: var(--primary); | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
|
||||||||||||||||||||||
.sub-dig { | ||||||||||||||||||||||
font-size: 12px; | ||||||||||||||||||||||
font-weight: 500; | ||||||||||||||||||||||
position: relative; | ||||||||||||||||||||||
top: -3px; | ||||||||||||||||||||||
|
||||||||||||||||||||||
pointer-events: none; | ||||||||||||||||||||||
margin-top: -3px; | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
.overflowing { | ||||||||||||||||||||||
text-align: right; | ||||||||||||||||||||||
} |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,4 +1,4 @@ | ||||||
import React, {Fragment, useEffect, useState, useCallback} from 'react'; | ||||||
import React, {Fragment, useEffect, useState, useCallback, useRef} from 'react'; | ||||||
import {shallowEqual, useDispatch, useSelector} from 'react-redux'; | ||||||
import Form from 'react-bootstrap/Form'; | ||||||
import Button from 'react-bootstrap/Button'; | ||||||
|
@@ -7,7 +7,7 @@ import Spinner from 'react-bootstrap/Spinner'; | |||||
import {SlideDown} from 'react-slidedown' | ||||||
import 'react-slidedown/lib/slidedown.css' | ||||||
import {callStatus, dial, dtmf, getAccounts, getSoftphoneStatus, hangUp, hold, loginSync, logout, unHold, updateCallStatus} from './actions'; | ||||||
import {ToastContainer} from 'react-toastify'; | ||||||
import {ToastContainer, Bounce} from 'react-toastify'; | ||||||
import logo from './logo.png'; | ||||||
import {CALL_TERMINATE, CONFIRMED, DISCONNECTED, LOADER, EARLY, LOCAL_HOLD} from './constant'; | ||||||
import './App.css'; | ||||||
|
@@ -136,6 +136,8 @@ function WSEventStream() { | |||||
function Dialer() { | ||||||
const dispatch = useDispatch(); | ||||||
const loading = useSelector(state => state.loading, shallowEqual); | ||||||
const inputRef = useRef(null); | ||||||
|
||||||
Comment on lines
+139
to
+140
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Input reference created but not attached to any element The inputRef is created but never attached to an input element. This will cause the useEffect hook that uses this reference to not work as expected. You need to attach the ref to the input element on line 280: -<SlideDown><form><input type="display" value={phoneNumber} onChange={(ev) => setPhoneNumber(ev.target.value)}/></form></SlideDown>
+<SlideDown><form><input ref={inputRef} type="display" value={phoneNumber} onChange={(ev) => setPhoneNumber(ev.target.value)}/></form></SlideDown> 📝 Committable suggestion
Suggested change
|
||||||
const [phoneNumber, setPhoneNumber] = useState(""); | ||||||
const isCallDialed = useSelector(state => state.callDialed, shallowEqual); | ||||||
const accountName = useSelector(state => state.accountName, shallowEqual); | ||||||
|
@@ -156,7 +158,9 @@ function Dialer() { | |||||
} | ||||||
|
||||||
function clear() { | ||||||
setPhoneNumber(""); | ||||||
if (phoneNumber.length > 0) { | ||||||
setPhoneNumber(phoneNumber.slice(0, -1)); | ||||||
} | ||||||
} | ||||||
|
||||||
const dialNumber = () => { | ||||||
|
@@ -236,6 +240,22 @@ function Dialer() { | |||||
return () => clearInterval(interval); | ||||||
}, [isCallDialed]); | ||||||
|
||||||
useEffect(() => { | ||||||
if (inputRef.current) { | ||||||
const input = inputRef.current; | ||||||
|
||||||
if (input.scrollWidth > input.clientWidth) { | ||||||
input.classList.add('overflowing'); | ||||||
input.scrollLeft = input.scrollWidth; | ||||||
} else { | ||||||
input.classList.remove('overflowing'); | ||||||
} | ||||||
} | ||||||
}, [phoneNumber]); | ||||||
|
||||||
|
||||||
|
||||||
|
||||||
return ( | ||||||
<div className="dialer"> | ||||||
<WSEventStream/> | ||||||
|
@@ -256,7 +276,7 @@ function Dialer() { | |||||
</div> | ||||||
))} | ||||||
|
||||||
|
||||||
<SlideDown><form><input type="display" value={phoneNumber} onChange={(ev) => setPhoneNumber(ev.target.value)}/></form></SlideDown> | ||||||
|
||||||
{loading && | ||||||
|
@@ -339,7 +359,19 @@ function App() { | |||||
},[dispatch]) | ||||||
return ( | ||||||
<Fragment> | ||||||
<ToastContainer/> | ||||||
<ToastContainer | ||||||
position="top-right" | ||||||
autoClose={5000} | ||||||
hideProgressBar={false} | ||||||
newestOnTop={false} | ||||||
closeOnClick={false} | ||||||
rtl={false} | ||||||
pauseOnFocusLoss | ||||||
draggable | ||||||
pauseOnHover | ||||||
theme="light" | ||||||
transition={Bounce} | ||||||
/> | ||||||
<header-nav> | ||||||
<nav className="navbar" style={{backgroundColor: "rgb(40, 116, 240)"}}> | ||||||
<div className="navbar-logo"> | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Potential Contrast Issue with
.name
: The.name
class is set to usecolor: var(--surface)
, which is the same value used as the background color for the.login
container. This could lead to poor readability. Please confirm whether this was intentional or consider using a contrasting color (for example,var(--text-primary)
).