Skip to content

Commit 960fb9e

Browse files
committed
Add Invalid Ticker content
1 parent a8562a7 commit 960fb9e

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

src/ui/layout.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import streamlit as st
22

3-
from .raw_content import homepage_content, footer_content
3+
from .raw_content import homepage_content, footer_content, not_found_ticker_content
44

55

66
def render(financial_data):
77
ticker = st.session_state["ticker"]
88
if not ticker:
99
render_homepage()
1010
elif not financial_data.is_valid_ticker(ticker):
11-
st.write("Invalid ticker")
11+
render_invalid_ticker_placeholder()
1212
else:
1313
render_stock_info(financial_data)
1414
render_footer()
@@ -18,6 +18,10 @@ def render_homepage():
1818
st.markdown(homepage_content, unsafe_allow_html=True)
1919

2020

21+
def render_invalid_ticker_placeholder():
22+
st.markdown(not_found_ticker_content, unsafe_allow_html=True)
23+
24+
2125
def render_footer():
2226
st.markdown(footer_content, unsafe_allow_html=True)
2327

src/ui/raw_content.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,20 @@
5252
</div>
5353
</div>
5454
"""
55+
56+
not_found_ticker_content = """
57+
## Oops! Invalid Ticker Entered 🚫
58+
59+
It looks like the stock ticker you entered doesn't match any results. Here are a few things you can try:
60+
61+
- **Double-check the Ticker**: Make sure you've entered the correct ticker symbol. Tickers are usually 1 to 4 uppercase letters (e.g., AAPL for Apple, TSLA for Tesla).
62+
- **Search for Another Stock**: Enter a different ticker symbol to explore other stocks.
63+
- **Popular Tickers to Explore**:
64+
- **AAPL**: Apple Inc.
65+
- **GOOGL**: Alphabet Inc.
66+
- **MSFT**: Microsoft Corporation
67+
- **AMZN**: Amazon.com, Inc.
68+
- **TSLA**: Tesla, Inc.
69+
70+
Happy investing! 🎉
71+
"""

0 commit comments

Comments
 (0)