Skip to content

Conversation

radi-cho
Copy link
Contributor

What kind of change does this PR introduce?
This is feature request discussed in #449

What is the new behavior?
Added icons for every framework in users' page with sandboxes

Checklist:

@CompuIves, please test this and if there are problems share them here and I'll fix (I wasn't able to test this as well)

<td>{moment(s.insertedAt).format('ll')}</td>
<td>{moment(s.updatedAt).format('ll')}</td>
<StatBody>
{getDefinition(s.template).Icon(35, 35) ||
Copy link
Member

@CompuIves CompuIves Jan 14, 2018

Choose a reason for hiding this comment

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

I would replace {getDefinition(s.template).Icon(35, 35) || getDefinition().Icon(35, 35)} with something like this:

At the beginning of the render body:

const Icon = getDefinition(s.template).Icon || getDefinition().Icon;

In the StatBody:

	<Icon width={35} height={35} />

Calling a component as a function is generally not best practice, as it's not handled by React lifecycle that way.

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 also thought this (I remembered this would be better after pushed my changes) but waited to see your opinion 😃

Copy link
Contributor Author

@radi-cho radi-cho Jan 14, 2018

Choose a reason for hiding this comment

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

Oh, but this is in stateless function. So I'll replace ( with { in the loop

Copy link
Member

@CompuIves CompuIves left a comment

Choose a reason for hiding this comment

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

This is great! I left a small comment for the code, after that it's ready to be merged!

@lbogdan
Copy link
Contributor

lbogdan commented Jan 14, 2018

@CompuIves Any idea why sandbox list doesn't work on PRs?
See http://pr453.cs.lbogdan.tk/u/lbogdan/sandboxes vs https://codesandbox.io/u/lbogdan/sandboxes .
There's no error in the console, but also no call to the API to list the sandboxes.

@radi-cho
Copy link
Contributor Author

radi-cho commented Jan 14, 2018

@lbogdan Firstly I'm not able to log in there

image

@lbogdan
Copy link
Contributor

lbogdan commented Jan 14, 2018

@radi-cho Yeah, we don't support logging in from a PR build (mostly because not https, but there are also other factors). If you really want to "login", copy the jwt key from codesandbox.io's local storage. But be warned your token will be sent in cleartext over http!

@CompuIves
Copy link
Member

Looks good to me @radi-cho! Only thing left is the lint issue.

@radi-cho
Copy link
Contributor Author

radi-cho commented Jan 15, 2018

@CompuIves Great 😃! I checked out the lint errors and I'm gonna fix them 😅
But what about ci/circleci: test-integrations?

@CompuIves
Copy link
Member

Integration tests should pass if you merge with master 😄

@radi-cho
Copy link
Contributor Author

radi-cho commented Jan 15, 2018

@CompuIves - The module path was wrong. That's why there were lint errors. Thanks to @samet-karaibryamov - he helped me a bit.
@lbogdan - Now http://pr453.cs.lbogdan.tk/u/lbogdan/sandboxes is working.

The like, forks and views count are moved right. So I'm gonna fix this and the PR will be ready to merge 😄

image

@radi-cho
Copy link
Contributor Author

It's ready to merge now, I hope 😃!

image

@CompuIves
Copy link
Member

CompuIves commented Jan 15, 2018

Perfect. Thank you very very much @radi-cho and @samet-karaibryamov!!
I'll deploy tomorrow morning, will sleep some first 😄

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