ShapeShift integration #652

Merged
neb-b merged 7 commits from shapeshift into master 2017-12-06 01:33:41 +01:00
neb-b commented 2017-10-09 03:18:24 +02:00 (Migrated from github.com)
For https://github.com/lbryio/lbry-app/issues/609 Looks like this <img width="400" alt="screen shot 2017-12-04 at 12 25 40 pm" src="https://user-images.githubusercontent.com/16882830/33566549-559a22b0-d8ee-11e7-90c4-b81e612d4316.png"> <img width="400" alt="screen shot 2017-12-04 at 12 25 49 pm" src="https://user-images.githubusercontent.com/16882830/33566553-5935d770-d8ee-11e7-80e6-fe9d6139884e.png">
kauffj (Migrated from github.com) reviewed 2017-10-09 03:18:24 +02:00
kauffj commented 2017-11-22 00:33:21 +01:00 (Migrated from github.com)

My feedback:

  • This component should be above "Where to Find Credits" on the "Receive" page. "Where to Find Credits" can be come "More Ways to Get Credits".
  • The "Receive" page currently shows as "Wallet Address" in the Wunderbar. It should probably just say Receive, and the icon should possibly change.
  • Possibly the word "Receive" should change entirely.
  • This component should not be presented as ShapeShift. This is a component for buying credits. Shapeshift is a detail. IMO the only place the word ShapeShift should appear is in help text.
  • This component should likely have a corresponding FAQ article. You can either create this yourself, or create an Issue to create the article and assign to @tzarebczan.
  • The button should have the disabled style when clicked until it is done performing it's action (see "Generate New Address" for example of this)
  • If a wallet address is for a user to copy, it should use the same input styling as we do for other addresses that allows easy copying.
  • "Send up to XXX BTC to" after creating the shift is larger than it needs to be. This is just normal <p> text IMO.
  • It's mildly confusing that one would need to click "New" if they wanted to cancel.
  • The component introduces more new styles than it needs to. While we're not 100% at following Material Design, I think we ought to conform pretty closely to it at least until we have a redesign. Non-exhaustive list:
    • Inline help text next to the header
    • "New" button in the top right
    • Most of the deposit component
  • I'm worried about the need to know the send address up front. AFAIK CoinBase does not support this. Not sure about other exchanges.
  • Form validation should not happen until a user types. Right now, it tells me invalid address if I focus the input and then unfocus.
  • (Possibly not introduced in this PR: the styling on readonly inputs for copying text, like the wallet address, are broken.)
My feedback: - This component should be above "Where to Find Credits" on the "Receive" page. "Where to Find Credits" can be come "More Ways to Get Credits". - The "Receive" page currently shows as "Wallet Address" in the Wunderbar. It should probably just say Receive, and the icon should possibly change. - Possibly the word "Receive" should change entirely. - **This component should not be presented as ShapeShift**. This is a component for buying credits. Shapeshift is a detail. IMO the only place the word ShapeShift should appear is in help text. - This component should likely have a corresponding FAQ article. You can either create this yourself, or create an Issue to create the article and assign to @tzarebczan. - The button should have the disabled style when clicked until it is done performing it's action (see "Generate New Address" for example of this) - If a wallet address is for a user to copy, it should use the same input styling as we do for other addresses that allows easy copying. - "Send up to XXX BTC to" after creating the shift is larger than it needs to be. This is just normal `<p>` text IMO. - It's mildly confusing that one would need to click "New" if they wanted to cancel. - **The component introduces more new styles than it needs to**. While we're not 100% at following Material Design, I think we ought to conform pretty closely to it at least until we have a redesign. Non-exhaustive list: - Inline help text next to the header - "New" button in the top right - Most of the deposit component - **I'm worried about the need to know the send address up front.** AFAIK CoinBase does not support this. Not sure about other exchanges. - Form validation should not happen until a user types. Right now, it tells me invalid address if I focus the input and then unfocus. - (Possibly not introduced in this PR: the styling on readonly inputs for copying text, like the wallet address, are broken.)
liamcardenas commented 2017-11-22 06:19:38 +01:00 (Migrated from github.com)

Looking at this now. By the way, you dont need to use your own forked repo for branches in github anymore. You can just branch off of this repo and push your branch to create a pull request.

I'll let you know my thoughts.

Looking at this now. By the way, you dont need to use your own forked repo for branches in github anymore. You can just branch off of this repo and push your branch to create a pull request. I'll let you know my thoughts.
kauffj (Migrated from github.com) reviewed 2017-11-22 16:53:34 +01:00
kauffj (Migrated from github.com) left a comment

Some code feedback.

Some code feedback.
kauffj (Migrated from github.com) commented 2017-11-22 16:40:00 +01:00

Shift states should probably be constants.

Shift states should probably be constants.
kauffj (Migrated from github.com) commented 2017-11-22 16:40:15 +01:00

Should this be in the action?

Should this be in the action?
kauffj (Migrated from github.com) commented 2017-11-22 16:41:09 +01:00

Consider if <BusyMessage> is appropriate here

Consider if `<BusyMessage>` is appropriate here
kauffj (Migrated from github.com) commented 2017-11-22 16:45:16 +01:00

Great work starting a validation library! Let's determine a consistent signature for validation functions.

One that I've seen and like is that validators return sanitized values and except if they encounter an error.

