Add compose preview with image attachments (NIP-92 imeta)

This commit is contained in:
Avi 2026-08-04 13:30:30 -05:00
commit 3e3467b006
11 changed files with 710 additions and 57 deletions

View file

@ -1140,6 +1140,121 @@ select {
gap: 10px;
}
.compose-tabs {
display: flex;
gap: 4px;
padding-bottom: 12px;
border-bottom: 1px solid var(--border);
margin-bottom: 14px;
}
.compose-tab {
font: inherit;
font-size: 14px;
font-weight: 500;
padding: 7px 16px;
border-radius: 999px;
border: 1px solid var(--border);
background: transparent;
color: var(--text-muted);
cursor: pointer;
}
.compose-tab:hover {
color: var(--text);
border-color: var(--text-muted);
}
.compose-tab.is-active {
color: var(--primary);
border-color: var(--primary);
background: var(--primary-soft);
}
.compose-attachments {
display: flex;
flex-wrap: wrap;
gap: 10px;
margin-top: 12px;
}
.compose-attachment {
display: flex;
align-items: center;
gap: 8px;
padding: 6px 8px 6px 6px;
border: 1px solid var(--border);
border-radius: 10px;
background: var(--surface);
}
.compose-attachment-thumb {
width: 44px;
height: 44px;
border-radius: 8px;
object-fit: cover;
}
.compose-attachment-name {
max-width: 180px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 13px;
color: var(--text-muted);
}
.compose-preview {
border: 1px solid var(--border);
border-radius: 12px;
padding: 16px;
min-height: 160px;
}
.compose-preview-head {
display: flex;
align-items: center;
gap: 12px;
padding-bottom: 12px;
border-bottom: 1px solid var(--border);
}
.compose-preview-head > div {
display: flex;
flex-direction: column;
gap: 2px;
}
.compose-preview-head .mono {
color: var(--text-muted);
font-size: 13px;
}
.compose-preview-body {
margin-top: 12px;
}
.compose-preview .note-text {
margin: 0;
white-space: pre-wrap;
word-break: break-word;
line-height: 1.55;
}
.compose-preview-images {
display: flex;
flex-wrap: wrap;
gap: 10px;
margin-top: 12px;
}
.compose-preview-img {
max-width: 100%;
max-height: 320px;
border-radius: 10px;
object-fit: contain;
}
/* -------------------------------------------------------------------------
Relays
------------------------------------------------------------------------- */