feat: added other emojis

This commit is contained in:
Junseo Park 2021-02-24 13:16:05 +09:00
parent c469f88636
commit ef5fa5006a
5 changed files with 27 additions and 12 deletions

View File

@ -6,6 +6,7 @@ import { Picker } from 'emoji-mart'
import useOutsideClick from '@utils/useOutsideClick' import useOutsideClick from '@utils/useOutsideClick'
import 'emoji-mart/css/emoji-mart.css' import 'emoji-mart/css/emoji-mart.css'
import { KoreanbotsEmoji } from '@utils/Constants'
@ -40,13 +41,7 @@ const TextArea = ({ name, placeholder, theme='auto', setValue, value }:TextAreaP
flags: '국기', flags: '국기',
custom: '커스텀' custom: '커스텀'
} }
}} custom={[{ }} custom={KoreanbotsEmoji}/>
name: '한국 디스코드봇 리스트',
short_names: ['koreanbots', 'kbots', 'dbkr'],
emoticons: [],
keywords: ['koreanbots', '한국 디스코드봇 리스트', '한디리', 'kbots'],
imageUrl: '/logo.png'
}]}/>
} }
</div> </div>
<div className='absolute bottom-3 right-8'> <div className='absolute bottom-3 right-8'>

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

BIN
public/emojis/python.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

View File

@ -157,9 +157,28 @@ export const git = { 'github.com': { icon: 'github', text: 'Github' }, 'gitlab.
export const KoreanbotsDiscord = 'https://discord.gg/JEh53MQ' export const KoreanbotsDiscord = 'https://discord.gg/JEh53MQ'
export const ThemeColors = [{ name: '파랑', rgb: 'rgb(51, 102, 255)', hex: '#3366FF', color: 'koreanbots-blue' }, { name: '하양', rgb: 'rgb(251, 251, 251)', hex: '#FBFBFB', color: 'little-white' }, { name: '검정', rgb: 'rgb(27, 30, 35)', hex: '#1B1E23', color: 'very-black' }, { name: '보라', rgb: 'rgb(114, 137, 218)', hex: '#7289DA', color: 'discord-blurple' } ] export const ThemeColors = [{ name: '파랑', rgb: 'rgb(51, 102, 255)', hex: '#3366FF', color: 'koreanbots-blue' }, { name: '하양', rgb: 'rgb(251, 251, 251)', hex: '#FBFBFB', color: 'little-white' }, { name: '검정', rgb: 'rgb(27, 30, 35)', hex: '#1B1E23', color: 'very-black' }, { name: '보라', rgb: 'rgb(114, 137, 218)', hex: '#7289DA', color: 'discord-blurple' } ]
export const KoreanbotsEmoji = { export const KoreanbotsEmoji = [{
koreanbots: '/logo.png' name: '한국 디스코드봇 리스트',
} short_names: ['koreanbots', 'kbots', 'dbkr'],
emoticons: [],
keywords: ['koreanbots', '한국 디스코드봇 리스트', '한디리', 'kbots'],
imageUrl: '/logo.png'
},
{
name: 'Javascript',
short_names: ['javascript', 'js'],
emoticons: [],
keywords: ['javascript', 'js', '자바스크립트'],
imageUrl: '/emojis/javascript.png'
},
{
name: 'Python',
short_names: ['python', 'py'],
emoticons: [],
keywords: ['python', 'py', '파이썬'],
imageUrl: '/emojis/python.png'
}]
export const ErrorText = { export const ErrorText = {
DEFAULT: '예상치 못한 에러가 발생하였습니다.', DEFAULT: '예상치 못한 에러가 발생하였습니다.',
200: '문제가 없는데 여기를 어떻게 오셨죠?', 200: '문제가 없는데 여기를 어떻게 오셨죠?',

View File

@ -35,7 +35,8 @@ export const customEmoji = {
type: 'output', type: 'output',
regex: EmojiSyntax, regex: EmojiSyntax,
replace: function(__match: string, name: string) { replace: function(__match: string, name: string) {
if(!name || !KoreanbotsEmoji[name]) return `:${name}:` const result = KoreanbotsEmoji.find(el => el.short_names.includes(name))
return `<img class="emoji special" draggable="false" alt="${name}" src="${KoreanbotsEmoji[name]}"/>` if(!name || !result) return `:${name}:`
return `<img class="emoji special" draggable="false" alt="${name}" src="${result.imageUrl}"/>`
} }
} }