Skip to content

Commit ded2f53

Browse files
authored
Merge branch 'main' into carlos/add-compute-table
2 parents c460601 + 0f3c5bf commit ded2f53

File tree

7 files changed

+59
-33
lines changed

7 files changed

+59
-33
lines changed

pcweb/components/code_card.py

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
from reflex.components.datadisplay.shiki_code_block import copy_script
44

55

6-
def install_command(command: str, show_dollar_sign: bool = True, **props) -> rx.Component:
6+
def install_command(
7+
command: str, show_dollar_sign: bool = True, **props
8+
) -> rx.Component:
79
return rx.el.button(
810
rx.icon("copy", size=14, margin_left="5px"),
911
rx.text(
@@ -115,16 +117,22 @@ def gallery_app_card(app: dict) -> rx.Component:
115117
rx.vstack(
116118
rx.box(
117119
rx.hstack(
118-
install_command(f"reflex init --template {app['title']}"),
119-
rx.hstack(
120-
repo(app["demo"]),
121-
justify="start",
122-
120+
install_command(
121+
f"reflex init --template {app['title']}"
122+
),
123+
*(
124+
[
125+
rx.hstack(
126+
repo(app["demo"]),
127+
justify="start",
128+
)
129+
]
130+
if "demo" in app
131+
else []
123132
),
124133
),
125134
width="310px",
126135
max_width="310px",
127-
128136
),
129137
rx.cond(
130138
"Reflex" in app["author"],
@@ -146,10 +154,8 @@ def gallery_app_card(app: dict) -> rx.Component:
146154
),
147155
),
148156
align_items="start",
149-
class_name="brother-john"
157+
class_name="brother-john",
150158
),
151-
152-
153159
class_name="flex flex-row items-center gap-[6px] justify-between w-full",
154160
),
155161
class_name="flex flex-col justify-between items-start gap-1 p-[0.625rem_0.75rem_0.625rem_0.75rem] w-full h-full",

pcweb/pages/customers/views/footer.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from datetime import datetime
12
import reflex as rx
23
from pcweb.components.icons import get_icon
34
from pcweb.components.button import button
@@ -116,6 +117,7 @@ def news_letter() -> rx.Component:
116117
),
117118
)
118119

