feat(pages): add /application/[guildId]/[channelId]
(#4)
This commit is contained in:
15
components/Emoji/EmojiPicker/EmojiPicker.stories.tsx
Normal file
15
components/Emoji/EmojiPicker/EmojiPicker.stories.tsx
Normal file
@ -0,0 +1,15 @@
|
||||
import { Meta, Story } from '@storybook/react'
|
||||
|
||||
import { EmojiPicker as Component, EmojiPickerProps } from './EmojiPicker'
|
||||
|
||||
const Stories: Meta = {
|
||||
title: 'EmojiPicker',
|
||||
component: Component
|
||||
}
|
||||
|
||||
export default Stories
|
||||
|
||||
export const EmojiPicker: Story<EmojiPickerProps> = (arguments_) => {
|
||||
return <Component {...arguments_} />
|
||||
}
|
||||
EmojiPicker.args = { onClick: (emoji, event) => console.log(emoji, event) }
|
28
components/Emoji/EmojiPicker/EmojiPicker.tsx
Normal file
28
components/Emoji/EmojiPicker/EmojiPicker.tsx
Normal file
@ -0,0 +1,28 @@
|
||||
import 'emoji-mart/css/emoji-mart.css'
|
||||
import { EmojiData, Picker } from 'emoji-mart'
|
||||
import { useTheme } from 'next-themes'
|
||||
|
||||
import { EMOJI_SET } from '../emojiPlugin'
|
||||
|
||||
export type EmojiPickerOnClick = (
|
||||
emoji: EmojiData,
|
||||
event: React.MouseEvent<HTMLElement, MouseEvent>
|
||||
) => void
|
||||
|
||||
export interface EmojiPickerProps {
|
||||
onClick?: EmojiPickerOnClick
|
||||
}
|
||||
|
||||
export const EmojiPicker: React.FC<EmojiPickerProps> = (props) => {
|
||||
const { theme } = useTheme()
|
||||
|
||||
return (
|
||||
<Picker
|
||||
set={EMOJI_SET}
|
||||
theme={theme as 'light' | 'dark' | 'auto'}
|
||||
onClick={props.onClick}
|
||||
showPreview={false}
|
||||
showSkinTones={false}
|
||||
/>
|
||||
)
|
||||
}
|
1
components/Emoji/EmojiPicker/index.ts
Normal file
1
components/Emoji/EmojiPicker/index.ts
Normal file
@ -0,0 +1 @@
|
||||
export * from './EmojiPicker'
|
Reference in New Issue
Block a user