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

Feature/become trainer #30

Merged
merged 8 commits into from
Aug 19, 2018
Merged

Feature/become trainer #30

merged 8 commits into from
Aug 19, 2018

Conversation

kgajowy
Copy link
Contributor

@kgajowy kgajowy commented Aug 15, 2018

  • fixed bug in 'restore session' when user expire_date was not read correctly
  • forced redirect after receiving a successful callback from Auth0 (otherwise refreshing with /callback?token=... stuff implied login error as token was already used once
  • refactored buttons to be now shared Primary Button
  • added feature of becoming a trainer/leaving a topic
  • added correct display numbers for pie chart

image

opened task for future:

  • handle difference in leaving authored topic (button text/states missing in requirements?)
  • ... and other similar states (like: cannot be a member as you are a trainer etc)
  • cleanup in storing user session
  • become trainer/member containers are 95% duplicate - improve it?
  • styling ! (what do you think about styled-grid?)

@kgajowy kgajowy requested a review from Tuhaj August 15, 2018 20:49
Copy link
Member

@Tuhaj Tuhaj left a comment

Choose a reason for hiding this comment

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

V. small changes, this PR is fantastic! 🎖

});
});

describe('when ApiService return confirmation', () => {
Copy link
Member

Choose a reason for hiding this comment

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

'when ApiService returns confirmation'

export const ActionButton = styled.button`
width: 201px;
height: 40px;
background-color: #e6cf42;
Copy link
Member

Choose a reason for hiding this comment

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

variable for this color?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no reason to do so. Action button is meant to be a "Primary Action Button" (CTA) and it has one, special color as on designs. Primary / secondary colors should rather be a part of theme which styled components support

const PrimaryButton = props => (
<ActionButton {...props}>
{' '}
<ActionButtonSpanText>{props.children}</ActionButtonSpanText>{' '}
Copy link
Member

Choose a reason for hiding this comment

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

this is somehow ugly, maybe new line can help for the space?

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 think it is a leftover, will remove!

.then(user => {
if (user) {
this.props.loginSuccess(user);
// TODO how to? this.history.push('/');
Copy link
Member

Choose a reason for hiding this comment

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

I don't know! Don't ask me 😄

return (
<div>
{alreadyAttending && (
<PrimaryButton onClick={this.leave}>
Copy link
Member

Choose a reason for hiding this comment

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

let's make a component from it!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

its not reusable anywhere and most likely will not be. We already have a nice reusable component of PrimaryButton. Could you please point out what income would be from making it a component?

Copy link
Member

Choose a reason for hiding this comment

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

not needed

@Tuhaj Tuhaj merged commit 2101bee into master Aug 19, 2018
@Tuhaj Tuhaj deleted the feature/become-trainer branch August 19, 2018 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants