-
Notifications
You must be signed in to change notification settings - Fork 1
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
Master React, Quick Code tutorial. Part 3 #5
Comments
tutorial 3 is finished |
Things I learned: . importing and exporting javascript classes |
Can you tell - how do you think, that system with month, week, days - can be improved? Btw, as you learn about |
. I thought about having two two different arrays, one to store months and the other to store days. This way we can iterate through months one at a time and just use the days array to link days to each month.
No actually, but I assumed that it would a better way to pass variables between classes, than to use render |
@atherdon Can you explain to me what are the repeating functionalities in my html? |
@smob123 yeah, i tried to make your live less easier :) but it's cool for growing skills. not sure about this function. but if you want to manipulate arrays - i assume you should use |
lol, and I was wondering about this requirement, you got me there. My function merges the elements of the month and week arrays, and then adds them to the dates array. Then, I loop through them in another function to link each month with the seven days. If you still recommend me to use underscore instead, then I should be able to do that as well. |
no if you merged two of this arrays - and it works well - using underscore
is not necessary. this library is just a set of functions that doing the
same things, but with more easy ways. so it's upon your choice.
|
it's been 18 years, but at last, the calendar layout has finally been fixed! |
is there anything else I should improve in this tutorial? |
@smob123 does that thing with arrays works now? |
and i assume |
just fixed the html, and put all files in the data folder |
hold on, you get me wrong. i'll make some changes on your repo right now
|
I pushed some changes. please take a look. for sure - it broke the project. you'll need to update path of imported files |
I changed the imports, it works now |
is this completed?
I saw that you created some components related to each slide, but not sure if this task completed too |
yes, the merging code is on the image I provided you here on Friday.
The code I wrote was supposed to take out the repeated parts of the html and put them in one component, so they would not have to be rewritten every time someone wants to implement a new feature. If you have any suggestions on how I should implement them differently, please let me know. |
can you share with be exact codeline link for both of tasks
|
ok, feature component good, but can you also move into component image too onboarding-features/src/components/Template.js Lines 30 to 43 in c6d163d
calendar good. thanks for the clarification. |
Done |
I think there some misunderstanding. I mean you can add an img to your component.
will be generated. same when you pass only text - you'll get an empty generated img tag. btw, i like how much changes with did with your code - good progress :) |
I just uploaded the changes |
@smob123 ok so the last thing we need is to pass static data from feature+feature image into one array. |
onboarding-features/src/components/Template.js Lines 10 to 27 in 2e86bfd
just created a new method that should solve this issue |
it's something strange.. i mean we don't need so complex method for this. |
https://github.com/GroceriStar/onboarding-features/blob/master/src/components/Feature.js https://github.com/GroceriStar/onboarding-features/blob/master/src/components/FeatureImage.js Do you mean these two files? Besides I had to do it that way, because each image has a bunch of divs wrapping them, and each div has a unique className, like this piece of code: onboarding-features/src/components/Template.js Lines 52 to 58 in 2e86bfd
|
No, check it again
so, |
Do you mean that I should create a new component file to return images? Because I already have one. or do you want me to create another component that returns images, and descriptions? Because in this case, I am not sure how I could add images separately inside their respective divs |
no you need to create a js array. at separated file.
elements of this array will be text/link to images, etc.
and when you'll run a loop for displaying list of features - you'll get
data from that array - and put it into your components.
like a = [
'feature 1',
'awesome feature, try it',
'feature 2'....
]
_.each(array,()={
})
something like this...
On 30-Apr-2018 at 10:25 PM, smob123 wrote:
Do you mean that I should create a new component file to return images?
Because I already have one.
or do you want me to create another component that returns images, and
descriptions?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABZrDnVVdrIqbAlbV4I-_qfvOupx-vo9ks5tt492gaJpZM4TiUdr>
.
|
yep, but array must be stored at different file. |
I pushed some changes, please take a look and make your logic works with it |
@smob123 i assume we can close this task? and you can move to the next chapters |
trying to find time and get acutally back to you. sorry for this waitng |
No worries, take as much time as you need time |
@smob123 tell me about your progress here. I'm not sure that i remember where we are with you. Btw, I saw that you setup your website. Do you need my help? |
For this part, I created a simple calendar template, but I used innerHTML to add repeated code rather than storing it in an array. I just rechecked it, and I think the template isn't exactly as it should be at the moment, because every month starts on Monday, and ends on Wednesday, and all months have 31 days, so that should be optimized as well. |
@smob123 yeah, i think you should make it more flexible, so it can work fine for each month of the year. the easiest way to do it - it's just generate a whole 2018 calendar and see how it'll be displayed inside your component. and if it'll work wrong - update it |
https://medium.com/quick-code/lets-learn-react-chapter-3-components-components-components-3492f771d623
Expected result
Test
with ability(method) - to grab only work days, and other method for weekends?
First step. React from tutorial [Main task] #2
The text was updated successfully, but these errors were encountered: