style to implement flags and options on message

This commit is contained in:
grimhilt 2023-04-07 16:52:13 +02:00
parent 398d243eac
commit 20fe48974f
3 changed files with 36 additions and 20 deletions

View File

@ -14,6 +14,7 @@ const roomTitle = () => {
return props.room?.roomName; return props.room?.roomName;
}; };
// todo remove us from list
const to = () => props.room?.members.filter((member: Address) => member.type == "to"); const to = () => props.room?.members.filter((member: Address) => member.type == "to");
const cc = () => props.room?.members.filter((member: Address) => member.type == "cc"); const cc = () => props.room?.members.filter((member: Address) => member.type == "cc");
</script> </script>
@ -48,8 +49,7 @@ const cc = () => props.room?.members.filter((member: Address) => member.type ==
} }
.members-list { .members-list {
padding: 3px 0; padding: 3px 5px;
margin: 0 5px;
border-bottom: 1px solid #505050; border-bottom: 1px solid #505050;
} }
.members { .members {

View File

@ -11,6 +11,7 @@ const props = defineProps({ type: String, members: Object as PropType<Address[]>
// if (!props.members) continue; // if (!props.members) continue;
// members?.push(props?.members[0]); // members?.push(props?.members[0]);
// } // }
// todo deal with long list and responsive
</script> </script>
<template> <template>

View File

@ -6,7 +6,7 @@ import DOMPurify from "dompurify";
import { Address, Message } from "@/store/models/model"; import { Address, Message } from "@/store/models/model";
const props = defineProps({ const props = defineProps({
data: Object as PropType<Message>, msg: Object as PropType<Message>,
members: Array as PropType<Address[]>, members: Array as PropType<Address[]>,
}); });
const iframe = ref<HTMLIFrameElement>(); const iframe = ref<HTMLIFrameElement>();
@ -42,14 +42,14 @@ function setIframeContent(content: string | undefined) {
} }
watch( watch(
() => props.data, () => props.msg,
(newData: Message | undefined) => { (newData: Message | undefined) => {
setIframeContent(newData?.content); setIframeContent(newData?.content);
}, },
); );
onMounted(() => { onMounted(() => {
setIframeContent(props.data?.content); setIframeContent(props.msg?.content);
}); });
const displayAddresses = (addressIds: string[] | undefined): string => { const displayAddresses = (addressIds: string[] | undefined): string => {
@ -72,12 +72,12 @@ const displayAddresses = (addressIds: string[] | undefined): string => {
<div class="message"> <div class="message">
<div id="context"> <div id="context">
<div class="left" id="profile"> <div class="left" id="profile">
{{ displayAddresses(props.data?.fromA?.split(",")) }} - {{ props.data?.fromA }} {{ displayAddresses(props.msg?.fromA?.split(",")) }} - {{ props.msg?.fromA }}
</div> </div>
<div class="middle">{{ decodeEmojis(props.data?.subject) }}</div> <div class="middle">{{ decodeEmojis(props.msg?.subject) }}</div>
<div class="right" id="date"> <div class="right" id="date">
{{ {{
new Date(props.data?.date ?? "").toLocaleString("en-GB", { new Date(props.msg?.date ?? "").toLocaleString("en-GB", {
weekday: "short", weekday: "short",
year: "numeric", year: "numeric",
month: "2-digit", month: "2-digit",
@ -89,7 +89,10 @@ const displayAddresses = (addressIds: string[] | undefined): string => {
}} }}
</div> </div>
</div> </div>
<iframe ref="iframe"></iframe> <div class="content">
<iframe ref="iframe"></iframe>
<div class="options">options</div>
</div>
</div> </div>
</template> </template>
@ -106,17 +109,7 @@ const displayAddresses = (addressIds: string[] | undefined): string => {
justify-content: space-between; justify-content: space-between;
background-color: var(--quaternary-background); background-color: var(--quaternary-background);
padding: 3px 10px; padding: 3px 10px;
margin-bottom: 6px; border-radius: 4px 4px 0 0;
border-radius: 4px;
}
iframe {
overflow-y: auto;
max-height: 300px;
width: 100%;
border: none;
max-width: 600px; /* template width being 600px to 640px up to 750px (experiment and test) */
background-color: rgb(234, 234, 234);
} }
.left, .left,
@ -128,4 +121,26 @@ iframe {
margin: 0 10px; margin: 0 10px;
text-align: center; text-align: center;
} }
.content {
display: flex;
padding-top: 6px;
flex-direction: row;
/* background-color: #ec7a4342;
background-color: #353c6261; */
}
iframe {
overflow-y: auto;
max-height: 300px;
flex-basis: 100%;
border: none;
max-width: 600px; /* template width being 600px to 640px up to 750px (experiment and test) */
background-color: rgb(234, 234, 234);
}
.options {
flex: 1;
text-align: center;
}
</style> </style>