Skip to content

Commit

Permalink
refactor: dropdown social links menu
Browse files Browse the repository at this point in the history
  • Loading branch information
bzenky committed Feb 15, 2023
1 parent 2803ffd commit fda3bd6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,12 @@ import {
Linkedin,
Rocket,
Twitter,
User,
Youtube
} from 'lucide-react'
import { MenuButton } from './MenuButton'

interface DropdownProps {
children: React.ReactNode
}

export function Dropdown({
children
}: DropdownProps) {
export function SocialLinksMenuButton() {
const socialLinks = [
{
name: 'github',
Expand Down Expand Up @@ -52,8 +48,8 @@ export function Dropdown({

return (
<DropdownMenu.Root>
<DropdownMenu.Trigger asChild>
{children}
<DropdownMenu.Trigger>
<MenuButton icon={User} />
</DropdownMenu.Trigger>

<DropdownMenu.Portal>
Expand Down
10 changes: 3 additions & 7 deletions src/components/Menu/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Bug, Cog, Files, FlaskConical, GitFork, Monitor, Puzzle, Search, User } from 'lucide-react'
import { Dropdown } from './Dropdown'
import { Bug, Cog, Files, FlaskConical, GitFork, Monitor, Puzzle, Search } from 'lucide-react'
import { MenuButton } from './MenuButton'
import { SocialLinksMenuButton } from './SocialLinksMenuButton'

export function Menu() {
return (
Expand All @@ -15,11 +15,7 @@ export function Menu() {
<MenuButton icon={FlaskConical} />
</div>
<div className="flex flex-col items-center">
<Dropdown>
<button type="button">
<MenuButton icon={User} />
</button>
</Dropdown>
<SocialLinksMenuButton />
<MenuButton icon={Cog} />
</div>
</div>
Expand Down

0 comments on commit fda3bd6

Please sign in to comment.