chore: Move editor into codebase (#2930)
This commit is contained in:
35
app/editor/components/EmojiMenuItem.tsx
Normal file
35
app/editor/components/EmojiMenuItem.tsx
Normal file
@@ -0,0 +1,35 @@
|
||||
import * as React from "react";
|
||||
import styled from "styled-components";
|
||||
import BlockMenuItem, { Props as BlockMenuItemProps } from "./BlockMenuItem";
|
||||
|
||||
const Emoji = styled.span`
|
||||
font-size: 16px;
|
||||
`;
|
||||
|
||||
type Props = {
|
||||
emoji: React.ReactNode;
|
||||
title: React.ReactNode;
|
||||
};
|
||||
|
||||
const EmojiTitle = ({ emoji, title }: Props) => {
|
||||
return (
|
||||
<p>
|
||||
<Emoji className="emoji">{emoji}</Emoji>
|
||||
|
||||
{title}
|
||||
</p>
|
||||
);
|
||||
};
|
||||
|
||||
type EmojiMenuItemProps = Omit<BlockMenuItemProps, "shortcut" | "theme"> & {
|
||||
emoji: string;
|
||||
};
|
||||
|
||||
export default function EmojiMenuItem(props: EmojiMenuItemProps) {
|
||||
return (
|
||||
<BlockMenuItem
|
||||
{...props}
|
||||
title={<EmojiTitle emoji={props.emoji} title={props.title} />}
|
||||
/>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user