feat(directory): add icon before name in fast navigation

This commit is contained in:
Haoyu Xu
2023-06-24 06:07:12 -04:00
parent 577aa8d7c1
commit b0a46ac838
4 changed files with 26 additions and 2 deletions

View File

@@ -1 +1 @@
1.2.15 1.2.16

View File

@@ -56,6 +56,13 @@ export default function Dropdown(props) {
toggleDropdown() toggleDropdown()
}} }}
> >
{
item.icon ? (
<section className={classes.item_icon}>
{item.icon}
</section>
) : null
}
<section className={classes.text}>{item.name}</section> <section className={classes.text}>{item.name}</section>
</li> </li>
) )

View File

@@ -111,6 +111,18 @@
padding: 0.5rem; padding: 0.5rem;
font-size: 1rem; font-size: 1rem;
transition: color cubic-bezier(0.65, 0.05, 0.36, 1) 0.3s; transition: color cubic-bezier(0.65, 0.05, 0.36, 1) 0.3s;
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
flex-wrap: nowrap;
.item_icon {
height: inherit;
width: 1rem;
fill: var(--text-color);
margin-right: 0.5rem;
}
&:hover, &:hover,
&:focus, &:focus,

View File

@@ -102,6 +102,11 @@ export default function Home() {
name: item.codename[language], name: item.codename[language],
value: item.link, value: item.link,
type: "item", type: "item",
icon: <CharIcon
type={item.type}
viewBox={
item.type === 'operator' ? '0 0 88.969 71.469' : '0 0 94.563 67.437'
} />
}) })
}) })
} }