-
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
14 changed files
with
117 additions
and
29 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
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,7 @@ | ||
@keyframes blinker { | ||
50% { opacity: 0; } | ||
} | ||
|
||
.blink { | ||
animation: blinker 1.5s linear infinite; | ||
} |
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,25 @@ | ||
import os | ||
import dotenv | ||
from supabase import create_client, Client | ||
|
||
|
||
class SupabaseAPI: | ||
|
||
dotenv.load_dotenv() | ||
|
||
SUPABASE_URL = os.environ.get("SUPABASE_URL") | ||
SUPABASE_KEY = os.environ.get("SUPABASE_KEY") | ||
|
||
supabase: Client = create_client(SUPABASE_URL, SUPABASE_KEY) | ||
|
||
def featured(self) -> list: | ||
|
||
response = self.supabase.table("featured").select("*").execute() | ||
|
||
featured_data = [] | ||
|
||
if len(response.data) > 0: | ||
for featured_item in response.data: | ||
featured_data.append(featured_item) | ||
|
||
return featured_data |
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,12 +1,18 @@ | ||
import link_bio.constants as const | ||
from .TwitchAPI import TwitchAPI | ||
from .SupabaseAPI import SupabaseAPI | ||
|
||
TWITCH_API = TwitchAPI() | ||
SUPABASE_API = SupabaseAPI() | ||
|
||
|
||
async def repo() -> str: | ||
return const.REPO_URL | ||
|
||
|
||
async def live(user: str) -> bool: | ||
async def live(user: str) -> dict: | ||
return TWITCH_API.live(user) | ||
|
||
|
||
async def featured() -> list: | ||
return SUPABASE_API.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,12 +1,19 @@ | ||
import reflex as rx | ||
from link_bio.api.api import live | ||
from link_bio.api.api import live, featured | ||
|
||
USER = "mouredev" | ||
|
||
|
||
class PageState(rx.State): | ||
|
||
is_live: bool | ||
live_title: str | ||
featured_info: list[dict] | ||
|
||
async def check_live(self): | ||
self.is_live = await live(USER) | ||
live_data = await live(USER) | ||
self.is_live = live_data["live"] | ||
self.live_title = live_data["title"] | ||
|
||
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
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,2 +1,3 @@ | ||
reflex==0.3.9 | ||
python-dotenv | ||
reflex==0.3.10 | ||
python-dotenv | ||
supabase |