Skip to content

Commit

Permalink
improve list
Browse files Browse the repository at this point in the history
  • Loading branch information
ildyria committed Oct 15, 2024
1 parent 59c63e7 commit 55c65b0
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 7 deletions.
7 changes: 7 additions & 0 deletions src/components/ui/Tag.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
import { twMerge } from 'tailwind-merge';
const { tag = 'v6', classes = {} } = Astro.props;
---

<span class={twMerge("rounded-full text-xs text-white bg-sky-300 dark:text-neutral-300 dark:bg-sky-600 px-2 shadow-sm shadow-black/20 ml-2", classes)}>{ tag }</span>
7 changes: 4 additions & 3 deletions src/components/widgets/FeaturesList.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Headline from '~/components/ui/Headline.astro';
import WidgetWrapper from '~/components/ui/WidgetWrapper.astro';
import type { FeaturesList as Props } from '~/types';
import Tick from '../ui/Tick.astro';
import Tag from '../ui/Tag.astro';
const {
title = await Astro.slots.render('title'),
Expand Down Expand Up @@ -36,11 +37,11 @@ const {
</thead>
<tbody>
{
specs.map(({ feature, isHeader, values, available }) => (
<tr class={(isHeader && 'border-t border-neutral-200 dark:border-neutral-800 bg-neutral-50 dark:bg-neutral-800') || ''}>
specs.map(({ feature, isHeader, isV6, values, available }) => (
<tr class={(isHeader && ' bg-neutral-50 dark:bg-neutral-800') || ''}>
{isHeader && <td class="p-2 font-semibold"><Fragment set:html={feature} /></td>}
{isHeader && products.map(() => <td class="p-2 text-center" />)}
{!isHeader && <td class="px-2 text-muted"><Fragment set:html={feature} /></td> }
{!isHeader && <td class="px-2 text-muted"><Fragment set:html={feature} />{ isV6 && <Tag/> }</td> }
{!isHeader && values && (values.map((val) => <td class="px-2 text-muted text-center">{val}</td>))}
{!isHeader && available && available.map((yes) => <td class="px-2 text-muted text-center">{yes && <Tick />}</td>)}
</tr>
Expand Down
17 changes: 13 additions & 4 deletions src/pages/get-supporter-edition.astro
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ const metadata = {
{
feature: '<span class="text-black dark:text-neutral-400/50 font-bold">Dark</span> and <span class="text-neutral-500 dark:text-neutral-100 font-bold">Light</span> themes',
available: [true, true],
isV6: true,
},
{
feature: 'Unlimited photos upload',
Expand Down Expand Up @@ -154,8 +155,9 @@ const metadata = {
available: [true, true],
},
{
feature: 'Upload by chunks <span class="rounded-full text-xs text-white bg-sky-300 dark:text-neutral-300 dark:bg-sky-600 px-2 shadow-sm shadow-black/20">v6</span>',
feature: 'Upload by chunks',
available: [true, true],
isV6: true,
},
{
feature: 'Zip & download',
Expand Down Expand Up @@ -207,8 +209,9 @@ const metadata = {
available: [true, true],
},
{
feature: 'Slideshow with previous & next <span class="rounded-full text-xs text-white bg-sky-300 dark:text-neutral-300 dark:bg-sky-600 px-2 shadow-sm shadow-black/20">v6</span>',
feature: 'Slideshow with previous & next',
available: [true, true],
isV6: true,
},

{
Expand All @@ -228,12 +231,14 @@ const metadata = {
available: [true, true],
},
{
feature: 'Space usage per user <span class="rounded-full text-xs text-white bg-sky-300 dark:text-neutral-300 dark:bg-sky-600 px-2 shadow-sm shadow-black/20">v6</span>',
feature: 'Space usage per user',
available: [false, true],
isV6: true,
},
{
feature: 'Upload quota per user <span class="rounded-full text-xs text-white bg-sky-300 dark:text-neutral-300 dark:bg-sky-600 px-2 shadow-sm shadow-black/20">v6</span>',
feature: 'Upload quota per user',
available: [false, true],
isV6: true,
},

{
Expand All @@ -244,6 +249,10 @@ const metadata = {
feature: 'Landing page',
available: [true, true],
},
{
feature: 'Map view',
available: [true, true],
},
{
feature: 'RSS Feed',
available: [true, true],
Expand Down
1 change: 1 addition & 0 deletions src/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ export interface Features extends Omit<Headline, 'classes'>, Widget {
export interface Spec {
feature: string;
isHeader?: boolean;
isV6?: boolean;
values?: string[];
available?: boolean[];
}
Expand Down

0 comments on commit 55c65b0

Please sign in to comment.