Created a dashboard button that is used to redirect user to a specified page. Has a title, description, and option for an icon.
Temporary test page for testing.
Created a dashboard button that is used to redirect user to a specified page. Has a title, description, and option for an icon.
Temporary test page for testing.
These should not be Optional values. When we use #[prop(optional), it just means that we either have a value, or the default value. For something like this (a String) that would mean we either have a specific value passed in or just the empty string.
These should not be Optional values. When we use `#[prop(optional)`, it just means that we either have a value, or the default value. For something like this (a String) that would mean we either have a specific value passed in or just the empty string.
Depending on your desired behavior, leaving this as an Option<String> might be fine. What I'd like to know is the mindset behind it - if this is a None value, how are you handling it? Should this even be optional at all? Why?
I'd recommend documenting this properly (refer to Leptos documentation for how to add doc comments to components).
Depending on your desired behavior, leaving this as an `Option<String>` might be fine. What I'd like to know is the mindset behind it - if this is a `None` value, how are you handling it? Should this even be optional at all? Why?
I'd recommend documenting this properly (refer to Leptos documentation for how to add doc comments to components).
This whole component needs documentation - at least give a title to the component, a brief description, explain the props, and a usage example. This is included with other components that have been created, specifically the selection lists (ChipsList, CheckboxList, etc.).
This whole component needs documentation - at least give a title to the component, a brief description, explain the props, and a usage example. This is included with other components that have been created, specifically the selection lists (`ChipsList`, `CheckboxList`, etc.).
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Created a dashboard button that is used to redirect user to a specified page. Has a title, description, and option for an icon.
Temporary test page for testing.
Refer to my comments.
@@ -0,0 +1,61 @@use leptos::prelude::*;These should not be Optional values. When we use
#[prop(optional), it just means that we either have a value, or the default value. For something like this (a String) that would mean we either have a specific value passed in or just the empty string.Setting up the
#[prop]the right way above should mean that you just print the string value here, no mapping needed.Depending on your desired behavior, leaving this as an
Option<String>might be fine. What I'd like to know is the mindset behind it - if this is aNonevalue, how are you handling it? Should this even be optional at all? Why?I'd recommend documenting this properly (refer to Leptos documentation for how to add doc comments to components).
@@ -0,0 +19,4 @@/// </div>/// ```#[component]pub fn DashboardButton(This whole component needs documentation - at least give a title to the component, a brief description, explain the props, and a usage example. This is included with other components that have been created, specifically the selection lists (
ChipsList,CheckboxList, etc.).@@ -0,0 +1,61 @@use leptos::prelude::*;These props should also have comments. They just have the
/// commentone line above.There should always be a space after the
#in headers.