Skip to content

Commit c3ae5c8

Browse files
koray-erenJeff
authored andcommitted
basic message container
1 parent 353112b commit c3ae5c8

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

sogs/static/view_room.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const setup = async () => {
5454

5555
const plain = Message.decode(data).dataMessage;
5656
e.appendChild(document.createTextNode(plain.profile.displayName +": "+plain.body));
57-
e.classList.add('bg-gray-300','dark:bg-lightGray', 'w-fit', 'rounded-full', 'px-3', 'my-2')
57+
e.classList.add('bg-gray-300','dark:bg-lightGray', 'w-fit', 'rounded', 'p-2', 'my-2')
5858
elem.appendChild(e);
5959

6060
}

sogs/templates/view_room.html

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,26 @@
1010
<button class="bg-black text-white dark:bg-sessionGreen dark:text-black rounded px-1 py-1 my-2" > <a href="/">< Back</a></button>
1111
<pre class="text-sm break-all whitespace-normal">{{room.url}}</pre>
1212
</div>
13-
<div class="w-1/3 md:w-1/6">
14-
<img class="aspect-square max-w-full max-h-40" src="invite.png" />
13+
<div class="w-1/3 lg:w-auto ">
14+
<img class="aspect-square max-w-full max-h-40 min-h-fit" src="invite.png" />
1515
</div>
1616
</div>
1717

18-
{% if show_recent %}
19-
<ul id="messages" class="">
20-
<li>loading...</li>
21-
</ul>
22-
<script>
23-
window.view_room = "{{room.token}}";
24-
window.poll_room_url = "/room/{{room.token}}/messages/recent";
25-
</script>
26-
<script src="/static/protobuf.min.js"></script>
27-
<script src="/static/view_room.js"></script>
28-
{%endif%}
18+
<div class="flex">
19+
{% if show_recent %}
20+
<div id="messages-container" class=" overflow-y-auto border-2 rounded border-sessionGreen h-96 flex-1 my-5" >
21+
<ul id="messages" class="m-2">
22+
<li>loading...</li>
23+
</ul>
24+
</div>
25+
<script>
26+
window.view_room = "{{room.token}}";
27+
window.poll_room_url = "/room/{{room.token}}/messages/recent";
28+
</script>
29+
<script src="/static/protobuf.min.js"></script>
30+
<script src="/static/view_room.js"></script>
31+
{%endif%}
32+
</div>
33+
2934

3035
{% endblock %}

0 commit comments

Comments
 (0)