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

Wrong default work experience selected #90

Open
harshgoel05 opened this issue Oct 1, 2021 · 14 comments
Open

Wrong default work experience selected #90

harshgoel05 opened this issue Oct 1, 2021 · 14 comments
Labels
bug Something isn't working Hacktoberfest help-wanted Need someone to help with this!

Comments

@harshgoel05
Copy link
Owner

Describe the bug
The default work experience selected is not from the list of featured work experiences

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://harshgoel.me/work
  2. Scroll down to the end of page
  3. See an error

Expected behavior
The first 0th index should come up

Screenshots
image

@harshgoel05 harshgoel05 added bug Something isn't working Hacktoberfest help-wanted Need someone to help with this! labels Oct 1, 2021
@dulcetsoul
Copy link

I want to give this issue a try. Shall I?
As far I understood the issue, is with the number appearing behind the box. Please confirm me whether I understood it correct ? Thank you :)

@harshgoel05
Copy link
Owner Author

No, that's fine. If you see "Zoob Labs" isn't on the list but it's selected by default.

It's due to the API gives an array of objects which has a key called "featured", if featured: true it goes in the list. If not, it doesn't.

So, you just need to apply the same when showing it in the box/ set active state default in useState.

@dulcetsoul

@harshgoel05
Copy link
Owner Author

It will be in the line 54 in work/details.tsx

Consider these two lines:

activeCompany={companyDetails[activeIndex]}
 const [activeIndex, setActiveIndex] = useState(0);  

The default goes 0 in line 10 so changing this will work

@harshgoel05
Copy link
Owner Author

@dulcetsoul Still working?

@GaushJ
Copy link
Contributor

GaushJ commented Oct 3, 2021

Hey @harshgoel05 If this issue still persists . Can you assign this to me?

@harshgoel05
Copy link
Owner Author

Go ahead @GaushJ!
Also make sure you use gitmoji for commit messages.

@GaushJ
Copy link
Contributor

GaushJ commented Oct 3, 2021

Hey @harshgoel05 . I didn't clearly understand the problem you stated . Do you want your list to be started from 1 instead of 0?
Here's what I did.
sent

@harshgoel05
Copy link
Owner Author

harshgoel05 commented Oct 3, 2021

No, that was all right. You don't need to do that.
The issue is with sidebox.

@GaushJ
Copy link
Contributor

GaushJ commented Oct 3, 2021

Could you elaborate your problem ? what I learnt is that the API retrieves an array of objects and the condition checks if the company is featured . But the issue is with the order in which it retrieves . Am I right ?

@GaushJ
Copy link
Contributor

GaushJ commented Oct 4, 2021

Hey @harshgoel05 could you help me with the above issue?

@harshgoel05
Copy link
Owner Author

harshgoel05 commented Oct 9, 2021

The issue is simple, the condition checks if the company is featured . is not applicable for the box one, its hardcoded for 0th index as mentioned #90 (comment) @GaushJ

@harshgoel05
Copy link
Owner Author

This is still up for anyone to take over!

@rahul-ghimire-au6
Copy link

@harshgoel05 is this issue solved ?? if yes can you please close it?

@harshgoel05
Copy link
Owner Author

Oh yes! It's resolved it seems. thanks @rahul-ghimire-au6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Hacktoberfest help-wanted Need someone to help with this!
Projects
None yet
Development

No branches or pull requests

4 participants