Skip to content

Commit

Permalink
refactor: change sponsors styling
Browse files Browse the repository at this point in the history
The categories was not clear with the previous distribution
  • Loading branch information
ferferga committed Oct 13, 2024
1 parent b2e7f9d commit 0092e0a
Showing 1 changed file with 34 additions and 33 deletions.
67 changes: 34 additions & 33 deletions src/components/ui/Sponsors.astro
Original file line number Diff line number Diff line change
@@ -1,44 +1,45 @@
---
import Brands from '@/components/widgets/Brands.astro';
import { sponsors } from '@/data/sponsors';
import WidgetWrapper from '@/components/ui/WidgetWrapper.astro';
interface Props {
showEmpty?: boolean;
}
const { showEmpty = false } = Astro.props;
---
<table class="w-full">
<tbody>
{sponsors.map((s) => {
const innerText = (
<td class="py-10">
<b class="text-muted">
{s.category}:
</b>
</td>
);

const innerBrands = s.brands.length
? (
<td>
<Brands images={s.brands} />
</td>
)
: (
<td>
<p class="text-center">There are no sponsors in this category yet</p>
</td>
);
<div class="py-6">
{sponsors.map((s) => {
const innerText = (
<h3 class="text-center font-medium uppercase tracking-widest">
{s.category}
</h3>
);

if (!s.brands.length && !showEmpty) {
return (<></>);
} else {
return (
<tr>
{innerText}
{innerBrands}
</tr>
const innerBrands = s.brands.length
? (
<Brands
images={s.brands}
classes={{
container: '!py-4'
}} />
)
: (
<WidgetWrapper containerClass="!py-4">
<p class="text-center text-muted">There are no sponsors in this category yet</p>
</WidgetWrapper>
);
}
})}
</tbody>
</table>

if (!s.brands.length && !showEmpty) {
return (<></>);
} else {
return (
<>
{innerText}
{innerBrands}
</>
);
}
})}
</div>

0 comments on commit 0092e0a

Please sign in to comment.