120+
119121
@rx.memo
120122
def footer() -> rx.Component:
121123
return rx.el.footer(
@@ -153,7 +155,7 @@ def footer() -> rx.Component:
153155
# Socials
154156
rx.box(
155157
rx.text(
156-
"Copyright © 2024 Pynecone, Inc.",
158+
f"Copyright © {datetime.now().year} Pynecone, Inc.",
157159
class_name="font-small text-slate-9",
158160
),
159161
menu_socials(),

pcweb/pages/gallery/apps.py

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ def get_route(path: str):
3131

3232

3333
def more_posts(current_post: dict) -> rx.Component:
34-
3534
posts = []
3635
app_items = list(gallery_apps_data_copy.items())
3736
current_index = next(
@@ -49,8 +48,8 @@ def more_posts(current_post: dict) -> rx.Component:
4948
selected_posts = app_items[-3:]
5049
else:
5150
# Create a list of all posts except the current one
52-
other_posts = app_items[:current_index] + app_items[current_index + 1:]
53-
51+
other_posts = app_items[:current_index] + app_items[current_index + 1 :]
52+
5453
if len(other_posts) <= 3:
5554
# If there are 3 or fewer other posts, show all of them
5655
selected_posts = other_posts
@@ -63,9 +62,9 @@ def more_posts(current_post: dict) -> rx.Component:
6362
else:
6463
# For all other cases, show one before and two after (or two before and one after if we're near the end)
6564
if current_index < len(app_items) - 2:
66-
selected_posts = other_posts[current_index-1:current_index+2]
65+
selected_posts = other_posts[current_index - 1 : current_index + 2]
6766
else:
68-
selected_posts = other_posts[current_index-2:current_index+1]
67+
selected_posts = other_posts[current_index - 2 : current_index + 1]
6968

7069
for path, document in selected_posts:
7170
meta = document.metadata
@@ -131,14 +130,20 @@ def page(document) -> rx.Component:
131130
class_name="flex flex-col gap-3 p-8",
132131
),
133132
rx.box(
134-
rx.link(
135-
button_with_icon(
136-
"View Demo",
137-
icon="new_tab",
138-
class_name="!w-full flex-row-reverse gap-2",
139-
),
140-
is_external=True,
141-
href=meta["demo"],
133+
*(
134+
[
135+
rx.link(
136+
button_with_icon(
137+
"View Demo",
138+
icon="new_tab",
139+
class_name="!w-full flex-row-reverse gap-2",
140+
),
141+
is_external=True,
142+
href=meta["demo"],
143+
)
144+
]
145+
if meta.get("demo")
146+
else []
142147
),
143148
rx.link(
144149
button("View Code", variant="muted", class_name="!w-full"),
@@ -192,9 +197,9 @@ def page(document) -> rx.Component:
192197
title=document.metadata["title"],
193198
description=document.metadata["description"],
194199
image=document.metadata["image"],
195-
demo=document.metadata["demo"],
200+
demo=document.metadata["demo"] if "demo" in document.metadata else None,
196201
meta=document.metadata["meta"],
197202
)(lambda doc=document: page(doc))
198203

199204
# Add the route to the list of routes.
200-
gallery_apps_routes.append(comp)
205+
gallery_apps_routes.append(comp)

pcweb/pages/index/views/footer_index.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from datetime import datetime
12
import reflex as rx
23
from pcweb.components.icons import get_icon
34
from pcweb.components.button import button
@@ -158,7 +159,7 @@ def footer_index() -> rx.Component:
158159
# Socials
159160
rx.box(
160161
rx.text(
161-
"Copyright © 2024 Pynecone, Inc.",
162+
f"Copyright © {datetime.now().year} Pynecone, Inc.",
162163
class_name="font-small text-slate-9",
163164
),
164165
menu_socials(),

pcweb/templates/docpage/docpage.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Template for documentation pages."""
22

3+
from datetime import datetime
34
from typing import Callable
45

56
import reflex as rx
@@ -14,6 +15,7 @@
1415
from pcweb.components.button import button
1516
from reflex.utils.format import to_title_case, to_snake_case
1617

18+
1719
def footer_link(text: str, href: str):
1820
return rx.link(
1921
text,
@@ -230,7 +232,7 @@ def docpage_footer(path: str):
230232
),
231233
rx.box(
232234
rx.text(
233-
"Copyright © 2024 Pynecone, Inc.",
235+
f"Copyright © {datetime.now().year} Pynecone, Inc.",
234236
class_name="font-small text-slate-9",
235237
),
236238
menu_socials(),
@@ -287,6 +289,7 @@ def breadcrumb(path: str, nav_sidebar: rx.Component):
287289
)
288290
)
289291
from pcweb.components.hosting_banner import HostingBannerState
292+
290293
# Return the list of breadcrumb items with separators
291294
return rx.box(
292295
docs_sidebar_drawer(
@@ -303,7 +306,8 @@ def breadcrumb(path: str, nav_sidebar: rx.Component):
303306
rx.icon(tag="chevron-down", size=14, class_name="!text-slate-9"),
304307
class_name="p-[0.563rem] mobile-only",
305308
),
306-
class_name="relative z-10 flex flex-row justify-between items-center gap-4 lg:gap-0 border-slate-4 bg-slate-1 mt-12 mb-6 lg:mb-12 p-[0.5rem_1rem_0.5rem_1rem] lg:p-0 border-b lg:border-none w-full" + rx.cond(
309+
class_name="relative z-10 flex flex-row justify-between items-center gap-4 lg:gap-0 border-slate-4 bg-slate-1 mt-12 mb-6 lg:mb-12 p-[0.5rem_1rem_0.5rem_1rem] lg:p-0 border-b lg:border-none w-full"
310+
+ rx.cond(
307311
HostingBannerState.show_banner,
308312
" lg:mt-[175px]",
309313
" lg:mt-[119px]",

pcweb/views/footer.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from datetime import datetime
12
import reflex as rx
23
from pcweb.components.icons.icons import get_icon
34
from pcweb.pages.gallery import gallery
@@ -52,8 +53,16 @@ def menu_socials() -> rx.Component:
5253
return rx.box(
5354
rx.box(
5455
social_menu_item("github", GITHUB_URL),
55-
social_menu_item("twitter", TWITTER_URL, class_name="border-l border-slate-5 border-solid border-y-0 border-r-0"),
56-
social_menu_item("forum", FORUM_URL, class_name="!border-l !border-r border-slate-5 border-solid border-y-0"),
56+
social_menu_item(
57+
"twitter",
58+
TWITTER_URL,
59+
class_name="border-l border-slate-5 border-solid border-y-0 border-r-0",
60+
),
61+
social_menu_item(
62+
"forum",
63+
FORUM_URL,
64+
class_name="!border-l !border-r border-slate-5 border-solid border-y-0",
65+
),
5766
social_menu_item("discord", DISCORD_URL),
5867
class_name="flex flex-row h-full align-center divide-x divide-slate-5 border-solid",
5968
),
@@ -126,7 +135,7 @@ def footer() -> rx.Component:
126135
rx.box(
127136
menu_socials(),
128137
rx.text(
129-
2024 Pynecone, Inc.",
138+
f{datetime.now().year} Pynecone, Inc.",
130139
class_name="font-small text-slate-9",
131140
),
132141
class_name="flex flex-col justify-between items-start gap-4 self-stretch",

templates/llamaindex-app.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ title: reflex-llamaindex-template
33
description: "A minimal chat app using LLamaIndex"
44
author: "Reflex"
55
image: "llamaindex.png"
6-
demo: "https://frontend-gold-orca.dev.reflexcorp.run/"
76
source: "https://github.com/reflex-dev/reflex-llamaindex-template"
87
meta: [
98
{"name": "keywords", "content": ""},

0 commit comments

Comments
 (0)