diff --git a/app/config.py b/app/config.py index 8c27887..154b5b6 100644 --- a/app/config.py +++ b/app/config.py @@ -2,7 +2,7 @@ "site_name": "Reflexify", "repo_name": "LineIndent/reflexify", "repo_url": "https://github.com/LineIndent/reflexify", - "copy_right": "Copyright © 2022 - 2023 S. Ahmad P. Hakimi ", + "copy_right": "Copyright © 2022 - 2023 S. Ahmad P. Hakimi", "attribute": "Made with Reflex & Reflexify", "drawer": True, "theme": { diff --git a/app/core/repository.py b/app/core/repository.py index 4f8b4cb..33830e3 100644 --- a/app/core/repository.py +++ b/app/core/repository.py @@ -49,6 +49,8 @@ def get_repository_data(self): "Counter", ] + id_elements = ["name", "stars", "forks"] + with httpx.Client() as client: response = client.get(Config.__repo_url__()) data = response.content @@ -60,11 +62,10 @@ def get_repository_data(self): if span_element is not None: txt = span_element.text.strip() - temp_repo_data.children.append( rx.hstack( rx.html(icon_list[i]), - rx.text(txt, color="white", font_size=11), + rx.text(txt, color="white", font_size=11, id=id_elements[i]), spacing="0.35rem", ) ) diff --git a/app/helpers/app_config.py b/app/helpers/app_config.py index 38232b3..5f8dbe1 100644 --- a/app/helpers/app_config.py +++ b/app/helpers/app_config.py @@ -36,8 +36,8 @@ def __drawer__() -> bool: @staticmethod def __theme_primary__() -> str: - value = Config.data["theme"].get("primary", "orange") - return value if value else "orange" + value = Config.data["theme"].get("primary", "black") + return value if value else "black" @staticmethod def __theme_secondary__() -> str: diff --git a/app/router.py b/app/router.py index dee73b5..9787afa 100644 --- a/app/router.py +++ b/app/router.py @@ -37,4 +37,4 @@ def add_routes_to_app_pages(app: rx.App, routes: dict): def set_application_routes(app: rx.App): - get_application_routes_from_pages_dir(app) + get_application_routes_from_pages_dir(app=app) diff --git a/app/states/mainState.py b/app/states/mainState.py index 52adb51..b318372 100644 --- a/app/states/mainState.py +++ b/app/states/mainState.py @@ -2,6 +2,7 @@ class MainState(rx.State): + """The app state.""" pass diff --git a/app/styles/_admonition.py b/app/styles/_admonition.py index 005ce6c..74dcfa4 100644 --- a/app/styles/_admonition.py +++ b/app/styles/_admonition.py @@ -1,5 +1,3 @@ -# tags: info, not_allowed, warning, warning_two, calendar, question, check?, - admonition_css: dict = { "info": { "body": { diff --git a/app/styles/_base.py b/app/styles/_base.py index 380e81c..435145e 100644 --- a/app/styles/_base.py +++ b/app/styles/_base.py @@ -8,9 +8,7 @@ # main base css stylesheet for preconfigured web application base_css: dict = { - "app": { - "font_family": Config.__theme_font__(), - }, + "app": {"font_family": Config.__theme_font__(), "_dark": {"bg": "#1f2028"}}, "base": { "width": "100%", "min_height": "100vh", @@ -54,9 +52,9 @@ "height": "50px", "position": "sticky", "bg": Config.__theme_primary__(), - "box_shadow": "0 3px 6px 0 rgba(0, 0, 0, 0.5)", "transition": "height 350ms ease", "top": "0", + "box_shadow": "0 3px 6px 0 rgba(0, 0, 0, 0.5)", "z_index": "2", }, "icon": { diff --git a/app/utilities/rx_repo.js b/app/utilities/rx_repo.js deleted file mode 100644 index 18ba545..0000000 --- a/app/utilities/rx_repo.js +++ /dev/null @@ -1,49 +0,0 @@ -// GitHub repository owner and name -const owner = ''; -const repoName = ''; - -// GitHub REST API URL to get the repository information -const apiUrl = `https://api.github.com/repos/${owner}/${repoName}`; - -// Function to format a number in shorthand like 'k' -function formatNumberShorthand(number) { - if (number >= 1000) { - return (number / 1000).toFixed(1) + 'k'; - } - return number.toString(); -} - - -// Function to fetch and display repository information, including the latest release -async function getRepoInfo() { - try { - - // Dynamically import the 'node-fetch' module as an ES module - const fetch = (await import('node-fetch')).default; - - // Send an HTTP GET request to the GitHub API - const response = await fetch(apiUrl); - const repoInfo = await response.json(); - - // Check if the response contains the desired information - if (response.status === 200) { - const starsCount = repoInfo.stargazers_count; - const forksCount = repoInfo.forks_count; - - // Fetch the latest release information - const releaseUrl = `${apiUrl}/releases/latest`; - const releaseResponse = await fetch(releaseUrl); - const releaseInfo = await releaseResponse.json(); - const latestRelease = releaseInfo.tag_name; - - console.log(`Stars: ${formatNumberShorthand(starsCount)}`); - console.log(`Forks: ${formatNumberShorthand(forksCount)}`); - console.log(`Latest Release: ${latestRelease}`); - } else { - console.log('Error fetching repository information.'); - } - } catch (error) { - console.error("Error fetching data:", error); - } -} -