diff --git a/app/client/web/src/call/Call.module.css b/app/client/web/src/call/Call.module.css
index 52e8604b..e178d3fd 100644
--- a/app/client/web/src/call/Call.module.css
+++ b/app/client/web/src/call/Call.module.css
@@ -2,65 +2,64 @@
width: 100%;
height: 100%;
position: absolute;
+ top: 0;
+ left: 0;
+ z-index: 10;
}
.inactive {
display: none;
}
+.titleView {
+ position: absolute;
+ width: 100%;
+ height: 100%;
+ padding-top: 32px;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+
+ .titleName {
+ font-size: 32px;
+ padding-bottom: 32px;
+ }
+
+ .image {
+ height: 50%;
+ width: 50%;
+ display: flex;
+ justify-content: center;
+
+ .frame {
+ width: fit-content;
+ height: 100%;
+ }
+
+ .logo {
+ width: 100%;
+ height: 100%;
+ }
+ }
+
+ .titleStatus {
+ font-size: 24;
+ padding-top: 16px;
+ }
+}
+.buttons {
+ background-color: var(--mantine-color-surface-2);
+ position: absolute;
+ bottom: 92px;
+ opacity: 0.8;
+ padding: 16px;
+ border-radius: 8px;
+ gap: 16px;
+ display: flex;
+}
.call {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
-}
-.controls {
- display: flex;
- flex-direction: row;
- align-items: center;
- position: absolute;
- bottom: 10%;
- padding: 8;
- gap: 12;
- border-radius: 8;
- opacity: 0.7;
-}
-.full {
- width: 100%;
- height: 100%;
-}
-.box {
- position: absolute;
- top: 10%;
- right: 10%;
- width: 20%;
- height: 20%;
-}
-.titleView {
- position: absolute;
- top: 0;
- width: 100%;
- height: 100%;
- display: flex;
- flex-direction: column;
- align-items: center;
- paddingTop: 92;
-}
-.titleName {
- font-size: 24;
- padding-bottom: 32;
-}
-.titleImage {
- width: 80%;
- height: auto;
- aspect-ratio: 1;
- border-radius: 8;
-}
-.duration {
- padding-top: 16;
- font-size: 20;
-}
-.logoView {
- height: 100%;
- width: auto;
- aspect-ratio: 1;
+ background-color: var(--mantine-color-surface-4);
}
diff --git a/app/client/web/src/call/Call.tsx b/app/client/web/src/call/Call.tsx
index 7bb8d52c..c28f9371 100644
--- a/app/client/web/src/call/Call.tsx
+++ b/app/client/web/src/call/Call.tsx
@@ -4,6 +4,8 @@ import classes from './Call.module.css'
import { Card as Contact } from '../card/Card';
import { Colors } from '../constants/Colors';
import { modals } from '@mantine/modals'
+import { Image, Text, ActionIcon } from '@mantine/core'
+import { IconPhone, IconMicrophone, IconMicrophoneOff, IconVideo, IconVideoOff } from '@tabler/icons-react'
export function Call() {
const { state, actions } = useCall();
@@ -76,7 +78,47 @@ export function Call() {
}
return (
-
+
+ { state.calling && (
+
+
+
+ { state.calling.name && (
+
{ state.calling.name }
+ )}
+ { !state.calling.name && (
+
{ `${state.calling.handle}/${state.calling.node}` }
+ )}
+
+
{ `${Math.floor(state.duration/60)}:${(state.duration % 60).toString().padStart(2, '0')}` }
+
+
+
+
+ { state.audioEnabled && (
+
+ )}
+ { !state.audioEnabled && (
+
+ )}
+
+
+ { state.videoEnabled && (
+
+ )}
+ { !state.videoEnabled && (
+
+ )}
+
+
+
+
+ )}
+
);
}
diff --git a/app/client/web/src/context/useRingContext.hook.ts b/app/client/web/src/context/useRingContext.hook.ts
index 7e16fb68..20014fe7 100644
--- a/app/client/web/src/context/useRingContext.hook.ts
+++ b/app/client/web/src/context/useRingContext.hook.ts
@@ -86,7 +86,7 @@ export function useRingContext() {
console.log(err);
}
} else if (status === 'closed') {
- await cleanup;
+ await cleanup();
}
}
}
@@ -190,6 +190,7 @@ export function useRingContext() {
}
const cleanup = async () => {
+console.log("CLEANUP!");
closing.current = true;
while (updatingPeer.current || connecting.current) {
await new Promise((r) => setTimeout(r, CLOSE_POLL_MS));
@@ -213,6 +214,7 @@ export function useRingContext() {
peerUpdate.current = [];
updateState({ calling: null, connected: false, connectedTime: 0, failed: false, localStream: null, remoteStream: null, localVideo: false, remoteVideo: false });
closing.current = false;
+console.log("!!");
}
const transmit = (ice: { urls: string; username: string; credential: string }[]) => {
diff --git a/app/client/web/src/ring/Ring.tsx b/app/client/web/src/ring/Ring.tsx
index cd763068..50ae5a15 100644
--- a/app/client/web/src/ring/Ring.tsx
+++ b/app/client/web/src/ring/Ring.tsx
@@ -2,6 +2,7 @@ import React, { useEffect, useState } from 'react';
import { useRing } from './useRing.hook';
import classes from './Ring.module.css';
import { Card as Contact } from '../card/Card';
+import { Card } from 'databag-client-sdk';
import { Colors } from '../constants/Colors';
import { modals } from '@mantine/modals'
import { Loader, Image, Text, ActionIcon } from '@mantine/core'
@@ -59,7 +60,7 @@ export function Ring() {
}
}
- const accept = async (callId, card) => {
+ const accept = async (callId: string, card: Card) => {
if (!accepting) {
setAccepting(callId);
try {
@@ -72,7 +73,7 @@ export function Ring() {
}
}
- const ignore = async (callId, card) => {
+ const ignore = async (callId: string, card: Card) => {
if (!ignoring) {
setIgnoring(callId);
try {
@@ -85,7 +86,7 @@ export function Ring() {
}
}
- const decline = async (callId, card) => {
+ const decline = async (callId: string, card: Card) => {
if (!declining) {
setDeclining(callId);
try {
@@ -124,7 +125,7 @@ export function Ring() {
)}
{ state.calling && (
-
+
{ state.audioEnabled && (
)}
@@ -132,7 +133,7 @@ export function Ring() {
)}
-
+ actions.setFullscreen(true)}>
@@ -140,7 +141,7 @@ export function Ring() {
{ state.calling.name }
)}
{ !state.calling.name && (
- { state.strings.name }
+ { state.strings.name }
)}