Skip to content

Commit

Permalink
combined map+if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
fardinzam committed Dec 29, 2023
1 parent 87b16dd commit 04fd706
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions src/components/dynamic/admin/services/judging/Table.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,18 @@ const Table = ({ data }) => {
<Tag color={COLORS["grayblue"]} text={name} />
<div className="flex justify-start w-full ml-2">
{links &&
links.map((link, index) => {
if (link.link != "") {
return (
<Link
key={index}
href={link.link}
target="_blank"
className="m-0 p-0 text-black no-underline hover:!text-hackathon-blue-100 text-xl"
>
{ICONS[link.name]}
</Link>
);
}
})}
links
.filter((l) => l.link.length)
.map((link, index) => (
<Link
key={index}
href={link.link}
target="_blank"
className="m-0 p-0 text-black no-underline hover:!text-hackathon-blue-100 text-xl"
>
{ICONS[link.name]}
</Link>
))}
</div>
{table && (
<p className="mb-0 text-hackathon-green-300 font-semibold whitespace-nowrap">
Expand Down

0 comments on commit 04fd706

Please sign in to comment.