Skip to content

Commit

Permalink
Feat(favicon): add a function to set page config with UNDP favicon
Browse files Browse the repository at this point in the history
  • Loading branch information
mykolaskrynnyk committed Sep 11, 2024
1 parent 2855efe commit e7b49d6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions st_undp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Styles and components for enhancing the look of Streamlit apps at UNDP.
"""

from io import BytesIO

import streamlit as st

from .components import *
Expand All @@ -15,3 +17,14 @@ def apply_style():
css = read_file("main.scss")
body = f"<style>{css}</style>"
st.html(body)


def set_page_config(title: str, menu_items: dict):
image = read_file(f"images/favicon.ico", "rb")
st.set_page_config(
page_title=title,
page_icon=BytesIO(image),
layout="wide",
initial_sidebar_state="auto",
menu_items=menu_items,
)
Binary file added st_undp/images/favicon.ico
Binary file not shown.

0 comments on commit e7b49d6

Please sign in to comment.