-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7f7096f
commit 7de35fd
Showing
129 changed files
with
3,791 additions
and
3,014 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,21 @@ | ||
import React from "react"; | ||
import "./style.scss"; | ||
|
||
class Avatar extends React.Component { | ||
constructor(props) { | ||
super(props) | ||
this.state = { | ||
src: "" | ||
} | ||
|
||
} | ||
static getDerivedStateFromProps(props, state) { | ||
return props; | ||
|
||
} | ||
|
||
render() { | ||
return ( | ||
|
||
<span className="cp-avatar-wrapper"> | ||
{this.state.src.uid ? ((this.state.src.avatar) ? <img className="cp-avatar" src={this.state.src.avatar} alt="User" /> : <div className="cp-avatar-alternate">{this.state.src.name.charAt(0)}</div>) : ((this.state.src.icon) ? <img className="cp-avatar" src={this.state.src.icon} alt="Group" /> : <div className="cp-avatar-alternate">{this.state.src.name.charAt(0)}</div>)} | ||
|
||
</span> | ||
|
||
); | ||
} | ||
const avatar = (props) => { | ||
|
||
const borderWidth = props.borderWidth || '1px'; | ||
const borderColor = props.borderColor || '#AAA'; | ||
const cornerRadius = props.cornerRadius || '50%'; | ||
const image = props.image; | ||
|
||
const getStyle = () => ({borderWidth:borderWidth, borderStyle:'solid',borderColor:borderColor ,'borderRadius': cornerRadius}) | ||
|
||
return ( | ||
<div className="avatar" style={getStyle()}> | ||
<img src={image} alt="Avatar" /> | ||
</div> | ||
); | ||
|
||
} | ||
|
||
|
||
|
||
export default Avatar; | ||
export const avatar=Avatar; | ||
Avatar.defaultProps = { | ||
src: "" | ||
}; | ||
export default avatar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,53 @@ | ||
@import '../../resources/mixins'; | ||
@import '../../resources/colors.scss'; | ||
@import "../../resources/mixins"; | ||
@import "../../resources/colors.scss"; | ||
|
||
.cp-avatar-wrapper{ | ||
-webkit-box-sizing: border-box; | ||
box-sizing: border-box; | ||
margin: 0; | ||
padding: 0; | ||
list-style: none; | ||
display: inline-block; | ||
text-align: center; | ||
background: #ccc; | ||
color: #fff; | ||
white-space: nowrap; | ||
position: relative; | ||
// .cp-avatar-wrapper { | ||
// -webkit-box-sizing: border-box; | ||
// box-sizing: border-box; | ||
// margin: 0; | ||
// padding: 0; | ||
// list-style: none; | ||
// display: inline-block; | ||
// text-align: center; | ||
// background: #ccc; | ||
// color: #fff; | ||
// white-space: nowrap; | ||
// position: relative; | ||
// overflow: hidden; | ||
// vertical-align: middle; | ||
// width: 32px; | ||
// height: 32px; | ||
// line-height: 32px; | ||
// border-radius: 50%; | ||
// margin-top: 4px; | ||
// } | ||
// .cp-avatar { | ||
// width: 100%; | ||
// height: 100%; | ||
// display: block; | ||
|
||
// background: $gray-lighten; | ||
// } | ||
// .cp-avatar-alternate { | ||
// font-size: 18px; | ||
// font-weight: 600; | ||
// text-transform: capitalize; | ||
// background-color: $blue-background-primary; | ||
// } | ||
|
||
.avatar { | ||
height: 28px; | ||
max-height: 28px; | ||
max-width: 28px; | ||
overflow: hidden; | ||
vertical-align: middle; | ||
width: 32px; | ||
height: 32px; | ||
line-height: 32px; | ||
border-radius: 50%; | ||
margin-top: 4px; | ||
min-width: 28px; | ||
min-height: 28px; | ||
} | ||
.cp-avatar { | ||
width: 100%; | ||
height: 100%; | ||
display: block; | ||
|
||
background:$gray-lighten; | ||
|
||
.avatar { | ||
img { | ||
max-width: 100%; | ||
max-height: 100%; | ||
min-width: 100%; | ||
} | ||
} | ||
.cp-avatar-alternate{ | ||
font-size: 18px; | ||
font-weight: 600; | ||
text-transform: capitalize; | ||
background-color:$blue-background-primary; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,18 @@ | ||
import React from "react"; | ||
import "./style.scss"; | ||
|
||
const badgecount = (props) => { | ||
|
||
class BadgeCount extends React.Component { | ||
constructor(props){ | ||
super(props) | ||
this.state={ | ||
count:"" | ||
} | ||
let count = ""; | ||
|
||
} | ||
static getDerivedStateFromProps(props,state){ | ||
return props; | ||
|
||
} | ||
|
||
render() { | ||
return ( | ||
<> | ||
{(this.state.count>0)? <div className="cp-badge-wrapper"> | ||
<span className="cp-badge" >{((this.state.count)? this.state.count:"")}</span> | ||
</div>:""} | ||
|
||
</> | ||
if(props.count) { | ||
count = ( | ||
<div className="cp-badge-wrapper"> | ||
<span className="cp-badge">{props.count}</span> | ||
</div> | ||
); | ||
} | ||
return count; | ||
} | ||
|
||
|
||
|
||
export default BadgeCount; | ||
export const badgeCount=BadgeCount; | ||
BadgeCount.defaultProps = { | ||
src:"" | ||
}; | ||
export default badgecount; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,37 @@ | ||
import { CometChat } from "@cometchat-pro/chat" | ||
import { CometChat } from "@cometchat-pro/chat"; | ||
|
||
export class CometChatManager { | ||
import * as enums from '../../util/enums.js'; | ||
|
||
constructor() { | ||
export class CallScreenManager { | ||
|
||
} | ||
isUserLogedIn; | ||
logedInUser; | ||
isCometChatUserLogedIn() { | ||
let timerCounter = 10000; | ||
let timer = 0; | ||
return new Promise((resolve, reject) => { | ||
if (timerCounter === timer) reject(); | ||
if (this.logedInUser) { resolve(this.logedInUser); return; } | ||
|
||
this.isUserLogedIn = setInterval(() => { | ||
if (CometChat.isInitialized()) { | ||
CometChat.getLoggedinUser().then(user => { | ||
this.logedInUser = user; | ||
clearInterval(this.isUserLogedIn); | ||
resolve(user); | ||
timer = 0; | ||
}, error => { | ||
console.log(error); | ||
}) | ||
} else { | ||
} | ||
timer = + 100; | ||
}, 100); | ||
}); | ||
} | ||
attachCallListener(callback) { | ||
var listenerID = "UNIQUE_LISTENER_ID"; | ||
callListenerId = new Date().getTime(); | ||
|
||
attachListeners(callback) { | ||
|
||
CometChat.addCallListener( | ||
this.callListenerId, | ||
new CometChat.CallListener({ | ||
onIncomingCallReceived: call => { | ||
callback(enums.INCOMING_CALL_RECEIVED, call); | ||
}, | ||
onOutgoingCallAccepted: call => { | ||
callback(enums.OUTGOING_CALL_ACCEPTED, call); | ||
}, | ||
onOutgoingCallRejected: call => { | ||
console.log("[onOutgoingCallRejected]", call) | ||
callback(enums.OUTGOING_CALL_REJECTED, call); | ||
}, | ||
onIncomingCallCancelled: call => { | ||
callback(enums.INCOMING_CALL_CANCELLED, call); | ||
} | ||
}) | ||
); | ||
|
||
} | ||
checkAndSendToCallback(callback, message, isReceipt = false) { | ||
callback(message, isReceipt); | ||
} | ||
|
||
removeListeners() { | ||
|
||
CometChat.removeCallListener(this.callListenerId); | ||
|
||
} | ||
} |
Oops, something went wrong.