mirror of
https://github.com/remvze/moodist.git
synced 2025-12-17 00:44:14 +00:00
style: add icon to menu items
This commit is contained in:
parent
0f62f0795c
commit
131ab29621
4 changed files with 22 additions and 7 deletions
|
|
@ -1,11 +1,15 @@
|
|||
.item {
|
||||
position: flex;
|
||||
display: flex;
|
||||
column-gap: 8px;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
width: 100%;
|
||||
padding: 12px 8px;
|
||||
padding: 16px 12px;
|
||||
font-size: var(--font-sm);
|
||||
font-weight: 500;
|
||||
line-height: 1;
|
||||
color: var(--color-foreground-subtle);
|
||||
text-align: left;
|
||||
cursor: pointer;
|
||||
background-color: transparent;
|
||||
border: 1px solid var(--color-neutral-200);
|
||||
|
|
@ -17,4 +21,8 @@
|
|||
color: var(--color-foreground);
|
||||
background-color: var(--color-neutral-200);
|
||||
}
|
||||
|
||||
& .icon {
|
||||
color: var(--color-foreground);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,15 @@
|
|||
import styles from './item.module.css';
|
||||
|
||||
interface ItemProps {
|
||||
children: React.ReactNode;
|
||||
icon: React.ReactElement;
|
||||
label: string;
|
||||
onClick: () => void;
|
||||
}
|
||||
|
||||
export function Item({ children, onClick }: ItemProps) {
|
||||
export function Item({ icon, label, onClick }: ItemProps) {
|
||||
return (
|
||||
<button className={styles.item} onClick={onClick}>
|
||||
{children}
|
||||
<span className={styles.icon}>{icon}</span> {label}
|
||||
</button>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import { IoShareSocialSharp } from 'react-icons/io5/index';
|
||||
|
||||
import { Item } from '../item';
|
||||
|
||||
interface ShareProps {
|
||||
|
|
@ -5,5 +7,7 @@ interface ShareProps {
|
|||
}
|
||||
|
||||
export function Share({ open }: ShareProps) {
|
||||
return <Item onClick={open}>Share Sounds</Item>;
|
||||
return (
|
||||
<Item icon={<IoShareSocialSharp />} label="Share Sounds" onClick={open} />
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import { BiShuffle } from 'react-icons/bi/index';
|
||||
|
||||
import { useSoundStore } from '@/store';
|
||||
|
||||
import { Item } from '../item';
|
||||
|
|
@ -5,5 +7,5 @@ import { Item } from '../item';
|
|||
export function Shuffle() {
|
||||
const shuffle = useSoundStore(state => state.shuffle);
|
||||
|
||||
return <Item onClick={shuffle}>Shuffle Sounds</Item>;
|
||||
return <Item icon={<BiShuffle />} label="Shuffle Sounds" onClick={shuffle} />;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue