Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added base template + improve templating code #1937

Merged
merged 13 commits into from
Oct 16, 2023
Merged

Added base template + improve templating code #1937

merged 13 commits into from
Oct 16, 2023

Conversation

Alek99
Copy link
Member

@Alek99 Alek99 commented Oct 9, 2023

All Submissions:

  • Have you followed the guidelines stated in CONTRIBUTING.md file?
  • Have you checked to ensure there aren't any other open Pull Requests for the desired changed?

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

New Feature Submission:

  • Does your submission pass the tests?
  • Have you linted your code locally prior to submission?

Changes To Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

After these steps, you're ready to open a pull request.

a. Give a descriptive title to your PR.

b. Describe your changes.

c. Put `closes #XXXX` in your comment to auto-close the issue that your PR fixes (if such).

@Alek99 Alek99 marked this pull request as ready for review October 9, 2023 21:12
@Alek99 Alek99 changed the title Added base template Added base template + improve templating code Oct 9, 2023
@Alek99
Copy link
Member Author

Alek99 commented Oct 9, 2023

I'll fix the code, I know why its failing

@Alek99 Alek99 requested a review from masenf October 9, 2023 21:31
Copy link
Collaborator

@masenf masenf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks nice, but the code structure needs some rework to maximize developer experience and push people toward more maintainable code.

reflex/.templates/apps/basetemplate/code/sidebar.py Outdated Show resolved Hide resolved
reflex/.templates/apps/basetemplate/code/basetemplate.py Outdated Show resolved Hide resolved
reflex/.templates/apps/basetemplate/code/sidebar.py Outdated Show resolved Hide resolved
Comment on lines 46 to 49
rx.menu_item("Home"),
rx.menu_divider(),
rx.menu_item("About"),
rx.menu_item("Contact"),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how to make these actually work?

                rx.menu_item("About", on_click=rx.redirect("/about")),
                rx.menu_item(rx.link("Contact", href="/contact")),

The rx.link one only works when you click on the text itself, but the on_click one seems a bit unusual too. Need example so users know what to do.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a few different link example, setting width to 100% fixed the only working when clicking text

@masenf
Copy link
Collaborator

masenf commented Oct 9, 2023

(VENV-dev) masenf@minicone repro-call-script % reflex init
Usage: reflex init [OPTIONS]
Try 'reflex init --help' for help.

Error: Invalid value for '--template': <Kind.DEFAULT: 'default'> is not one of 'default', 'basetemplate', 'counter'.

@Alek99
Copy link
Member Author

Alek99 commented Oct 13, 2023

(VENV-dev) masenf@minicone repro-call-script % reflex init
Usage: reflex init [OPTIONS]
Try 'reflex init --help' for help.

Error: Invalid value for '--template': <Kind.DEFAULT: 'default'> is not one of 'default', 'basetemplate', 'counter'.

Should be fixed now

@Alek99 Alek99 requested a review from masenf October 13, 2023 09:26
masenf
masenf previously approved these changes Oct 13, 2023
Copy link
Collaborator

@masenf masenf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is excellent, looks good and well organized

reflex/.templates/apps/base/code/sidebar.py Outdated Show resolved Hide resolved
@picklelo picklelo merged commit 7d4194b into main Oct 16, 2023
36 checks passed
@picklelo picklelo deleted the alek/basetemp branch November 1, 2023 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants