Skip to content

Commit

Permalink
minor styling updates
Browse files Browse the repository at this point in the history
  • Loading branch information
roncodes committed Apr 8, 2024
1 parent b02e485 commit cfb0bd6
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
12 changes: 6 additions & 6 deletions addon/components/chat-tray.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@
</div>
<div class="flex flex-col">
{{#each this.channels as |channel|}}
<div class="flex items-start px-4 py-3 border-t dark:border-gray-700 border-gray-200">
<button type="button" class="flex flex-col flex-1 cursor-default" {{on "click" (fn this.openChannel channel)}}>
<div class="font-bold mb-1">{{n-a channel.title "Untitled Chat"}}</div>
<div class="chat-tray-channel-preview flex items-start px-4 py-3 border-t dark:border-gray-700 border-gray-200">
<button type="button" class="chat-tray-channel-preview-btn flex flex-col flex-1 cursor-default" {{on "click" (fn this.openChannel channel)}}>
<div class="chat-tray-channel-preview-title font-bold mb-1">{{n-a channel.title "Untitled Chat"}}</div>
<div class="flex flex-row">
<div class="w-10">
<Image src={{channel.last_message.sender.avatar_url}} @fallbackSrc={{config "defaultValues.userImage"}} alt={{channel.last_message.sender.name}} class="rounded-full shadow-sm w-8 h-8" />
<Image src={{channel.last_message.sender.avatar_url}} @fallbackSrc={{config "defaultValues.userImage"}} alt={{channel.last_message.sender.name}} class="chat-tray-channel-preview-avatar rounded-full shadow-sm w-8 h-8" />
</div>
<div class="text-sm truncate dark:text-gray-200 text-gray-900">{{channel.last_message.content}}</div>
<div class="chat-tray-channel-preview-last-message text-sm truncate dark:text-gray-200 text-gray-900">{{channel.last_message.content}}</div>
</div>
</button>
<div class="flex">
<div class="btn-wrapper">
<button type="button" class="btn btn-danger btn-xs cursor-default" {{on "click" (fn this.removeChannel channel)}}>
<button type="button" class="chat-tray-channel-preview-close-channel-btn btn btn-danger btn-xs cursor-default" {{on "click" (fn this.removeChannel channel)}}>
<FaIcon @icon="times" @size="sm" />
</button>
</div>
Expand Down
4 changes: 3 additions & 1 deletion addon/components/chat-window.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ export default class ChatWindowComponent extends Component {
this.pendingAttachmentFiles = [];

// save attachments
return all(attachments.map((_) => _.save()));
return all(attachments.map((_) => _.save())).then((response) => {
console.log(response);
});
}

@action closeChannel() {
Expand Down
12 changes: 12 additions & 0 deletions addon/styles/components/chat.css
Original file line number Diff line number Diff line change
Expand Up @@ -300,3 +300,15 @@
display: flex;
flex-direction: row;
}

.chat-tray-channel-preview:hover {
opacity: .5;
}

.chat-tray-channel-preview .chat-tray-channel-preview-last-message {
width: 285px;
max-width: 285px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}

0 comments on commit cfb0bd6

Please sign in to comment.