Skip to content

Commit e158a1d

Browse files
committed
Nueva newsletter
1 parent 0e9905c commit e158a1d

File tree

4 files changed

+34
-22
lines changed

4 files changed

+34
-22
lines changed

link_bio/link_bio/components/newsletter.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ def newsletter() -> rx.Component:
1515
const.NEWSLETTER_URL,
1616
),
1717
rx.html(
18-
"<iframe src='https://embeds.beehiiv.com/c9c3f7b7-7ed9-428a-a58f-cb53577fa352?slim=true' data-test-id='beehiiv-embed' title='Formulario de suscripción newsletter mouredev pro' width='100%' height='52' frameborder='0' scrolling='no' style='margin: 0; border-radius: 6px !important; background-color: transparent;'></iframe>",
18+
"<iframe src='https://subscribe-forms.beehiiv.com/84ec1259-e16b-41b4-be33-d1f2dd2cf53e' class='beehiiv-embed' data-test-id='beehiiv-embed' title='Formulario de suscripción newsletter mouredev' width='100%' height='110px' frameborder='0' scrolling='no' allowtransparency='true' style='width: 100%; height: 110px; margin: 0; border-radius: 0px !important; background-color: transparent; color-scheme: normal;'></iframe>",
1919
width="100%",
20+
height="100px",
2021
),
2122
rx.hstack(
2223
rx.icon("mail-check"),

link_bio/link_bio/link_bio.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
import reflex as rx
2+
23
import link_bio.constants as const
34
import link_bio.styles.styles as styles
4-
from link_bio.pages.index import index
5-
from link_bio.pages.courses import courses
5+
from link_bio import utils
66
from link_bio.api.api import fastapi_app
7+
from link_bio.pages.courses import courses # noqa: F401
8+
from link_bio.pages.index import index # noqa: F401
79

810
app = rx.App(
911
stylesheets=styles.STYLESHEETS,
1012
style=styles.BASE_STYLE,
1113
api_transformer=fastapi_app,
1214
head_components=[
13-
rx.script(
14-
src=f"https://www.googletagmanager.com/gtag/js?id={const.G_TAG}"),
15+
rx.script(src=utils.BEEHIIV_SCRIPT, async_=True),
16+
rx.script(src=f"https://www.googletagmanager.com/gtag/js?id={const.G_TAG}"),
1517
rx.script(
1618
f"""
1719
window.dataLayer = window.dataLayer || [];
@@ -39,8 +41,8 @@
3941
height="1",
4042
width="1",
4143
style={"display": "none"},
42-
src="https://www.facebook.com/tr?id=509505096385581&ev=PageView&noscript=1"
44+
src="https://www.facebook.com/tr?id=509505096385581&ev=PageView&noscript=1",
4345
),
44-
)
46+
),
4547
],
4648
)

link_bio/link_bio/utils.py

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import reflex as rx
2-
import pytz
31
from datetime import datetime, timedelta
42

3+
import pytz
4+
import reflex as rx
5+
56
# Común
67

78

@@ -15,9 +16,11 @@ def lang() -> rx.Component:
1516
{"name": "og:type", "content": "website"},
1617
{"name": "og:image", "content": preview},
1718
{"name": "twitter:card", "content": "summary_large_image"},
18-
{"name": "twitter:site", "content": "@mouredev"}
19+
{"name": "twitter:site", "content": "@mouredev"},
1920
]
2021

22+
BEEHIIV_SCRIPT = "https://subscribe-forms.beehiiv.com/embed.js"
23+
2124
# Index
2225

2326
index_title = "MoureDev | Te enseño programación y desarrollo de software"
@@ -51,7 +54,7 @@ def lang() -> rx.Component:
5154
3: "Jueves",
5255
4: "Viernes",
5356
5: "Sábado",
54-
6: "Domingo"
57+
6: "Domingo",
5558
}
5659

5760
MONTHS = {
@@ -66,7 +69,7 @@ def lang() -> rx.Component:
6669
9: "Septiembre",
6770
10: "Octubre",
6871
11: "Noviembre",
69-
12: "Diciembre"
72+
12: "Diciembre",
7073
}
7174

7275

@@ -86,24 +89,30 @@ def next_date(dates: dict, timezone: str) -> str:
8689
if current_weekday not in dates or dates[current_weekday] == "":
8790
continue
8891

89-
time_utc = datetime.strptime(dates[current_weekday], "%H:%M").replace(
90-
tzinfo=pytz.UTC).timetz()
92+
time_utc = (
93+
datetime.strptime(dates[current_weekday], "%H:%M").replace(tzinfo=pytz.UTC).timetz()
94+
)
9195

92-
next_time = datetime.combine(
93-
now.date(), time_utc).astimezone(tz).timetz()
96+
next_time = datetime.combine(now.date(), time_utc).astimezone(tz).timetz()
9497

9598
if current_time < next_time or weekday > 0:
9699

97100
next_date = now + timedelta(days=weekday)
98101

99102
local_date = datetime(
100-
next_date.year, next_date.month, next_date.day,
101-
time_utc.hour, time_utc.minute, tzinfo=pytz.UTC).astimezone(tz)
103+
next_date.year,
104+
next_date.month,
105+
next_date.day,
106+
time_utc.hour,
107+
time_utc.minute,
108+
tzinfo=pytz.UTC,
109+
).astimezone(tz)
102110

103111
day = "Hoy" if weekday == 0 else WEEKDAYS[local_date.weekday()]
104-
zones = timezone.replace('_', ' ').split('/')
112+
zones = timezone.replace("_", " ").split("/")
105113

106114
return local_date.strftime(
107-
f"{day}, %d de {MONTHS[local_date.month]} a las %H:%M | Zona horaria: {zones[len(zones) - 1]}")
115+
f"{day}, %d de {MONTHS[local_date.month]} a las %H:%M | Zona horaria: {zones[len(zones) - 1]}"
116+
)
108117

109118
return ""

link_bio/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
pip==25.3
2-
reflex==0.8.24.post1
1+
pip==26.0.1
2+
reflex==0.8.26
33
python-dotenv==1.0.1
44
supabase==2.13.0
55
configcat-client==9.0.4

0 commit comments

Comments
 (0)