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

Add comment column to normal swate with manually adaptable name #633

Merged
merged 4 commits into from
Feb 14, 2025

Conversation

Etschbeijer
Copy link
Collaborator

Closes #591

@Etschbeijer Etschbeijer self-assigned this Feb 13, 2025
@@ -86,7 +86,13 @@ let private SearchBuildingBlockHeaderElement (ui: BuildingBlockUIState, setUi, m
// Dropdown building block type choice
Dropdown.Main(ui, setUi, model, dispatch)
// Term search field
if state.HeaderCellType.HasOA() then
if state.HeaderCellType = CompositeHeaderDiscriminate.Comment then
Daisy.input [
Copy link
Collaborator

Choose a reason for hiding this comment

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

missing prop.defaultValue

@@ -179,14 +185,15 @@ let private AddBuildingBlockButton (model: Model) dispatch =
[<ReactComponent>]
let Main (model: Model) dispatch =
let state_bb, setState_bb = React.useState(BuildingBlockUIState.init)
let inputValue, setInputValue = React.useState ""
Copy link
Collaborator

Choose a reason for hiding this comment

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

please put this into BuildingBlock.Model with a more descriptive name

Copy link
Collaborator

Choose a reason for hiding this comment

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

we want to share the same information between page switches. Everything in the ReactComponent is lost when switching to another page

Copy link
Collaborator

Choose a reason for hiding this comment

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

to clarify: "page" means sidebar tab

@@ -185,15 +188,15 @@ let private AddBuildingBlockButton (model: Model) inputValue dispatch =
[<ReactComponent>]
let Main (model: Model) dispatch =
let state_bb, setState_bb = React.useState(BuildingBlockUIState.init)
let inputValue, setInputValue = React.useState ""
let commentHeader, setCommentHeader = React.useState model.AddBuildingBlockState.CommentHeader
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is really bad style!! Just use the value straight from model. No sense in binding it one more time to a react state

@Freymaurer Freymaurer merged commit 59010ae into main Feb 14, 2025
2 checks passed
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.

[Feature Request]: Include usage of comments
2 participants