another-portfolio icon indicating copy to clipboard operation
another-portfolio copied to clipboard

Wrong default work experience selected

Open harshgoel05 opened this issue 3 years ago • 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

harshgoel05 avatar Oct 01 '21 05:10 harshgoel05

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

dulcetsoul avatar Oct 01 '21 14:10 dulcetsoul

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 avatar Oct 01 '21 15:10 harshgoel05

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 avatar Oct 01 '21 15:10 harshgoel05

@dulcetsoul Still working?

harshgoel05 avatar Oct 02 '21 11:10 harshgoel05

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

GaushJ avatar Oct 03 '21 14:10 GaushJ

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

harshgoel05 avatar Oct 03 '21 14:10 harshgoel05

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

GaushJ avatar Oct 03 '21 18:10 GaushJ

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

harshgoel05 avatar Oct 03 '21 18:10 harshgoel05

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 avatar Oct 03 '21 18:10 GaushJ

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

GaushJ avatar Oct 04 '21 14:10 GaushJ

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 https://github.com/harshgoel05/another-portfolio/issues/90#issuecomment-932342298 @GaushJ

harshgoel05 avatar Oct 09 '21 14:10 harshgoel05

This is still up for anyone to take over!

harshgoel05 avatar Oct 19 '21 16:10 harshgoel05

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

rahul-ghimire-au6 avatar Apr 09 '23 16:04 rahul-ghimire-au6

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

harshgoel05 avatar Apr 10 '23 08:04 harshgoel05