-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0c2c788
commit 47ea6ba
Showing
5 changed files
with
75 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* This is icon aggregator, all icons from different libraries are imported here */ | ||
import { Pen, Pencil, Moon, Sun } from "lucide-react"; | ||
|
||
type IconType = "pen" | "pencil" | "moon" | "sun"; | ||
type IconSize = "small" | "medium"; | ||
|
||
const renderLucideIcon = ( | ||
icon: IconType, | ||
size: IconSize, | ||
className?: string | ||
) => { | ||
const fontSize = size === "medium" ? 24 : 12; | ||
switch (icon) { | ||
case "pen": | ||
return <Pen className={className} size={fontSize} />; | ||
case "pencil": | ||
return <Pencil className={className} size={fontSize} />; | ||
case "moon": | ||
return <Moon className={className} size={fontSize} />; | ||
case "sun": | ||
return <Sun className={className} size={fontSize} />; | ||
default: | ||
return null; | ||
} | ||
}; | ||
|
||
export const Icon = (props: { | ||
type: IconType; | ||
size: IconSize; | ||
className?: string; | ||
}) => { | ||
const { type, size, className } = props; | ||
return renderLucideIcon(type, size, className); | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export const PanelHeader = (props: { title: string }) => { | ||
const { title } = props; | ||
return ( | ||
<div> | ||
<h2>{title}</h2> | ||
</div> | ||
); | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { PanelHeader } from "./panelHeader"; | ||
import { Icon } from "../icon"; | ||
|
||
export const SelectToolPanel = () => { | ||
return ( | ||
<div> | ||
<PanelHeader title="Select Tool" /> | ||
<div> | ||
<Icon type="pen" size="medium" /> | ||
{/* <button>Pointer</button> | ||
<button>Marquee</button> | ||
<button>Lasso</button> */} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters