Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -30,15 +30,12 @@ store = ProfileStore()
|
|
| 30 |
col_logo, col_title = st.columns([1, 6])
|
| 31 |
with col_logo:
|
| 32 |
try:
|
| 33 |
-
#
|
| 34 |
-
|
| 35 |
-
except Exception:
|
| 36 |
-
# Fallback if not found
|
| 37 |
st.image(
|
| 38 |
"https://via.placeholder.com/100x100/4F46E5/FFFFFF?text=🤝",
|
| 39 |
width=90,
|
| 40 |
)
|
| 41 |
-
|
| 42 |
with col_title:
|
| 43 |
st.title("AI Skill Swap")
|
| 44 |
st.caption("Teach what you know • Learn what you love • Match intelligently")
|
|
@@ -135,13 +132,11 @@ with st.sidebar:
|
|
| 135 |
st.success(msg)
|
| 136 |
|
| 137 |
# Clear all fields after create
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
st.session_state["wants_text"] = ""
|
| 141 |
-
st.session_state["availability"] = ""
|
| 142 |
-
st.session_state["preferences"] = ""
|
| 143 |
|
| 144 |
-
|
|
|
|
| 145 |
else:
|
| 146 |
st.error(msg)
|
| 147 |
|
|
@@ -169,8 +164,8 @@ with st.sidebar:
|
|
| 169 |
|
| 170 |
store.add_or_update(existing)
|
| 171 |
st.success("Profile updated")
|
| 172 |
-
# Keep fields intact
|
| 173 |
-
st.
|
| 174 |
|
| 175 |
# ---------- DELETE PROFILE ----------
|
| 176 |
if selected_user != "— Create New —":
|
|
@@ -178,13 +173,9 @@ with st.sidebar:
|
|
| 178 |
store.delete(selected_user)
|
| 179 |
st.warning("Profile deleted")
|
| 180 |
# Clear session state
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
st.
|
| 184 |
-
st.session_state["availability"] = ""
|
| 185 |
-
st.session_state["preferences"] = ""
|
| 186 |
-
time.sleep(0.3)
|
| 187 |
-
st.experimental_rerun()
|
| 188 |
|
| 189 |
# ---------- MAIN CONTENT ----------
|
| 190 |
left, right = st.columns([2, 3])
|
|
@@ -267,6 +258,6 @@ with st.sidebar:
|
|
| 267 |
}
|
| 268 |
)
|
| 269 |
st.success("Thank you!")
|
| 270 |
-
st.
|
| 271 |
else:
|
| 272 |
st.warning("Please write feedback.")
|
|
|
|
| 30 |
col_logo, col_title = st.columns([1, 6])
|
| 31 |
with col_logo:
|
| 32 |
try:
|
| 33 |
+
st.image("logo.jpg", width=90) # use uploaded logo
|
| 34 |
+
except:
|
|
|
|
|
|
|
| 35 |
st.image(
|
| 36 |
"https://via.placeholder.com/100x100/4F46E5/FFFFFF?text=🤝",
|
| 37 |
width=90,
|
| 38 |
)
|
|
|
|
| 39 |
with col_title:
|
| 40 |
st.title("AI Skill Swap")
|
| 41 |
st.caption("Teach what you know • Learn what you love • Match intelligently")
|
|
|
|
| 132 |
st.success(msg)
|
| 133 |
|
| 134 |
# Clear all fields after create
|
| 135 |
+
for key in ["username", "offers_text", "wants_text", "availability", "preferences"]:
|
| 136 |
+
st.session_state[key] = ""
|
|
|
|
|
|
|
|
|
|
| 137 |
|
| 138 |
+
# Refresh page
|
| 139 |
+
st.experimental_set_query_params(refresh=str(uuid.uuid4()))
|
| 140 |
else:
|
| 141 |
st.error(msg)
|
| 142 |
|
|
|
|
| 164 |
|
| 165 |
store.add_or_update(existing)
|
| 166 |
st.success("Profile updated")
|
| 167 |
+
# Keep fields intact, just refresh profile list
|
| 168 |
+
st.experimental_set_query_params(refresh=str(uuid.uuid4()))
|
| 169 |
|
| 170 |
# ---------- DELETE PROFILE ----------
|
| 171 |
if selected_user != "— Create New —":
|
|
|
|
| 173 |
store.delete(selected_user)
|
| 174 |
st.warning("Profile deleted")
|
| 175 |
# Clear session state
|
| 176 |
+
for key in ["username", "offers_text", "wants_text", "availability", "preferences"]:
|
| 177 |
+
st.session_state[key] = ""
|
| 178 |
+
st.experimental_set_query_params(refresh=str(uuid.uuid4()))
|
|
|
|
|
|
|
|
|
|
|
|
|
| 179 |
|
| 180 |
# ---------- MAIN CONTENT ----------
|
| 181 |
left, right = st.columns([2, 3])
|
|
|
|
| 258 |
}
|
| 259 |
)
|
| 260 |
st.success("Thank you!")
|
| 261 |
+
st.experimental_set_query_params(refresh=str(uuid.uuid4()))
|
| 262 |
else:
|
| 263 |
st.warning("Please write feedback.")
|