harshgoel05/another-portfolio

Wrong default work experience selected

Opened this issue · 14 comments

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

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 :)

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

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

@dulcetsoul Still working?

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

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

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

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

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 ?

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

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

This is still up for anyone to take over!

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

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