mirror of
https://github.com/remvze/moodist.git
synced 2025-12-17 00:44:14 +00:00
feat: turn links into buttons
This commit is contained in:
parent
b921629ee3
commit
d0160763ee
2 changed files with 37 additions and 28 deletions
|
|
@ -18,10 +18,6 @@
|
|||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
& a {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
|
||||
& .icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
|
@ -29,6 +25,8 @@
|
|||
width: 48px;
|
||||
height: 48px;
|
||||
font-size: var(--font-md);
|
||||
color: var(--color-foreground);
|
||||
cursor: pointer;
|
||||
background: linear-gradient(
|
||||
var(--color-neutral-50),
|
||||
var(--color-neutral-100)
|
||||
|
|
@ -46,5 +44,4 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,11 @@ import { Tooltip } from '@/components/tooltip';
|
|||
export default function CategoryIcons() {
|
||||
const categories = useMemo(() => sounds.categories, []);
|
||||
|
||||
const goto = (id: string) => {
|
||||
const category = document.getElementById(`category-${id}`);
|
||||
category?.scrollIntoView();
|
||||
};
|
||||
|
||||
return (
|
||||
<Container>
|
||||
<div className={styles.wrapper}>
|
||||
|
|
@ -15,11 +20,18 @@ export default function CategoryIcons() {
|
|||
<Tooltip.Provider delayDuration={0}>
|
||||
{categories.map(category => {
|
||||
return (
|
||||
<a href={`#category-${category.id}`} key={category.id}>
|
||||
<Tooltip content={category.title} placement="bottom">
|
||||
<div className={styles.icon}>{category.icon}</div>
|
||||
<Tooltip
|
||||
content={category.title}
|
||||
key={category.id}
|
||||
placement="bottom"
|
||||
>
|
||||
<button
|
||||
className={styles.icon}
|
||||
onClick={() => goto(category.id)}
|
||||
>
|
||||
{category.icon}
|
||||
</button>
|
||||
</Tooltip>
|
||||
</a>
|
||||
);
|
||||
})}
|
||||
</Tooltip.Provider>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue