Changed from Show to Switch & Match
This commit is contained in:
parent
f1efb38dd4
commit
50c7943b42
2 changed files with 44 additions and 23 deletions
|
|
@ -1,21 +1,31 @@
|
|||
import { Show, type JSX } from 'solid-js'
|
||||
import './Card.sass'
|
||||
import { Switch, Match } from 'solid-js'
|
||||
import { RiSystemLockPasswordLine } from 'solid-icons/ri'
|
||||
import { FiHash } from 'solid-icons/fi'
|
||||
import { TbColorSwatch } from 'solid-icons/tb'
|
||||
import { BiRegularGitCompare } from 'solid-icons/bi'
|
||||
|
||||
export default (props: { title: string; description: string }) => {
|
||||
return (
|
||||
<section class="card">
|
||||
<Show when={props.title === 'Password Generator'}>
|
||||
<RiSystemLockPasswordLine class="card__icon" size={32} opacity={0.5} />
|
||||
</Show>
|
||||
<Show when={props.title === 'Hash Generator'}>
|
||||
<FiHash class="card__icon" size={32} opacity={0.5} />
|
||||
</Show>
|
||||
<Show when={props.title === 'Color Converter'}>
|
||||
<TbColorSwatch class="card__icon" size={32} opacity={0.5} />
|
||||
</Show>
|
||||
<Switch>
|
||||
<Match when={props.title === 'Password Generator'}>
|
||||
<RiSystemLockPasswordLine class="card__icon" size={32} opacity={0.5} />
|
||||
</Match>
|
||||
|
||||
<Match when={props.title === 'Hash Generator'}>
|
||||
<FiHash class="card__icon" size={32} opacity={0.5} />
|
||||
</Match>
|
||||
|
||||
<Match when={props.title === 'Color Converter'}>
|
||||
<TbColorSwatch class="card__icon" size={32} opacity={0.5} />
|
||||
</Match>
|
||||
|
||||
<Match when={props.title === 'Text Comparison'}>
|
||||
<BiRegularGitCompare class="card__icon" size={32} opacity={0.5} />
|
||||
</Match>
|
||||
|
||||
</Switch>
|
||||
<h3 class="card__title">{props.title}</h3>
|
||||
<p class="card__description">{props.description}</p>
|
||||
</section>
|
||||
|
|
|
|||
|
|
@ -1,25 +1,36 @@
|
|||
import './PageTitle.sass'
|
||||
import { Show } from 'solid-js'
|
||||
import { Switch, Match } from 'solid-js'
|
||||
import { RiSystemLockPasswordLine } from 'solid-icons/ri'
|
||||
import { FiHash } from 'solid-icons/fi'
|
||||
import { Si1password } from 'solid-icons/si'
|
||||
import { TbColorSwatch } from 'solid-icons/tb'
|
||||
import { BiRegularGitCompare } from 'solid-icons/bi'
|
||||
|
||||
export default (props: { title: string; description: string }) => {
|
||||
return (
|
||||
<section class="title">
|
||||
<Show when={props.title === 'Password Generator'}>
|
||||
<RiSystemLockPasswordLine class="title__icon" opacity={1} />
|
||||
</Show>
|
||||
<Show when={props.title === 'Hash Generator'}>
|
||||
<FiHash class="title__icon" opacity={1} />
|
||||
</Show>
|
||||
<Show when={props.title === 'Password Manager'}>
|
||||
<Si1password class="title__icon" opacity={1} />
|
||||
</Show>
|
||||
<Show when={props.title === 'Color Converter'}>
|
||||
<TbColorSwatch class="title__icon" opacity={1} />
|
||||
</Show>
|
||||
<Switch>
|
||||
<Match when={props.title === 'Password Generator'}>
|
||||
<RiSystemLockPasswordLine class="title__icon" opacity={1} />
|
||||
</Match>
|
||||
|
||||
<Match when={props.title === 'Hash Generator'}>
|
||||
<FiHash class="title__icon" opacity={1} />
|
||||
</Match>
|
||||
|
||||
<Match when={props.title === 'Password Manager'}>
|
||||
<Si1password class="title__icon" opacity={1} />
|
||||
</Match>
|
||||
|
||||
<Match when={props.title === 'Color Converter'}>
|
||||
<TbColorSwatch class="title__icon" opacity={1} />
|
||||
</Match>
|
||||
|
||||
<Match when={props.title === 'Text Comparison'}>
|
||||
<BiRegularGitCompare class="title__icon" opacity={1} />
|
||||
</Match>
|
||||
</Switch>
|
||||
|
||||
<h1 class="title__text">{props.title}</h1>
|
||||
<p class="title__description">{props.description}</p>
|
||||
</section>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue