-
-
Notifications
You must be signed in to change notification settings - Fork 432
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use pencil off icon for note bar
- Loading branch information
Antonella Sgarlatta
committed
May 3, 2021
1 parent
c48cc9d
commit 15db476
Showing
6 changed files
with
85 additions
and
48 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,46 @@ | ||
import PencilOffIcon from '../../icons/ic-pencil-off.svg'; | ||
import RichTextIcon from '../../icons/ic-text-rich.svg'; | ||
import TrashIcon from '../../icons/ic-trash.svg'; | ||
import PinIcon from '../../icons/ic-pin.svg'; | ||
import UnpinIcon from '../../icons/ic-pin-off.svg'; | ||
import ArchiveIcon from '../../icons/ic-archive.svg'; | ||
import UnarchiveIcon from '../../icons/ic-unarchive.svg'; | ||
import { toDirective } from './utils'; | ||
|
||
export enum IconType { | ||
PencilOff = 'pencil-off', | ||
RichText = 'rich-text', | ||
Trash = 'trash', | ||
Pin = 'pin', | ||
Unpin = 'unpin', | ||
Archive = 'archive', | ||
Unarchive = 'unarchive' | ||
} | ||
|
||
const ICONS = { | ||
[IconType.PencilOff]: PencilOffIcon, | ||
[IconType.RichText]: RichTextIcon, | ||
[IconType.Trash]: TrashIcon, | ||
[IconType.Pin]: PinIcon, | ||
[IconType.Unpin]: UnpinIcon, | ||
[IconType.Archive]: ArchiveIcon, | ||
[IconType.Unarchive]: UnarchiveIcon | ||
}; | ||
|
||
type Props = { | ||
type: IconType; | ||
className: string; | ||
} | ||
|
||
export const Icon: React.FC<Props> = ({ type, className }) => { | ||
const IconComponent = ICONS[type]; | ||
return type ? <IconComponent className={className} /> : null; | ||
}; | ||
|
||
export const IconDirective = toDirective<Props>( | ||
Icon, | ||
{ | ||
type: '@', | ||
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
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
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