So far, this is two inconsistent signatures, one that returns true/false, and one that returns an error set.

Great work starting a validation library! Let's determine a consistent signature for validation functions. One that I've seen and like is that validators return sanitized values and except if they encounter an error. So far, this is two inconsistent signatures, one that returns true/false, and one that returns an error set.
kauffj (Migrated from github.com) commented 2017-11-22 16:49:35 +01:00

Let's make this data to be consistent.

Let's make this data to be consistent.
kauffj (Migrated from github.com) commented 2017-11-22 16:46:00 +01:00

I think these additions are likely not necessary. Just put on the components as relevant.

I think these additions are likely not necessary. Just put on the components as relevant.
kauffj (Migrated from github.com) reviewed 2017-11-26 16:55:50 +01:00
kauffj (Migrated from github.com) commented 2017-11-26 16:55:50 +01:00

What do you think of allowing this wrapper to handle the Object.assign that every reducer does? Something like...

export const handleActions = (actionMap, defaultState) => {
  return (state = defaultState, action) => {
    const handler = actionMap[action.type];
    const newState = handler ? handler(state, action) : {}
    return Object.assign({}, state, newState);
  };
};

In writing this, I noticed that the reducers you added in shape_shift.js do not include the Object.assign calls. Aren't those always necessary?

What do you think of allowing this wrapper to handle the `Object.assign` that every reducer does? Something like... ``` export const handleActions = (actionMap, defaultState) => { return (state = defaultState, action) => { const handler = actionMap[action.type]; const newState = handler ? handler(state, action) : {} return Object.assign({}, state, newState); }; }; ``` In writing this, I noticed that the reducers you added in `shape_shift.js` do not include the `Object.assign` calls. Aren't those always necessary?
neb-b (Migrated from github.com) reviewed 2017-11-26 17:09:54 +01:00
neb-b (Migrated from github.com) commented 2017-11-26 17:09:54 +01:00

Not if using the spread operator ....
https://twitter.com/dan_abramov/status/688087202312491008

Not if using the spread operator `...`. https://twitter.com/dan_abramov/status/688087202312491008
neb-b (Migrated from github.com) reviewed 2017-11-26 17:10:47 +01:00
neb-b (Migrated from github.com) commented 2017-11-26 17:10:47 +01:00

We could still add that to the handleActions function anyway. So we don't have to add ...state in every reducer handler

We could still add that to the `handleActions` function anyway. So we don't have to add `...state` in every reducer handler
kauffj (Migrated from github.com) reviewed 2017-11-26 17:47:19 +01:00
kauffj (Migrated from github.com) commented 2017-11-26 17:47:19 +01:00

Object.assign isn't a deep clone either. Object.assign({}, state, { foo: "bar"}) and { ...state, { foo: "bar" } } are functionally equivalent.

(Correct me if above seems wrong to you.)

`Object.assign` isn't a deep clone either. `Object.assign({}, state, { foo: "bar"})` and `{ ...state, { foo: "bar" } }` are functionally equivalent. (Correct me if above seems wrong to you.)
neb-b (Migrated from github.com) reviewed 2017-11-26 17:52:02 +01:00
neb-b (Migrated from github.com) commented 2017-11-26 17:52:02 +01:00

Yeah they are the same. I believe babel transpiles the spread operator into object.assign

Yeah they are the same. I believe babel transpiles the spread operator into object.assign
neb-b (Migrated from github.com) reviewed 2017-11-28 05:17:40 +01:00
neb-b (Migrated from github.com) commented 2017-11-28 05:17:40 +01:00

I think it should stay here

I think it should stay here
neb-b commented 2017-11-28 05:19:33 +01:00 (Migrated from github.com)

Alright @kauffj do your worst. This code is starting to look a little wonky after looking it at so much so I'm sure there are a few things I missed/should fix. Working good though.

Alright @kauffj do your worst. This code is starting to look a little wonky after looking it at so much so I'm sure there are a few things I missed/should fix. Working good though.
kauffj (Migrated from github.com) reviewed 2017-11-28 23:29:41 +01:00
kauffj (Migrated from github.com) left a comment

Source code only review.

