Skip to content

Commit

Permalink
Remove chakra deprecations (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
ElijahAhianyo authored Nov 25, 2024
1 parent 13b71f1 commit fa8f03d
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 15 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
assets/external/
**/*.db
**/*.ipynb
**/*.pyc
Expand All @@ -17,4 +18,4 @@ bun.lockb
dist/*
frontend.zip
poetry.lock
venv/
venv/
4 changes: 3 additions & 1 deletion chat/chat.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
"""The main Chat app."""

import reflex as rx
import reflex_chakra as rc

from chat.components import chat, navbar


def index() -> rx.Component:
"""The main app."""
return rx.chakra.vstack(
return rc.vstack(
navbar(),
chat.chat(),
chat.action_bar(),
Expand Down
5 changes: 3 additions & 2 deletions chat/components/chat.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import reflex as rx
import reflex_chakra as rc

from chat.components import loading_icon
from chat.state import QA, State
Expand Down Expand Up @@ -60,8 +61,8 @@ def action_bar() -> rx.Component:
"""The action bar to send a new message."""
return rx.center(
rx.vstack(
rx.chakra.form(
rx.chakra.form_control(
rc.form(
rc.form_control(
rx.hstack(
rx.input(
rx.input.slot(
Expand Down
24 changes: 13 additions & 11 deletions chat/components/modal.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import reflex as rx
import reflex_chakra as rc

from chat.state import State


def modal() -> rx.Component:
"""A modal to create a new chat."""
return rx.chakra.modal(
rx.chakra.modal_overlay(
rx.chakra.modal_content(
rx.chakra.modal_header(
rx.chakra.hstack(
rx.chakra.text("Create new chat"),
rx.chakra.icon(
return rc.modal(
rc.modal_overlay(
rc.modal_content(
rc.modal_header(
rc.hstack(
rc.text("Create new chat"),
rc.icon(
tag="close",
font_size="sm",
on_click=State.toggle_modal,
Expand All @@ -22,17 +24,17 @@ def modal() -> rx.Component:
justify_content="space-between",
)
),
rx.chakra.modal_body(
rx.chakra.input(
rc.modal_body(
rc.input(
placeholder="Type something...",
on_blur=State.set_new_chat_name,
bg="#222",
border_color="#fff3",
_placeholder={"color": "#fffa"},
),
),
rx.chakra.modal_footer(
rx.chakra.button(
rc.modal_footer(
rc.button(
"Create",
bg="#5535d4",
box_shadow="md",
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
reflex>=0.4.7
openai>=1.14.0
reflex-chakra>=0.6.0

0 comments on commit fa8f03d

Please sign in to comment.