-
Notifications
You must be signed in to change notification settings - Fork 203
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
103 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import os | ||
import dotenv | ||
import configcatclient | ||
|
||
|
||
class ConfigCatAPI: | ||
|
||
dotenv.load_dotenv() | ||
|
||
CONFIGCAT_SDK_KEY = os.environ.get("CONFIGCAT_SDK_KEY") | ||
|
||
def __init__(self) -> None: | ||
if self.CONFIGCAT_SDK_KEY != None: | ||
self.configcat = configcatclient.get(self.CONFIGCAT_SDK_KEY) | ||
|
||
def schedule(self) -> str: | ||
self.configcat.get_value("live_schedule", "") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import reflex as rx | ||
import link_bio.styles.styles as styles | ||
from link_bio.styles.styles import Size | ||
from link_bio.model.Featured import Featured | ||
|
||
|
||
def featured_link(featured: Featured) -> rx.Component: | ||
return rx.link( | ||
rx.vstack( | ||
rx.image( | ||
src=featured.image, | ||
border_radius=Size.DEFAULT.value | ||
), | ||
rx.text( | ||
featured.title, | ||
style=styles.button_body_style | ||
), | ||
spacing=Size.SMALL.value, | ||
align_items="start" | ||
), | ||
href=featured.url, | ||
is_external=True | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import reflex as rx | ||
|
||
|
||
class Featured(rx.Base): | ||
title: str | ||
image: str | ||
url: str |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import reflex as rx | ||
|
||
|
||
class Live(rx.Base): | ||
live: bool | ||
title: str |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
from enum import Flag | ||
import reflex as rx | ||
from link_bio.api.api import live, featured | ||
from link_bio.model.Featured import Featured | ||
from link_bio.model.Live import Live | ||
|
||
USER = "mouredev" | ||
|
||
|
||
class PageState(rx.State): | ||
|
||
is_live: bool | ||
live_title: str | ||
featured_info: list[dict] | ||
live_status = Live(live=False, title="") | ||
featured_info: list[Featured] | ||
|
||
async def check_live(self): | ||
live_data = await live(USER) | ||
self.is_live = live_data["live"] | ||
self.live_title = live_data["title"] | ||
self.live_status = await live(USER) | ||
|
||
async def featured_links(self): | ||
self.featured_info = await featured() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
reflex==0.3.10 | ||
python-dotenv | ||
supabase | ||
supabase | ||
configcat-client |