show notifications front
This commit is contained in:
parent
b14a0ca586
commit
8c6a2bcfd7
@ -76,6 +76,7 @@ export default class RegisterMessageInApp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async incrementNotSeen(roomId: number) {
|
async incrementNotSeen(roomId: number) {
|
||||||
|
// todo it appears there is an error with notifications
|
||||||
if (!this.isSeen) {
|
if (!this.isSeen) {
|
||||||
await incrementNotSeenRoom(roomId);
|
await incrementNotSeenRoom(roomId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,11 +13,11 @@ export default {
|
|||||||
},
|
},
|
||||||
color: {
|
color: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "#007bff",
|
|
||||||
},
|
},
|
||||||
type: {
|
type: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "badge-primary",
|
default: "badge-primary",
|
||||||
|
number: "badge-number",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -41,5 +41,8 @@ export default {
|
|||||||
background-color: #007bff;
|
background-color: #007bff;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* add more type classes for other types/colors */
|
.badge-number {
|
||||||
|
color: var(--primary-text);
|
||||||
|
background-color: #4d5970;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -23,7 +23,7 @@ export interface Room {
|
|||||||
mailboxId: number;
|
mailboxId: number;
|
||||||
user: string;
|
user: string;
|
||||||
userId: number;
|
userId: number;
|
||||||
unseen: number;
|
notSeen: number;
|
||||||
messages: Message[];
|
messages: Message[];
|
||||||
messageLoading: LoadingState;
|
messageLoading: LoadingState;
|
||||||
threadIds: number[];
|
threadIds: number[];
|
||||||
|
|||||||
@ -11,7 +11,7 @@ interface RoomFromBack {
|
|||||||
mailboxId: number;
|
mailboxId: number;
|
||||||
user: string;
|
user: string;
|
||||||
userId: number;
|
userId: number;
|
||||||
unseen: number;
|
notSeen: number;
|
||||||
parent_id?: number;
|
parent_id?: number;
|
||||||
// todo thread
|
// todo thread
|
||||||
}
|
}
|
||||||
@ -31,7 +31,7 @@ function createRoom(options: RoomFromBack): Room {
|
|||||||
mailboxId: options.mailboxId,
|
mailboxId: options.mailboxId,
|
||||||
userId: options.userId,
|
userId: options.userId,
|
||||||
user: options.user,
|
user: options.user,
|
||||||
unseen: 0,
|
notSeen: options.notSeen,
|
||||||
messages: [],
|
messages: [],
|
||||||
messageLoading: LoadingState.notLoaded,
|
messageLoading: LoadingState.notLoaded,
|
||||||
threadIds: [],
|
threadIds: [],
|
||||||
|
|||||||
@ -98,15 +98,17 @@ const displayAddresses = (addressesId) => {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
background-color: blue;
|
background-color: var(--quaternary-background);
|
||||||
padding: 3px;
|
padding: 3px 10px;
|
||||||
margin-bottom: 6px;
|
margin-bottom: 6px;
|
||||||
|
border-radius: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
iframe {
|
iframe {
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
max-height: 300px;
|
max-height: 300px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
border: none;
|
||||||
padding: 2px 10px;
|
padding: 2px 10px;
|
||||||
max-width: 750px; /* template width being 600px to 640px up to 750px (experiment and test) */
|
max-width: 750px; /* template width being 600px to 640px up to 750px (experiment and test) */
|
||||||
background-color: rgb(234, 234, 234);
|
background-color: rgb(234, 234, 234);
|
||||||
|
|||||||
@ -34,9 +34,8 @@ const router = useRouter();
|
|||||||
<div class="sender">{{ props.data.user }}</div>
|
<div class="sender">{{ props.data.user }}</div>
|
||||||
<div class="object">{{ props.data.roomName }}</div>
|
<div class="object">{{ props.data.roomName }}</div>
|
||||||
</div>
|
</div>
|
||||||
<Badge class="badge" v-if="props.data.unseen > 0"
|
{{ props.data.unseen }}
|
||||||
><template v-slot:body>{{ props.data.unseen }}</template>
|
<Badge class="badge" v-if="props.data.notSeen > 0" :value="props.data.notSeen" type="badge-number" />
|
||||||
</Badge>
|
|
||||||
</div>
|
</div>
|
||||||
<ThreadList :threadIds="props.data.threadIds" />
|
<ThreadList :threadIds="props.data.threadIds" />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -18,6 +18,7 @@ const router = useRouter();
|
|||||||
class="room"
|
class="room"
|
||||||
>
|
>
|
||||||
{{ room.roomName }}
|
{{ room.roomName }}
|
||||||
|
<Badge class="badge" v-if="room.notSeen > 0" :value="room.notSeen" type="badge-number" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user