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

renderer Method re-ogranization. Refactoring #50

Open
atherdon opened this issue Oct 20, 2018 · 10 comments
Open

renderer Method re-ogranization. Refactoring #50

atherdon opened this issue Oct 20, 2018 · 10 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@atherdon
Copy link
Member

atherdon commented Oct 20, 2018

  1. it has a strange name too :)

Our main goal here - to discuss how we can improve this function.
But firstly - please explain what exactly this function doing and why we put there a lot of data...

link to our chat: #48 (comment)

First of all - i can guess that this function is heavy - so the easiest way - to split it into a few functions. Second thing - we have a 3 params, and they are long. i mean - i can bet that we have a lot of similar data inside this params. let's make this a separated task.

@vadim9999
Copy link
Contributor

vadim9999 commented Oct 20, 2018

@atherdon I think we can creacte a class that will contains mathods from Method.js. And creacte some setters to give data in class.

@atherdon
Copy link
Member Author

ok, but i want to have here more details. like a step-by-step plan about how it can be improved. Not sure if'm 100% ok with idea of making class, but let's explore that way anyway...

@atherdon atherdon changed the title renderer renderer Method re-ogranization. Refactoring Oct 20, 2018
@atherdon atherdon added enhancement New feature or request help wanted Extra attention is needed labels Oct 20, 2018
@vadim9999
Copy link
Contributor

vadim9999 commented Oct 21, 2018

We can add in dishByDay array with ingredients

@atherdon
Copy link
Member Author

i should have more details.
i'm not very into this project. so i'm don't have clear understanding what exactly that methods doing. Please give more details, with codelinks maybe

@vadim9999
Copy link
Contributor

vadim9999 commented Oct 21, 2018

method renderFunc() render a dish in one day and display modal with ingredients when you will click on a tile. Component ColumnRender specify what day should display renderFunc

@atherdon
Copy link
Member Author

atherdon commented Oct 21, 2018 via email

@vadim9999
Copy link
Contributor

We have 5 modules

@atherdon
Copy link
Member Author

atherdon commented Oct 21, 2018 via email

@vadim9999
Copy link
Contributor

rendererFunc() {
    let buffer = this.getOffset(this.state.dishByDay);

function getOffset calculate and return object with position for one column. (in code it's buffer)
For example in buffer

height: 150
start: 600
tag: "dinner"
text: "Tilapia with Corn on the Cob, Couscous and Pears"
time: "18:00-19:30"

Next create Modals that have ingredients

return <Modals mode={this.state.mode} data={buffer[j - 1]} key={item} ingredient={this.state.ingredient}/>;

In Modals we give name of meal, time, and ingredients. Modals is a tile. When you click it, open form with ingredients. In this way 5 tiles are 5 Modals in calendar.

@atherdon
Copy link
Member Author

atherdon commented Oct 22, 2018 via email

@atherdon atherdon added this to the Working Calendar milestone Oct 29, 2018
@atherdon atherdon mentioned this issue Nov 4, 2018
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants