Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
DISCUSSIONS_URL = "https://github.com/orgs/reflex-dev/discussions"
GITHUB_STARS = 28000
GITHUB_URL = "https://github.com/reflex-dev/reflex"
XY_GITHUB_STARS = 1400
XY_GITHUB_URL = "https://github.com/reflex-dev/xy"
JOBS_BOARD_URL = "https://www.ycombinator.com/companies/reflex/jobs"
REFLEX_ASSETS_CDN = "https://web.reflex-assets.dev/"
SCREENSHOT_BUCKET = "https://pub-c14a5dcf674640a6b73fded32bad72ca.r2.dev/"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
REFLEX_ASSETS_CDN,
REFLEX_BUILD_LOGIN_URL,
REFLEX_BUILD_URL,
XY_GITHUB_STARS,
XY_GITHUB_URL,
)
from reflex_site_shared.views.sidebar import navbar_sidebar_button

Expand Down Expand Up @@ -171,6 +173,18 @@ def gold_star() -> rx.Component:
)


def stars_label(stars: int) -> str:
"""Abbreviate a star count in thousands, keeping a tenth when non-zero.

Args:
stars: The exact star count.

Returns:
The abbreviated count, e.g. "28K" or "1.4K".
"""
return f"{round(stars / 1000, 1):g}K"
Comment thread
carlosabadia marked this conversation as resolved.


def open_source_row(
name: str,
repo: str,
Expand Down Expand Up @@ -235,13 +249,13 @@ def open_source_column() -> rx.Component:
open_source_row(
"Reflex",
GITHUB_URL,
f"{GITHUB_STARS // 1000}K",
stars_label(GITHUB_STARS),
tagline="Web apps in pure Python",
),
open_source_row(
"XY",
"https://github.com/reflex-dev/xy",
"6",
XY_GITHUB_URL,
stars_label(XY_GITHUB_STARS),
tagline="Fast and composable charts",
),
class_name="flex flex-col",
Expand Down
Loading