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

MarkdownBlockGroup component #48

Open
10 tasks done
justin-b-yee opened this issue Jul 28, 2024 · 6 comments · May be fixed by #75
Open
10 tasks done

MarkdownBlockGroup component #48

justin-b-yee opened this issue Jul 28, 2024 · 6 comments · May be fixed by #75
Assignees
Labels
React React

Comments

@justin-b-yee
Copy link
Contributor

justin-b-yee commented Jul 28, 2024

Specs

Create a new component that displays multiple MarkdownBlocks.

<MarkdownBlockGroup
     title = '',
     blocks = [],
     mode = 'light',
>

// Blocks takes passed props
// const { key, ...otherProps } = block

Requirements

Note: These are only really needed to display in home.stories.js - the component can still be worked on without these.

Tasks

  • Create a new file: components/markdown-block-group.js
  • If no title is provided, don't leave any spacing above the MarkdownBlocks.
  • For each 'block', look up the react component in a table - see
    const Blocks = {
    and pass otherProps to it
  • Display all blocks based on the blocks.length value for width in blocks.
  • In condensed/mobile mode, use a single column to display all blocks.
  • Change the subject/background color based on 'mode'. (example: text-block.js)
  • Create a new stories file "markdown-block-group.stories.js" to test different configurations of these props.
  • Add two blocks to home.stories.js to display MarkdownBlockGroups like those in the mockup.

Figma

Example 1

Image

Example 2

Image

@justin-b-yee justin-b-yee converted this from a draft issue Jul 28, 2024
@justin-b-yee justin-b-yee added the React React label Jul 29, 2024
@ddfridley
Copy link
Contributor

This looks good, but here are a few things to consider. And I think it's more educational if I write the changes and reasons here - rather than just making the changes.

In terms of the UI design, the number across needs to be either maxCols (or targetCols or just cols ) or 1 wide when width less than condensedWidthBreakPoint. It disrupts the ui for it to be 3 and 1, or 2 and 1.

Also, like other block components, there is theme.maxPanelWidth that is the maxmum width. See text-block for example.

Instead of children, use blocks as the prop, and like app/web-componnents/home.js this component can take named blocks from props and look up the corresponding react component. -- this is so the data for what's in the MarkDownBlockGroup can come from the database. Perhaps Blocks needs to be exported or become a separate component.

In enciv-home, and in the future in civil-pursuit - we want to reserve .jsx for old react class components. for functional react components we want to use .js -- they all compiles either way. It's helps differentiate, and it's just a style that was settled on by team members in the undebate project.

I think this needs to support mode for subject color and background color.

@justin-b-yee
Copy link
Contributor Author

This looks good, but here are a few things to consider. And I think it's more educational if I write the changes and reasons here - rather than just making the changes.

In terms of the UI design, the number across needs to be either maxCols (or targetCols or just cols ) or 1 wide when width less than condensedWidthBreakPoint. It disrupts the ui for it to be 3 and 1, or 2 and 1.

Also, like other block components, there is theme.maxPanelWidth that is the maxmum width. See text-block for example.

Instead of children, use blocks as the prop, and like app/web-componnents/home.js this component can take named blocks from props and look up the corresponding react component. -- this is so the data for what's in the MarkDownBlockGroup can come from the database. Perhaps Blocks needs to be exported or become a separate component.

In enciv-home, and in the future in civil-pursuit - we want to reserve .jsx for old react class components. for functional react components we want to use .js -- they all compiles either way. It's helps differentiate, and it's just a style that was settled on by team members in the undebate project.

I think this needs to support mode for subject color and background color.

Thanks for the input! This clarifies things a bit - I updated the specs to take these into consideration.

@ddfridley
Copy link
Contributor

@justin-b-yee

For each block, do a lookup for the name in the database to retrieve the component. (example: app/web-components/home.js)
Changed to
For each 'block', look up the react component in a table - see

const Blocks = {

And now I'm posting it.

@RobH0 RobH0 self-assigned this Aug 6, 2024
@RobH0 RobH0 moved this from Todo to In Progress in EnCiv Cross Repo Project Management Aug 6, 2024
@RobH0
Copy link
Contributor

RobH0 commented Aug 9, 2024

Waiting for issues #43 and #45 to be completed and merged before finishing the addition of MarkdownBlockGroup examples to home.stories.js.

@ddfridley
Copy link
Contributor

@RobH0 What is the status of this? If you are not going to be able to work on it, can you unassign yourself or let me know? Thanks.

@ddfridley ddfridley moved this from In Progress to Todo in EnCiv Cross Repo Project Management Oct 21, 2024
@RobH0
Copy link
Contributor

RobH0 commented Oct 23, 2024

@RobH0 What is the status of this? If you are not going to be able to work on it, can you unassign yourself or let me know? Thanks.

Hi @ddfridley, sorry for the late reply. Just want to confirm that I am still working this issue. I've been waiting for issue #45 to be completed so I can finish the story to mockup the example 1 screenshot within this issue.

@ddfridley ddfridley mentioned this issue Nov 11, 2024
8 tasks
@RobH0 RobH0 linked a pull request Mar 11, 2025 that will close this issue
@RobH0 RobH0 moved this from In Progress to Ready for Review in EnCiv Cross Repo Project Management Mar 11, 2025
@ddfridley ddfridley moved this from Ready for Review to In Progress in EnCiv Cross Repo Project Management Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
React React
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

3 participants