generated from kurone-kito/vpm-project-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(node:web): implemented the explore page
- Loading branch information
1 parent
649cb01
commit 9448b7e
Showing
5 changed files
with
74 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,57 @@ | ||
import * as icons from '@kurone-kito/launchpad-icons-solid'; | ||
import type { Component } from 'solid-js'; | ||
import { For, onMount } from 'solid-js'; | ||
import { themeChange } from 'theme-change'; | ||
import { Head } from '../../components/atoms/Head.js'; | ||
import { IconItem } from '../../components/atoms/IconItem.js'; | ||
import { DefaultTemplate } from '../../components/templates/DefaultTemplate.jsx'; | ||
import Constants from '../../constants.yml'; | ||
import { useTranslator } from '../../modules/createI18N.js'; | ||
|
||
const getKeys = <T extends { [key: string]: unknown }>(obj: T): (keyof T)[] => | ||
Object.keys(obj); | ||
|
||
const iconNames = getKeys(icons.iconsMapping); | ||
const iconsLength = iconNames.length; | ||
const newList = Constants['newList'] as readonly string[]; | ||
|
||
/** | ||
* The explore page. | ||
* @returns The component. | ||
*/ | ||
const Explore: Component = () => ( | ||
<article class="article-container"> | ||
<h2>Explore page</h2> | ||
<p>TODO: Add the content here.</p> | ||
</article> | ||
); | ||
const Explore: Component = () => { | ||
onMount(() => themeChange(false)); | ||
const t = useTranslator(); | ||
return ( | ||
<DefaultTemplate> | ||
<article class="article-container"> | ||
<Head next="./pricing" prev="./explore" title={t('exploreTitle')} /> | ||
<h2 class="heading-root pt-10">{t('exploreTitle')}</h2> | ||
<p | ||
class="[&_marker]:border-accent py-4 text-lg font-light [&_marker]:rounded-md [&_marker]:border-2 [&_marker]:p-0.5 [&_strong]:font-extrabold" | ||
innerHTML={t('exploreDescription', { num: iconsLength })} | ||
/> | ||
<div | ||
class="grid grid-cols-3 gap-x-2 gap-y-2 py-4 sm:grid-cols-4 md:grid-cols-5 lg:grid-cols-6 lg:gap-x-4 xl:grid-cols-7 2xl:grid-cols-9" | ||
role="list" | ||
> | ||
<For each={iconNames}> | ||
{(icon) => { | ||
const Icon = icons[icon]; | ||
return ( | ||
<IconItem | ||
name={icons.iconsMapping[icon]} | ||
new={newList.includes(icon)} | ||
> | ||
<Icon class="h-full w-full" /> | ||
</IconItem> | ||
); | ||
}} | ||
</For> | ||
</div> | ||
</article> | ||
</DefaultTemplate> | ||
); | ||
}; | ||
|
||
export default Explore; |