Thanks to visit codestin.com
Credit goes to github.com

Skip to content

refactor: Add components for styling forms #1169

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

Merged
merged 5 commits into from
Apr 26, 2022
Merged

Conversation

presleyp
Copy link
Contributor

I thought some reusable components would help us with our create/edit forms.

  • FormFooter styles the Cancel and Submit buttons
  • FullPageForm adds a title, x button, and margins to a form

See stories for example usage - the FormFooter goes inside a form which goes inside the FullPageForm.

@presleyp presleyp requested a review from a team as a code owner April 25, 2022 22:15
@presleyp presleyp self-assigned this Apr 25, 2022
@codecov
Copy link

codecov bot commented Apr 25, 2022

Codecov Report

Merging #1169 (90283ed) into main (8f464ce) will decrease coverage by 0.29%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main    #1169      +/-   ##
==========================================
- Coverage   66.53%   66.23%   -0.30%     
==========================================
  Files         263      265       +2     
  Lines       16427    16593     +166     
  Branches      156      157       +1     
==========================================
+ Hits        10929    10991      +62     
- Misses       4377     4462      +85     
- Partials     1121     1140      +19     
Flag Coverage Δ
unittest-go-macos-latest 53.69% <ø> (-0.22%) ⬇️
unittest-go-postgres- 65.62% <ø> (-0.25%) ⬇️
unittest-go-ubuntu-latest 56.14% <ø> (-0.41%) ⬇️
unittest-go-windows-2022 53.24% <ø> (-0.28%) ⬇️
unittest-js 66.50% <0.00%> (-0.93%) ⬇️
Impacted Files Coverage Δ
site/src/components/FormFooter/FormFooter.tsx 0.00% <0.00%> (ø)
site/src/components/FullPageForm/FullPageForm.tsx 0.00% <0.00%> (ø)
peerbroker/dial.go 77.04% <0.00%> (-6.56%) ⬇️
cli/workspaces.go 47.22% <0.00%> (-5.91%) ⬇️
cli/cliui/agent.go 77.19% <0.00%> (-5.27%) ⬇️
cli/workspaceautostop.go 75.58% <0.00%> (-5.19%) ⬇️
cli/workspaceautostart.go 75.58% <0.00%> (-5.19%) ⬇️
coderd/organizations.go 56.70% <0.00%> (-3.95%) ⬇️
cli/workspacedelete.go 22.22% <0.00%> (-3.87%) ⬇️
codersdk/organizations.go 68.88% <0.00%> (-3.53%) ⬇️
... and 26 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8f464ce...90283ed. Read the comment docs.

Copy link
Contributor

@jsjoeio jsjoeio left a comment

Choose a reason for hiding this comment

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

Nice work!


export interface FullPageFormProps {
title: string
detail?: React.ReactNode
Copy link
Contributor

Choose a reason for hiding this comment

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

Had to read up again to remind myself what exactly is considered as a ReactNode

anything that is renderable inside of JSX, this is NOT the same as what can be rendered by a component!

source

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jsjoeio do you think it's the wrong type? I took it from FormTitle which is where this ends up but I could change it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh no, sorry, I think it's right. It just surprised me, that's all. I thought detail might have been a string when I first saw the component. Whatever you think is best!

@presleyp presleyp merged commit 23a1a4d into main Apr 26, 2022
@presleyp presleyp deleted the fullpageform/presleyp branch April 26, 2022 23:45
@misskniss misskniss added this to the V2 Beta milestone May 15, 2022
kylecarbs pushed a commit that referenced this pull request Jun 10, 2022
* Add FormFooter

* Add FullPageForm

* Lint

* Make detail optional

* Use Language
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