Skip to content
This repository has been archived by the owner on Mar 12, 2020. It is now read-only.

Adds form elements #587

Merged
merged 8 commits into from
Jun 9, 2017
Merged

Adds form elements #587

merged 8 commits into from
Jun 9, 2017

Conversation

orta
Copy link
Contributor

@orta orta commented Jun 6, 2017

Adds a button for indicating boolean states inside forms

screen shot 2017-06-09 at 13 34 14

This is also the first PR with jest-snapshots-svg, and renames consignment files from kebab-case to snake_case

@ArtsyOpenSource
Copy link

ArtsyOpenSource commented Jun 6, 2017

Warnings
⚠️

Could not find stories using these components:

  • Info

Generated by 🚫 dangerJS

@orta orta force-pushed the bottom-button branch 9 times, most recently from bebc9c3 to b36108b Compare June 7, 2017 09:15
@orta orta changed the base branch from bottom-button to master June 8, 2017 08:34
@orta orta changed the title [WIP] Adds form elements Adds form elements Jun 9, 2017
@orta
Copy link
Contributor Author

orta commented Jun 9, 2017

OK, this is now good to go - you can see the components in "Consignments: Style" - they have no interactions

@@ -9,7 +9,7 @@
},
"eslint.enable": false,
"flow.enabled": false,

"editor.formatOnSave": true,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mennenia @sarahscott @alloy @l2succes - this turns on prettier by default when you press save

Copy link
Contributor

Choose a reason for hiding this comment

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

as a compulsive saver (i occasionally try to cmd-s in real life), does this noticeably slow down the editor or hang?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope, I'm a compulsive saver too, all these things are done async too

There is an option to run on every newline instead, but I felt that was a bit overkill

import Search from "../components/artist-search-results"
import BottomAlignedButton, { BottomAlignedProps } from "../components/bottom-aligned-button"
import Search from "../components/artist_search_results"
import BottomAlignedButton, { BottomAlignedProps } from "../components/bottom_aligned_button"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

bunch of renames, they're in a folder called consignments already, so no need for extra context


import { storiesOf } from "@storybook/react-native"
import * as React from "react"
import { View } from "react-native"

import * as bottomAlignedButton from "./consignments-bottom-aligned.story"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved all of my kebab named files to lowercase, this is mainly to be consistent with code that came before me - we should consider adding a danger rule for this ( thinking of the same for Jest too jestjs/jest#3771 )

Copy link
Contributor

Choose a reason for hiding this comment

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

Yea, I'm down for lowercase and snake case for files, def.


</g>

</svg>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

first SVG, if you click the document button you can see the preview. It's pretty bad ATM, but there's only so much time in the day. It's getting there though.

screen shot 2017-06-09 at 13 31 22

Copy link
Contributor

Choose a reason for hiding this comment

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

Dude, awesome! 👏

Got a screenshot/design mockup of what it should look like for real?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, it's this:

screen shot 2017-06-09 at 17 17 49

👯‍♂️

For now I think it's better for bigger things like #603 than this, but I wanted to get it in

@orta orta assigned mzikherman and unassigned mennenia Jun 9, 2017
@orta
Copy link
Contributor Author

orta commented Jun 9, 2017

Maxim already has a PR to review, @mzikherman doesn't

import * as renderer from "react-test-renderer"
import BooleanButton from "../boolean_button"

it("looks good as an svg", () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

kind of an odd test description? it can still be totally wrong but still look good!

@@ -0,0 +1,94 @@
import * as React from "react"
Copy link
Contributor

Choose a reason for hiding this comment

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

😎

Feel like the name isn't amazing, maybe 'Toggle' or something is better?

Copy link
Contributor

Choose a reason for hiding this comment

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

It seems like the way a consumer might want to use this component, is to basically provide the left/right text. So will this component be handling the 'toggle'?

ie- should this component do the UI toggling, and then call the onPress the client passed in (since presumably that might trigger something)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was thinking that the onPress would end up changing a parent's state that would eventually trickle down into the selected state, so handling the transition in the component didn't feel right. If it was doing animation, I'd definitely agree though. Then it might be a onChange kind of affair.

WRT name: agreed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Him, maybe an onchange is just better overall, it can provide the new state then

@mzikherman mzikherman merged commit 462eee5 into master Jun 9, 2017
@orta orta deleted the form-elements branch June 9, 2017 18:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants