Skip to content

Commit

Permalink
fix: show attachments as list
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfriesen committed Oct 15, 2024
1 parent cd881e1 commit 236d6e5
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 18 deletions.
36 changes: 21 additions & 15 deletions src/app/components/attachments/attachments.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,30 @@
</mat-expansion-panel-header>

<ng-template matExpansionPanelContent>
@for (attachment of attachments(); track attachment.name) {
<div class="item">
<button class="tool" mat-mini-fab (click)="inspectAttachment(attachment)">
<mat-icon>search</mat-icon>
</button>
<div class="list">
@for (attachment of attachments(); track attachment.name) {
<div class="item">
<button
class="tool"
mat-mini-fab
(click)="inspectAttachment(attachment)"
>
<mat-icon>search</mat-icon>
</button>

@if (attachment.mimeType.includes('image/')) {
<mat-icon class="icon large" svgIcon="image" />
} @else if (attachment.mimeType.includes('xml')) {
<mat-icon class="icon large" svgIcon="xml" />
} @else {
<mat-icon class="icon large" svgIcon="unknown" />
}
@if (attachment.mimeType.includes('image/')) {
<mat-icon class="icon large" svgIcon="image" />
} @else if (attachment.mimeType.includes('xml')) {
<mat-icon class="icon large" svgIcon="xml" />
} @else {
<mat-icon class="icon large" svgIcon="unknown" />
}

<div class="truncate">
{{ attachment.name }}
<div class="truncate">
{{ attachment.name }}
</div>
</div>
} @empty {}
</div>
} @empty {}
</ng-template>
</mat-expansion-panel>
16 changes: 13 additions & 3 deletions src/app/components/attachments/attachments.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@
padding-right: 6rem;
}

.list {
display: flex;
flex: 0 1 auto;
flex-wrap: wrap;
flex-direction: row;
box-sizing: border-box;
overflow: auto;
}

.item {
position: relative;
border-radius: 0.25rem;
Expand All @@ -18,6 +27,7 @@
box-sizing: border-box;

margin: 0.5rem;
padding: 0.5rem;
max-width: 200px;

&:hover {
Expand All @@ -32,9 +42,9 @@
}

.icon.large {
font-size: 3rem;
width: 3rem;
height: 3rem;
font-size: 5rem;
width: 5rem;
height: 5rem;
}

.truncate {
Expand Down

0 comments on commit 236d6e5

Please sign in to comment.