andreped commited on
Commit
816442c
·
1 Parent(s): f7239ac

Added twitter-like UI theme

Browse files
Files changed (1) hide show
  1. app.py +13 -3
app.py CHANGED
@@ -1,10 +1,17 @@
1
  import streamlit as st
2
 
3
  from postly.clients.singleton_client import SingletonPostlyClient
 
4
 
5
  # Initialize the PostlyClient singleton
6
  client = SingletonPostlyClient.get_instance()
7
 
 
 
 
 
 
 
8
  # Initialize user session state
9
  if "logged_in" not in st.session_state:
10
  st.session_state.logged_in = False
@@ -124,9 +131,12 @@ def get_all_posts():
124
  all_posts.append((user_name, post))
125
  sorted_posts = sorted(all_posts, key=lambda x: x[1].timestamp)[::-1]
126
  for user_name, post in sorted_posts:
127
- st.markdown(f"**{user_name}**")
128
- st.markdown(f"{post.content}")
129
- st.markdown("---")
 
 
 
130
 
131
 
132
  def main():
 
1
  import streamlit as st
2
 
3
  from postly.clients.singleton_client import SingletonPostlyClient
4
+ from postly.common.css import get_theme
5
 
6
  # Initialize the PostlyClient singleton
7
  client = SingletonPostlyClient.get_instance()
8
 
9
+ # Custom CSS for Twitter-like feel
10
+ st.markdown(
11
+ get_theme(),
12
+ unsafe_allow_html=True
13
+ )
14
+
15
  # Initialize user session state
16
  if "logged_in" not in st.session_state:
17
  st.session_state.logged_in = False
 
131
  all_posts.append((user_name, post))
132
  sorted_posts = sorted(all_posts, key=lambda x: x[1].timestamp)[::-1]
133
  for user_name, post in sorted_posts:
134
+ st.markdown(f"""
135
+ <div class="post-container">
136
+ <div class="post-header">{user_name}</div>
137
+ <div class="post-content">{post.content}</div>
138
+ </div>
139
+ """, unsafe_allow_html=True)
140
 
141
 
142
  def main():