Source code only review.
@ -0,0 +4,4 @@
export default ({ dark, className }) => {
return (
<div
className={classnames(
kauffj (Migrated from github.com) commented 2017-11-28 23:11:32 +01:00

@IGassmann @liamcardenas please be aware of this pattern/design for determining class names that @seanyesmunt has added.

@IGassmann @liamcardenas please be aware of this pattern/design for determining class names that @seanyesmunt has added.
kauffj (Migrated from github.com) commented 2017-11-28 23:16:04 +01:00

We have a <SubmitButton> component used elsewhere. Please use that instead.

(This code also has a styling error: the text weight when rendered as a button is less than that when rendered as an anchor.)

We have a `<SubmitButton>` component used elsewhere. Please use that instead. (This code also has a styling error: the text weight when rendered as a button is less than that when rendered as an anchor.)
kauffj (Migrated from github.com) commented 2017-11-28 23:19:23 +01:00

Can the existing credit-amount classes be used for this? I'm generally opposed to this type of classname-as-styling, though you can certainly find other examples in the code. If credit-amount does not work, then I would instead propose new CSS classes specifically for styling financial values, not font-bold.

Can the existing `credit-amount` classes be used for this? I'm generally opposed to this type of classname-as-styling, though you can certainly find other examples in the code. If `credit-amount` does not work, then I would instead propose new CSS classes specifically for styling financial values, not `font-bold`.
kauffj (Migrated from github.com) commented 2017-11-28 23:19:58 +01:00

Unused class name.

Unused class name.
kauffj (Migrated from github.com) commented 2017-11-28 23:21:11 +01:00

Can this behavior be added to the existing Address component? If not all <Address> components should have a button, then this can be an optional property.

Can this behavior be added to the existing `Address` component? If not all `<Address>` components should have a button, then this can be an optional property.
kauffj (Migrated from github.com) commented 2017-11-28 23:22:25 +01:00

There is already code to detect external addresses on links and call shell.OpenExternal. Just a simple href property is sufficient here.

There is already code to detect external addresses on links and call `shell.OpenExternal`. Just a simple `href` property is sufficient here.
kauffj (Migrated from github.com) commented 2017-11-28 23:27:34 +01:00

IMO this and all of the definitions below it probably shouldn't exist.

IMO this and all of the definitions below it probably shouldn't exist.
@ -98,4 +98,4 @@ $button-focus-shift: 12%;
.button--submit {
kauffj (Migrated from github.com) commented 2017-11-28 23:27:13 +01:00

Isn't there already a disabled style? Can these share definitions?

Isn't there already a disabled style? Can these share definitions?
kauffj (Migrated from github.com) commented 2017-11-28 23:23:44 +01:00

Probably $spacing-vertical for consistency.

Probably `$spacing-vertical` for consistency.
kauffj (Migrated from github.com) commented 2017-11-28 23:24:08 +01:00

Most of these paddings should be $spacing-vertical or 1/2 $spacing-vertical.

Most of these paddings should be `$spacing-vertical` or 1/2 `$spacing-vertical`.
kauffj (Migrated from github.com) commented 2017-11-28 23:25:01 +01:00

Is a shapeshift__error sufficiently different from other errors that it needs it's own styling? Same for success.

Is a `shapeshift__error` sufficiently different from other errors that it needs it's own styling? Same for success.
kauffj (Migrated from github.com) commented 2017-11-28 23:25:41 +01:00

Does this actually require it's own styling? Is there no other styling that already exists that this should match?

Does this actually require it's own styling? Is there no other styling that already exists that this should match?
kauffj (Migrated from github.com) commented 2017-11-28 23:25:50 +01:00

This scares me.

This scares me.
kauffj (Migrated from github.com) commented 2017-11-28 23:25:59 +01:00

$spacing-vertical * 3

`$spacing-vertical` * 3
@ -0,0 +1,58 @@
.spinner {
kauffj (Migrated from github.com) commented 2017-11-28 23:23:11 +01:00

👏 good refactor

:clap: good refactor
neb-b (Migrated from github.com) reviewed 2017-11-28 23:38:32 +01:00
neb-b (Migrated from github.com) reviewed 2017-11-29 04:54:58 +01:00
neb-b (Migrated from github.com) commented 2017-11-29 04:54:58 +01:00

Don't need this class. The success class is just to add the green color on the text. There isn't any styles that only do that, maybe it should be a more generic className?

Don't need this class. The success class is just to add the green color on the text. There isn't any styles that only do that, maybe it should be a more generic className?
neb-b (Migrated from github.com) reviewed 2017-11-29 05:00:49 +01:00
neb-b (Migrated from github.com) commented 2017-11-29 05:00:49 +01:00

Yeah...

Can't think of better way to do it. Nothing bad could really happen, at least nothing worse than not having this. If someone changes the form content to be a different height, it will just "jump" to that height after it's rendered. The same thing would happen if we don't have this style, it will "jump" and increase the height when the form is rendered.

Happy to change it if we can think of a better way. I just hate having content jumping when stuff is loading

Yeah... Can't think of better way to do it. Nothing bad could really happen, at least nothing worse than not having this. If someone changes the form content to be a different height, it will just "jump" to that height after it's rendered. The same thing would happen if we don't have this style, it will "jump" and increase the height when the form is rendered. Happy to change it if we can think of a better way. I just hate having content jumping when stuff is loading
neb-b (Migrated from github.com) reviewed 2017-11-29 05:12:45 +01:00
neb-b (Migrated from github.com) commented 2017-11-29 05:12:45 +01:00

Not a fan of these? I think they can be pretty helpful to avoid creating a brand new class just to add a simple display style.

Totally down to get rid of them if you don't want them.

Not a fan of these? I think they can be pretty helpful to avoid creating a brand new class just to add a simple display style. Totally down to get rid of them if you don't want them.
liamcardenas (Migrated from github.com) reviewed 2017-11-29 10:23:47 +01:00
liamcardenas (Migrated from github.com) commented 2017-11-29 10:16:27 +01:00

just curious, we just merged the react upgrade. I saw you changed all the React.PropTypes.etc... to just PropTypes.etc...

I believe this will break (there probably won't be a merge conflict because this is a new file. Maybe merge with master and re-check that this works after making necessary changes?

just curious, we just merged the react upgrade. I saw you changed all the React.PropTypes.etc... to just PropTypes.etc... I believe this will break (there probably won't be a merge conflict because this is a new file. Maybe merge with master and re-check that this works after making necessary changes?
@ -0,0 +4,4 @@
export default ({ dark, className }) => {
return (
<div
className={classnames(
liamcardenas (Migrated from github.com) commented 2017-11-29 10:08:03 +01:00

Interesting, why was it done this way? (no need to respond here, I'll ask about it tomorrow)

Interesting, why was it done this way? (no need to respond here, I'll ask about it tomorrow)
liamcardenas (Migrated from github.com) commented 2017-11-29 10:14:18 +01:00

I don't see a better way of doing this either. As you said, worst case scenario, it will just do what it otherwise would have done had you not put this in. Best case scenario, it looks great.

But yeah, absolute px values are never great for dimensions :P

I don't see a better way of doing this either. As you said, worst case scenario, it will just do what it otherwise would have done had you not put this in. Best case scenario, it looks great. But yeah, absolute px values are never great for dimensions :P
liamcardenas (Migrated from github.com) commented 2017-11-22 06:21:22 +01:00

please delete

please delete
neb-b (Migrated from github.com) reviewed 2017-11-29 18:08:39 +01:00
neb-b (Migrated from github.com) commented 2017-11-29 18:08:39 +01:00

Whoops. You're right. I'll update

Whoops. You're right. I'll update
neb-b (Migrated from github.com) reviewed 2017-11-29 18:17:40 +01:00
neb-b (Migrated from github.com) commented 2017-11-29 18:17:40 +01:00

all good now 👍

all good now 👍
liamcardenas (Migrated from github.com) reviewed 2017-11-29 19:12:32 +01:00
liamcardenas (Migrated from github.com) commented 2017-11-29 19:12:24 +01:00

please save to package.json

please save to package.json
neb-b (Migrated from github.com) reviewed 2017-11-29 19:20:29 +01:00
neb-b (Migrated from github.com) commented 2017-11-29 19:20:29 +01:00

whoops. added

whoops. added
neb-b commented 2017-11-29 20:25:29 +01:00 (Migrated from github.com)

@liamcardenas I think we should merge this separate from adding analytics just because the PR is so big. Then we can also do some testing in an RC. We can hold off on doing an actual release until we add the analytics.

@liamcardenas I think we should merge this separate from adding analytics just because the PR is so big. Then we can also do some testing in an RC. We can hold off on doing an actual release until we add the analytics.
liamcardenas commented 2017-11-29 21:26:38 +01:00 (Migrated from github.com)

@seanyesmunt you're right, I removed the dependency

@seanyesmunt you're right, I removed the dependency
kauffj (Migrated from github.com) reviewed 2017-11-30 01:10:33 +01:00
kauffj (Migrated from github.com) left a comment

More feedback. Though I'm encountering an error reaching the second phase of a shift, will share on Slack.

More feedback. Though I'm encountering an error reaching the second phase of a shift, will share on Slack.
kauffj (Migrated from github.com) commented 2017-11-30 00:20:43 +01:00

Nice touch.

Nice touch.
kauffj (Migrated from github.com) commented 2017-11-30 00:26:44 +01:00

This should probably be <FormRow type="select"> (plus other properties). You can add a fieldPostfix or similar property for the "for LBC" part, if necessary.

This should probably be `<FormRow type="select">` (plus other properties). You can add a `fieldPostfix` or similar property for the "for LBC" part, if necessary.
kauffj (Migrated from github.com) commented 2017-11-30 00:32:36 +01:00

This should probably be <FormRow type="text">.

More generally, it's important to avoid using class names in a way that doesn't reflect what they are. This is not a Wunderbar.

I'm guessing what may have happened here is you don't like the default/current text input style. That's fine and good!

But in that case, the solution should be:

  1. Changing the overall input style. If there's something wrong with the default text input, there's a good chance that problem exists in places beyond this component.
  2. Generalizing the wunderbar style. If we truly need a new input style that matches one that was used more narrowly, it would be better to take the wunderbar styling and introduce a new class that encompasses and reflects this new broader usage.

(@liamcardenas @IGassmann please read above as well)

This should probably be `<FormRow type="text">`. More generally, it's important to avoid using class names in a way that doesn't reflect what they are. This is not a Wunderbar. I'm guessing what may have happened here is you don't like the default/current text input style. That's fine and good! But in that case, the solution should be: 1) _Changing_ the overall input style. If there's something wrong with the default text input, there's a good chance that problem exists in places beyond this component. 2) _Generalizing_ the wunderbar style. If we truly need a new input style that matches one that was used more narrowly, it would be better to take the wunderbar styling and introduce a new class that encompasses and reflects this new broader usage. (@liamcardenas @IGassmann please read above as well)
kauffj (Migrated from github.com) commented 2017-11-30 00:35:53 +01:00

If this error is instead passed into <FormRow>, it will have the existing shared error styling. As-is, it's black.

If this error is instead passed into `<FormRow>`, it will have the existing shared error styling. As-is, it's black.
kauffj (Migrated from github.com) commented 2017-11-30 00:37:59 +01:00

Should be in a __ wrapper.

Should be in a `__` wrapper.
kauffj (Migrated from github.com) commented 2017-11-30 00:38:17 +01:00

Missing __

Missing `__`
kauffj (Migrated from github.com) commented 2017-11-30 00:39:20 +01:00

(optional but recommend) should be first sentence of help text rather than in the label.

(optional but recommend) should be first sentence of help text rather than in the label.
kauffj (Migrated from github.com) commented 2017-11-30 00:19:36 +01:00

Missing address. You can point this at lbry.io/faq/shapeshift.

In general, to avoid necessity of updating code once article is generated, it's fine to put a URL in and then put the (suggested) slug in the ticket. If the support team doesn't like your suggestion, they can always let you know.

Missing address. You can point this at lbry.io/faq/shapeshift. In general, to avoid necessity of updating code once article is generated, it's fine to put a URL in and then put the (suggested) slug in the ticket. If the support team doesn't like your suggestion, they can always let you know.
kauffj (Migrated from github.com) commented 2017-11-30 00:40:18 +01:00

These display classes aren't necessary.

These display classes aren't necessary.
kauffj (Migrated from github.com) commented 2017-11-30 00:41:38 +01:00

Confirming these should be removed for now since no part of this PR requires them anymore. I will bring up your point about the usefulness of these on an upcoming meeting, or encourage you to do so if I don't.

Confirming these should be removed for now since no part of this PR requires them anymore. I will bring up your point about the usefulness of these on an upcoming meeting, or encourage you to do so if I don't.
kauffj (Migrated from github.com) commented 2017-11-30 01:03:03 +01:00

All of the CSS from here and below this can likely be done via existing card and form CSS classes and styles.

All of the CSS from here and below this can likely be done via existing card and form CSS classes and styles.
kauffj (Migrated from github.com) commented 2017-11-30 01:03:37 +01:00

This CSS should be able to go.

This CSS should be able to go.
kauffj (Migrated from github.com) commented 2017-11-30 01:06:45 +01:00

I think you can use credit-amount--indicator instead. If you dislike this, you can componentize the rendering of this.

I think you can use `credit-amount--indicator` instead. If you dislike this, you can componentize the rendering of this.
kauffj (Migrated from github.com) commented 2017-11-30 01:09:31 +01:00

I'm okay shipping this as-is.

However, if we wanted to avoid it, I think there's a potential solution where we render the component before shapeshift is ready, but render it with a very low opacity or visibility: hidden. In addition, either turn off interaction or render a blocking element on top of entire component. Then we can absolutely center a loading icon on top of this, and have it match the height precisely.

I'm okay shipping this as-is. However, if we wanted to avoid it, I think there's a potential solution where we render the component before shapeshift is ready, but render it with a very low opacity or `visibility: hidden`. In addition, either turn off interaction or render a blocking element on top of entire component. Then we can absolutely center a loading icon on top of this, and have it match the height precisely.
kauffj (Migrated from github.com) reviewed 2017-11-30 02:42:14 +01:00
kauffj (Migrated from github.com) commented 2017-11-30 02:42:13 +01:00

Try button="text" here.

Try `button="text"` here.
kauffj (Migrated from github.com) reviewed 2017-11-30 02:42:49 +01:00
neb-b (Migrated from github.com) reviewed 2017-11-30 02:46:52 +01:00
neb-b (Migrated from github.com) commented 2017-11-30 02:46:51 +01:00

I was thinking this would be a link to the FAQ Tom writes up

I was thinking this would be a link to the FAQ Tom writes up
kauffj (Migrated from github.com) reviewed 2017-11-30 02:46:52 +01:00
kauffj (Migrated from github.com) commented 2017-11-30 02:46:52 +01:00

Add ".". Also, let's link to FAQ here again.

Add ".". Also, let's link to FAQ here again.
kauffj (Migrated from github.com) reviewed 2017-11-30 02:49:16 +01:00
kauffj (Migrated from github.com) commented 2017-11-30 02:49:16 +01:00

I'm not in love with "New" here - maybe just "Reset"? Though I don't like this either. As a (potentially weird) user, I have a desire for things to be back in their default state when "Done". But I don't necessary want to do a new one. I just want it back to where it was. Not sure on best name for this.

I'm not in love with "New" here - maybe just "Reset"? Though I don't like this either. As a (potentially weird) user, I have a desire for things to be back in their default state when "Done". But I don't necessary want to do a new one. I just want it back to where it was. Not sure on best name for this.
kauffj (Migrated from github.com) reviewed 2017-11-30 02:49:26 +01:00
kauffj (Migrated from github.com) commented 2017-11-30 02:49:26 +01:00

Also this should probably be primary, whatever the label is.

Also this should probably be primary, whatever the label is.
neb-b (Migrated from github.com) reviewed 2017-11-30 02:54:09 +01:00
neb-b (Migrated from github.com) commented 2017-11-30 02:54:09 +01:00

Yeah definitely not a fan of the current input styling. I was thinking this was fine for now since the PR is getting bigger and bigger. But might as well do it now and avoid more tech debt. I will update the generic input style to be more inline with the wunderbar

Yeah definitely not a fan of the current input styling. I was thinking this was fine for now since the PR is getting bigger and bigger. But might as well do it now and avoid more tech debt. I will update the generic `input` style to be more inline with the wunderbar
neb-b (Migrated from github.com) reviewed 2017-11-30 06:18:07 +01:00
neb-b (Migrated from github.com) commented 2017-11-30 06:18:07 +01:00

I think this should stay as just classes with regular html elements. I can make my case more tomorrow, but my main idea is this:

Shared components are good for elements that can very a lot, but only with small differences. Buttons have many different possible styles (different background colors, borders, labels, etc). A lot of different variation, but the component is generally the same, a box with some text in the middle.

For this element (select), there can be many different ways to present it. I think it definitely makes sense to use a shared components if there might be inline errors or something we want to keep the same across the app, but there won't be any errors on this select element. I just want the styling with text on the left and right, which is very easy just by using regular html elements (and the same classes that the FormRow component uses).

If we start building out the shared components so much that they meet every possible use case, they can quickly become huge, un-maintainable files that can be terrible pain to update/change.

Would love to hear everyone else's thoughts. @liamcardenas @IGassmann

I think this should stay as just classes with regular html elements. I can make my case more tomorrow, but my main idea is this: Shared components are good for elements that can very a lot, but only with small differences. Buttons have many different possible styles (different background colors, borders, labels, etc). A lot of different variation, but the component is generally the same, a box with some text in the middle. For this element (`select`), there can be many different ways to present it. I think it definitely makes sense to use a shared components if there might be inline errors or something we want to keep the same across the app, but there won't be any errors on this `select` element. I just want the styling with text on the left and right, which is very easy just by using regular html elements (and the same classes that the `FormRow` component uses). If we start building out the shared components so much that they meet every possible use case, they can quickly become huge, un-maintainable files that can be terrible pain to update/change. Would love to hear everyone else's thoughts. @liamcardenas @IGassmann
neb-b (Migrated from github.com) reviewed 2017-11-30 06:35:16 +01:00
neb-b (Migrated from github.com) commented 2017-11-30 06:35:16 +01:00

I'll keep the min-height on shapeshift__maxdeposit to avoid content jumping when we fetch new max limits after the user changes the origin coin

I'll keep the min-height on `shapeshift__maxdeposit` to avoid content jumping when we fetch new max limits after the user changes the origin coin
neb-b (Migrated from github.com) reviewed 2017-11-30 06:40:25 +01:00
neb-b (Migrated from github.com) commented 2017-11-30 06:40:25 +01:00

I don't think it's necessary to use the card-xx styles for this. It doesn't have anything to do with the card style. It's just a small bit of markup that needs some padding. I think ideally we could just use a s-vertical-padding helper class or something similar. We can discuss this more along with the display-xx helper classes.

I don't think it's necessary to use the `card-xx` styles for this. It doesn't have anything to do with the `card` style. It's just a small bit of markup that needs some padding. I think ideally we could just use a `s-vertical-padding` helper class or something similar. We can discuss this more along with the `display-xx` helper classes.
neb-b (Migrated from github.com) reviewed 2017-11-30 06:41:42 +01:00
neb-b (Migrated from github.com) commented 2017-11-30 06:41:42 +01:00

👍

👍
kauffj (Migrated from github.com) reviewed 2017-11-30 17:47:48 +01:00
kauffj (Migrated from github.com) commented 2017-11-30 17:47:48 +01:00

card__content is the class I'd propose using instead.

`card__content` is the class I'd propose using instead.
neb-b (Migrated from github.com) reviewed 2017-11-30 19:04:15 +01:00
neb-b (Migrated from github.com) commented 2017-11-30 19:04:15 +01:00

👍

👍
neb-b commented 2017-11-30 22:58:06 +01:00 (Migrated from github.com)

@kauffj only thing left (I think) is adding a link to the FAQ on lbry.io, and flow.

@kauffj only thing left (I think) is adding a link to the FAQ on lbry.io, and flow.
kauffj commented 2017-11-30 23:44:03 +01:00 (Migrated from github.com)

@seanyesmunt no need to block app PRs on FAQ content. Just put the link in the code, get the ticket open (I know this happened), and you can forget about it.

@seanyesmunt no need to block app PRs on FAQ content. Just put the link in the code, get the ticket open (I know this happened), and you can forget about it.
neb-b commented 2017-12-01 04:28:01 +01:00 (Migrated from github.com)

@kauffj sounds good. What should the url be?

@kauffj sounds good. What should the url be?
kauffj commented 2017-12-01 04:32:19 +01:00 (Migrated from github.com)

@seanyesmunt lbry.io/faq/shapeshift

https://github.com/lbryio/lbry-app/pull/652#discussion_r153944702

(also on the lbry.io ticket)

@seanyesmunt lbry.io/faq/shapeshift https://github.com/lbryio/lbry-app/pull/652#discussion_r153944702 (also on the lbry.io ticket)
neb-b (Migrated from github.com) reviewed 2017-12-04 04:36:24 +01:00
@ -0,0 +1,3 @@
declare module 'bluebird' {
neb-b (Migrated from github.com) commented 2017-12-04 04:36:24 +01:00

There's got to be a better way to do this. Can these be added to the .flowconfig?

There's got to be a better way to do this. Can these be added to the `.flowconfig`?
neb-b (Migrated from github.com) reviewed 2017-12-04 04:39:49 +01:00
@ -20,3 +20,3 @@
modules: [appPath, "node_modules"],
extensions: [".js", ".jsx", ".css"]
extensions: [".js", ".jsx", ".css", ".json"]
},
neb-b (Migrated from github.com) commented 2017-12-04 04:39:49 +01:00

This is required because the shapeshift.io module has an import like const package = require('../package')

It causes the bundle to increase quite a bit. I will make a pr to that project to change it to const package = require('../package.json') which allow use to remove this

This is required because the shapeshift.io module has an import like `const package = require('../package')` It causes the bundle to increase quite a bit. I will make a pr to that project to change it to `const package = require('../package.json')` which allow use to remove this
neb-b commented 2017-12-04 04:44:06 +01:00 (Migrated from github.com)

@kauffj @liamcardenas

I could probably spend another week just on cleaning up the flow stuff. It is integrated into the entire shapeshift flow and already caught a few issues. I think it is good for now, but could certainly be presented a little better. I will come back to this as we add flow to more files and determine how we want to structure it.

@kauffj @liamcardenas I could probably spend another week just on cleaning up the flow stuff. It is integrated into the entire shapeshift flow and already caught a few issues. I think it is good for now, but could certainly be presented a little better. I will come back to this as we add flow to more files and determine how we want to structure it.
kauffj (Migrated from github.com) reviewed 2017-12-04 16:50:00 +01:00
kauffj (Migrated from github.com) left a comment

One more time :)

One more time :)
kauffj (Migrated from github.com) commented 2017-12-04 16:47:48 +01:00

Should be "alt" for Cancel.

Should be "alt" for Cancel.
kauffj (Migrated from github.com) commented 2017-12-04 16:48:35 +01:00

What happened to the idea of a "Sent" button that displays the shift code for tracking purposes?

What happened to the idea of a "Sent" button that displays the shift code for tracking purposes?
@ -0,0 +75,4 @@
return (
<div>
{shiftState === statuses.NO_DEPOSITS && (
kauffj (Migrated from github.com) commented 2017-12-04 16:49:01 +01:00

The exchange rate and fees should still be displayed at this step.

The exchange rate and fees should still be displayed at this step.
@ -0,0 +79,4 @@
<div>
<p>
Send up to{" "}
<span className="credit-amount--bold">
kauffj (Migrated from github.com) commented 2017-12-04 16:49:40 +01:00

This whole element should be the same style IMO. I'd be fine with just credit-amount--bold for the whole thing.

This whole element should be the same style IMO. I'd be fine with just `credit-amount--bold` for the whole thing.
kauffj (Migrated from github.com) commented 2017-12-04 16:45:27 +01:00
  1. Is it possible to display the actual rate here?
  2. This can be more compact. If we have the rate, proposed text is "Receive X LBC per Y BTC, less Z LBC fee. Max: W BTC, Min: V BTC"
  3. Typo in minimum
1) Is it possible to display the actual rate here? 2) This can be more compact. If we have the rate, proposed text is "Receive X LBC per Y BTC, less Z LBC fee. Max: W BTC, Min: V BTC" 3) Typo in minimum
kauffj (Migrated from github.com) commented 2017-12-04 16:46:29 +01:00

This needs to be cast as a boolean.

This needs to be cast as a boolean.
kauffj (Migrated from github.com) commented 2017-12-04 16:42:33 +01:00

I still dislike both this rule and the rule below. Nothing about Shapeshift seems special enough that it needs it's own spacing rules vs. other cards.

I still dislike both this rule and the rule below. Nothing about Shapeshift seems special enough that it needs it's own spacing rules vs. other cards.
@ -0,0 +13,4 @@
}
.shapeshift__tx-info {
min-height: 55px;
kauffj (Migrated from github.com) commented 2017-12-04 16:43:20 +01:00

If this is to avoid jumping, I'd rather just put placeholder text like "Calculating rates..."

If this is to avoid jumping, I'd rather just put placeholder text like "Calculating rates..."
neb-b (Migrated from github.com) reviewed 2017-12-04 17:38:54 +01:00
neb-b (Migrated from github.com) commented 2017-12-04 17:38:54 +01:00

Yes we can display the actual rate. I'll add that

Yes we can display the actual rate. I'll add that
neb-b (Migrated from github.com) reviewed 2017-12-04 17:41:12 +01:00
@ -0,0 +13,4 @@
}
.shapeshift__tx-info {
min-height: 55px;
neb-b (Migrated from github.com) commented 2017-12-04 17:41:12 +01:00

We would still need some sort of min height on that unless the heights are the same. I would rather not since this check is usually very quick and you would only see that for a small time before it goes back to the info text.

We would still need some sort of min height on that unless the heights are the same. I would rather not since this check is usually very quick and you would only see that for a small time before it goes back to the info text.
neb-b (Migrated from github.com) reviewed 2017-12-04 18:24:37 +01:00
neb-b (Migrated from github.com) commented 2017-12-04 18:24:37 +01:00

I'm not sure how much I like that button. What if they click it before actually sending? We would need some new bit of UI to say "We will keep pinging shapeshit to see if you actually sent it" (obviously worded better).

We say "this will update automatically" and have a link to the shapeshift status page, I don't see any reason to create another shift status "user says they sent it but shapeshift hasn't received it"

I'm not sure how much I like that button. What if they click it before actually sending? We would need some new bit of UI to say "We will keep pinging shapeshit to see if you actually sent it" (obviously worded better). We say "this will update automatically" and have a link to the shapeshift status page, I don't see any reason to create another shift status "user says they sent it but shapeshift hasn't received it"
liamcardenas (Migrated from github.com) requested changes 2017-12-04 21:30:40 +01:00
@ -0,0 +1,3 @@
declare module 'bluebird' {
liamcardenas (Migrated from github.com) commented 2017-12-04 21:05:37 +01:00

Have you checked if flow-typed has any of the type definitions?

https://github.com/flowtype/flow-typed

yarn run flow-typed install bluebird

Have you checked if flow-typed has any of the type definitions? https://github.com/flowtype/flow-typed `yarn run flow-typed install bluebird`
liamcardenas (Migrated from github.com) commented 2017-12-04 21:14:00 +01:00

outside of the constructor, I think you need to add

continuousFetch: ?number;

as per https://flow.org/en/docs/types/classes/

outside of the constructor, I think you need to add `continuousFetch: ?number;` as per https://flow.org/en/docs/types/classes/
liamcardenas (Migrated from github.com) commented 2017-12-04 21:14:19 +01:00

this should get rid of all the flow fix mes

this should get rid of all the flow fix mes
@ -0,0 +20,4 @@
// All ShapeShift actions
// Action types defined in the reducer will contain some payload
export type Action =
| { type: types.GET_SUPPORTED_COINS_START }
liamcardenas (Migrated from github.com) commented 2017-12-04 21:19:17 +01:00

I get that you are defining these here so as not to create extra boilerplate work, but I wonder if all of the types should be defined in the same place? I think this is probably best, but I just wanted to throw this question out there in case anyone has any thoughts on it

I get that you are defining these here so as not to create extra boilerplate work, but I wonder if all of the types should be defined in the same place? I think this is probably best, but I just wanted to throw this question out there in case anyone has any thoughts on it
@ -0,0 +37,4 @@
// Basic thunk types
// It would be nice to import these from types/common
// Not sure how that would work since they rely on the Action type
type PromiseAction = Promise<Action>;
liamcardenas (Migrated from github.com) commented 2017-12-04 21:25:18 +01:00

can you make these generic and move them to a different folder as you alluded to in the comment? I also am not a huge fan of using the any type here but for now I think this is good.

i.e.

 type ThunkAction<T> = (dispatch: Dispatch<T>) => any;
 export type Dispatch<T> = (
   action: T | ThunkAction<T> | PromiseAction<T> | Array<T>
 ) => any;

can you make these generic and move them to a different folder as you alluded to in the comment? I also am not a huge fan of using the any type here but for now I think this is good. i.e. ```type PromiseAction<T> = Promise<T>; type ThunkAction<T> = (dispatch: Dispatch<T>) => any; export type Dispatch<T> = ( action: T | ThunkAction<T> | PromiseAction<T> | Array<T> ) => any;
liamcardenas (Migrated from github.com) commented 2017-12-04 21:26:20 +01:00

I don't want you to get bogged down with this if for some reason its really difficult

I don't want you to get bogged down with this if for some reason its really difficult
@ -34,6 +34,11 @@ body
color: var(--color-meta-light);
}
.credit-amount--bold
liamcardenas (Migrated from github.com) commented 2017-12-04 21:29:04 +01:00

is this used elsewhere in the app or is it just for shapeshift? I don't have a criticism here, I'm just wondering what we decided about using reusable vs case specific classes?

is this used elsewhere in the app or is it just for shapeshift? I don't have a criticism here, I'm just wondering what we decided about using reusable vs case specific classes?
kauffj (Migrated from github.com) reviewed 2017-12-04 23:05:02 +01:00
@ -0,0 +20,4 @@
// All ShapeShift actions
// Action types defined in the reducer will contain some payload
export type Action =
| { type: types.GET_SUPPORTED_COINS_START }
kauffj (Migrated from github.com) commented 2017-12-04 23:05:02 +01:00

My proposed design is:

  1. Add a types folder inside of js. types will eventually swallow constants.
  2. An Action type is defined in Action.js inside of this folder.
  3. This file also includes all action constant definitions.
  4. The Action type explicitly enumerates all possible action type values.

My biggest question about this design is whether there should only be one action type, or whether we should use subtypes for each possible action and payload signature.

My proposed design is: 1) Add a `types` folder inside of `js`. `types` will eventually swallow `constants`. 2) An `Action` type is defined in `Action.js` inside of this folder. 3) This file also includes all action constant definitions. 4) The `Action` type explicitly enumerates all possible action type values. My biggest question about this design is whether there should only be one action type, or whether we should use subtypes for each possible action and payload signature.
kauffj (Migrated from github.com) reviewed 2017-12-04 23:07:29 +01:00
@ -0,0 +20,4 @@
// All ShapeShift actions
// Action types defined in the reducer will contain some payload
export type Action =
| { type: types.GET_SUPPORTED_COINS_START }
kauffj (Migrated from github.com) commented 2017-12-04 23:07:29 +01:00

Possibly better to discuss this here https://github.com/lbryio/lbry-app/issues/810

Possibly better to discuss this here https://github.com/lbryio/lbry-app/issues/810
kauffj (Migrated from github.com) reviewed 2017-12-04 23:07:46 +01:00
@ -0,0 +20,4 @@
// All ShapeShift actions
// Action types defined in the reducer will contain some payload
export type Action =
| { type: types.GET_SUPPORTED_COINS_START }
kauffj (Migrated from github.com) commented 2017-12-04 23:07:46 +01:00

Let's not block this PR on getting action definition exactly correct.

Let's not block this PR on getting action definition exactly correct.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/lbry-desktop#652
No description provided.