Skip to content

Commit fa8f03d

Browse files
Remove chakra deprecations (#51)
1 parent 13b71f1 commit fa8f03d

File tree

5 files changed

+22
-15
lines changed

5 files changed

+22
-15
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
assets/external/
12
**/*.db
23
**/*.ipynb
34
**/*.pyc
@@ -17,4 +18,4 @@ bun.lockb
1718
dist/*
1819
frontend.zip
1920
poetry.lock
20-
venv/
21+
venv/

chat/chat.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
"""The main Chat app."""
22

33
import reflex as rx
4+
import reflex_chakra as rc
5+
46
from chat.components import chat, navbar
57

68

79
def index() -> rx.Component:
810
"""The main app."""
9-
return rx.chakra.vstack(
11+
return rc.vstack(
1012
navbar(),
1113
chat.chat(),
1214
chat.action_bar(),

chat/components/chat.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import reflex as rx
2+
import reflex_chakra as rc
23

34
from chat.components import loading_icon
45
from chat.state import QA, State
@@ -60,8 +61,8 @@ def action_bar() -> rx.Component:
6061
"""The action bar to send a new message."""
6162
return rx.center(
6263
rx.vstack(
63-
rx.chakra.form(
64-
rx.chakra.form_control(
64+
rc.form(
65+
rc.form_control(
6566
rx.hstack(
6667
rx.input(
6768
rx.input.slot(

chat/components/modal.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
import reflex as rx
2+
import reflex_chakra as rc
3+
24
from chat.state import State
35

46

57
def modal() -> rx.Component:
68
"""A modal to create a new chat."""
7-
return rx.chakra.modal(
8-
rx.chakra.modal_overlay(
9-
rx.chakra.modal_content(
10-
rx.chakra.modal_header(
11-
rx.chakra.hstack(
12-
rx.chakra.text("Create new chat"),
13-
rx.chakra.icon(
9+
return rc.modal(
10+
rc.modal_overlay(
11+
rc.modal_content(
12+
rc.modal_header(
13+
rc.hstack(
14+
rc.text("Create new chat"),
15+
rc.icon(
1416
tag="close",
1517
font_size="sm",
1618
on_click=State.toggle_modal,
@@ -22,17 +24,17 @@ def modal() -> rx.Component:
2224
justify_content="space-between",
2325
)
2426
),
25-
rx.chakra.modal_body(
26-
rx.chakra.input(
27+
rc.modal_body(
28+
rc.input(
2729
placeholder="Type something...",
2830
on_blur=State.set_new_chat_name,
2931
bg="#222",
3032
border_color="#fff3",
3133
_placeholder={"color": "#fffa"},
3234
),
3335
),
34-
rx.chakra.modal_footer(
35-
rx.chakra.button(
36+
rc.modal_footer(
37+
rc.button(
3638
"Create",
3739
bg="#5535d4",
3840
box_shadow="md",

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
reflex>=0.4.7
22
openai>=1.14.0
3+
reflex-chakra>=0.6.0

0 commit comments

Comments
 (0)