Skip to content

Commit

Permalink
fix: activeTab was delivering invalid value at runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
SebConejo committed Dec 13, 2024
1 parent bfff692 commit ab8f60e
Showing 1 changed file with 20 additions and 16 deletions.
36 changes: 20 additions & 16 deletions src/app/components/LiveCodeHero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -278,22 +278,26 @@ entities:
</SyntaxHighlighter>
</div>
<div className="buttons buttons--demo">
<a
className="button is-small is-light is-outlined"
href={tabs[activeTab].demoUrl}
target="_blank"
>
<i className="fa-solid fa-table-columns mr-2"></i>
<span>Admin panel live demo</span>
</a>
<a
className="button is-small is-light is-outlined"
href={tabs[activeTab].demoUrl + '/api'}
target="_blank"
>
<i className="fa-solid fa-cloud-arrow-down mr-2"></i>
<span>REST API doc</span>
</a>
{tabs[activeTab] && ( // Vérifie que tabs[activeTab] n'est pas undefined
<>
<a
className="button is-small is-light is-outlined"
href={tabs[activeTab].demoUrl}
target="_blank"
>
<i className="fa-solid fa-table-columns mr-2"></i>
<span>Admin panel live demo</span>
</a>
<a
className="button is-small is-light is-outlined"
href={`${tabs[activeTab].demoUrl}/api`}
target="_blank"
>
<i className="fa-solid fa-cloud-arrow-down mr-2"></i>
<span>REST API doc</span>
</a>
</>
)}
</div>
</div>
</div>
Expand Down

0 comments on commit ab8f60e

Please sign in to comment.