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

fix: refacto #62

Merged
merged 21 commits into from
Oct 7, 2017
Merged

fix: refacto #62

merged 21 commits into from
Oct 7, 2017

Conversation

totorototo
Copy link
Owner

No description provided.

@totorototo totorototo requested a review from guipasmoi September 7, 2017 21:37

import theme from "../../../theme/theme";

export default StyleSheet.create({
Copy link
Collaborator

Choose a reason for hiding this comment

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

may be we should return not a style but a styleCreator

export default ({mode, ...})=>{
    return StyleSheet.create({
         container:{
              backgroundColor:theme[mode+"Color"],
          }
     })
}

we could even wrap it with a higher order function to add optimisations like memoization.
It could allow us may be to create dynamique styleSheet -> dynamique theme

Copy link
Collaborator

Choose a reason for hiding this comment

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

use would be something like this

import styleSheetCreator from './styles'

...
render(){
    const styles = styleSheetCreator({mode: this.props.mode, size:this.props.size}) 
    return <MyComponent style={styles.toto} />
}
....

Copy link
Owner Author

Choose a reason for hiding this comment

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

let's compose all the things! I like this!

@guipasmoi
Copy link
Collaborator

you can change the name i am not happy with it

@@ -5,10 +5,10 @@ import Loading from "../components/technical/loading/Loading";
import Faulty from "../components/technical/faulty/Faulty";
import { isFaulty, isLoading, getDefect } from "../dataDefinitions/defects";

export default test => WrappedComponent => {
export default entities => WrappedComponent => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

getEntitiesToTest

Copy link
Owner Author

Choose a reason for hiding this comment

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

Bof bof!

import ClubFeed from "./clubFeed/ClubFeed";
import PerformanceMeter from "./performanceMeter/PerformanceMeter";
import RacePredictor from "./race/Race";
import PerformanceMeter from "./athletePerformanceLevel/AthletePerformanceLevel";
Copy link
Collaborator

Choose a reason for hiding this comment

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

:smile

Copy link
Owner Author

Choose a reason for hiding this comment

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

Oops! Half done!!

@@ -37,4 +37,4 @@ class PerformanceMeter extends Component {
export default compose(
enhanceWithValidEntities(({ athlete }) => [athlete]),
connect(selector)
Copy link
Collaborator

Choose a reason for hiding this comment

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

change the selector to select progress

Copy link
Owner Author

@totorototo totorototo Oct 4, 2017

Choose a reason for hiding this comment

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

dinno wha you wanna talk?
move performance stuff into slelector?
I would rather use optional chaining in component!

Copy link
Collaborator

Choose a reason for hiding this comment

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

L 28

this.props.athlete.performance
               ? this.props.athlete.performance.value		        
               : NaN		              

should be inside the selector

or moved inside progress

@@ -37,4 +37,4 @@ class PerformanceMeter extends Component {
export default compose(
enhanceWithValidEntities(({ athlete }) => [athlete]),
connect(selector)
Copy link
Collaborator

Choose a reason for hiding this comment

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

L 28

this.props.athlete.performance
               ? this.props.athlete.performance.value		        
               : NaN		              

should be inside the selector

or moved inside progress

@@ -2,32 +2,32 @@ import React from "react";
import { TabNavigator } from "react-navigation";
import { Icon } from "react-native-elements";

import Details from "./athleteDetails/AthleteDetails";
import AthleteDetails from "./athleteDetails/AthleteDetails";
Copy link
Collaborator

Choose a reason for hiding this comment

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

😄

import ClubFeed from "./clubFeed/ClubFeed";
import PerformanceMeter from "./athletePerformanceLevel/AthletePerformanceLevel";
import RacePredictor from "./clubEvents/ClubEvents";
import AthletePerformanceLevel from "./athletePerformanceLevel/AthletePerformanceLevel";
Copy link
Collaborator

Choose a reason for hiding this comment

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

😄

import PerformanceMeter from "./athletePerformanceLevel/AthletePerformanceLevel";
import RacePredictor from "./clubEvents/ClubEvents";
import AthletePerformanceLevel from "./athletePerformanceLevel/AthletePerformanceLevel";
import ClubEvents from "./clubEvents/ClubEvents";
Copy link
Collaborator

Choose a reason for hiding this comment

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

:smile

import theme from "../../theme/theme";

const Main = TabNavigator(
{
PerformanceMeter: {
screen: PerformanceMeter,
AthletePerformanceLevel: {
Copy link
Collaborator

Choose a reason for hiding this comment

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

may be we should write here
[AthletePerformanceLevel.name] : {

Copy link
Owner Author

Choose a reason for hiding this comment

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

I don't get your point!

@totorototo totorototo merged commit c720645 into master Oct 7, 2017
@totorototo totorototo deleted the fix/refacto branch October 7, 2017 16:14
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.

2 participants