Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion app/public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,9 @@
"emojiPackageURL": "Emoji package URL",
"packageNotFound": "Package not found",
"copied": "Copied",
"alreadyAdded": "Emoji pack already added"
"alreadyAdded": "Emoji pack already added",
"copyAll": "Copy all",
"copiedAll": "Copied all emoji package URLs"
},
"media": {
"title": "Media",
Expand Down
4 changes: 3 additions & 1 deletion app/public/locales/ja/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,9 @@
"emojiPackageURL": "絵文字パッケージURL",
"packageNotFound": "パッケージが見つかりませんでした",
"copied": "コピーしました",
"alreadyAdded": "すでに追加されています"
"alreadyAdded": "すでに追加されています",
"copyAll": "全部コピー",
"copiedAll": "全ての絵文字パッケージURLをコピーしました"
},
"media": {
"title": "メディア",
Expand Down
4 changes: 3 additions & 1 deletion app/public/locales/ko/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,9 @@
"emojiPackageURL": "이모지 팩 URL",
"packageNotFound": "팩을 찾을 수 없습니다.",
"copied": "복사됨",
"alreadyAdded": "이모지팩이 이미 추가되었습니다."
"alreadyAdded": "이모지팩이 이미 추가되었습니다.",
"copyAll": "전체 복사",
"copiedAll": "모든 이모지 팩 URL을 복사했습니다"
},
"media": {
"title": "미디어",
Expand Down
4 changes: 3 additions & 1 deletion app/public/locales/th/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@
"emojiPackageURL": "URL ของชุดอีโมจิ",
"packageNotFound": "ไม่พบชุดอีโมจิ",
"copied": "คัดลอกแล้ว",
"alreadyAdded": "ชุดอีโมจินี้ถูกเพิ่มแล้ว"
"alreadyAdded": "ชุดอีโมจินี้ถูกเพิ่มแล้ว",
"copyAll": "คัดลอกทั้งหมด",
"copiedAll": "คัดลอก URL ชุดอีโมจิทั้งหมดแล้ว"
},
"media": {
"title": "มีเดีย",
Expand Down
4 changes: 3 additions & 1 deletion app/public/locales/zh-Hans/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,9 @@
"emojiPackageURL": "表情包 URL",
"packageNotFound": "未找到表情包",
"copied": "已复制",
"alreadyAdded": "表情包已添加"
"alreadyAdded": "表情包已添加",
"copyAll": "全部复制",
"copiedAll": "已复制所有表情包 URL"
},
"media": {
"title": "媒体",
Expand Down
4 changes: 3 additions & 1 deletion app/public/locales/zh-Hant/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,9 @@
"emojiPackageURL": "表情符號包 URL",
"packageNotFound": "找不到表情符號包",
"copied": "已複製",
"alreadyAdded": "表情符號包已新增"
"alreadyAdded": "表情符號包已新增",
"copyAll": "全部複製",
"copiedAll": "已複製所有表情符號包 URL"
},
"media": {
"title": "媒體",
Expand Down
38 changes: 26 additions & 12 deletions app/src/components/Settings/Emoji.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { useLocation } from 'react-router-dom'

import { useTranslation } from 'react-i18next'
import { useEmojiPicker } from '../../context/EmojiPickerContext'
import { usePreference } from '../../context/PreferenceContext'

import DeleteForeverIcon from '@mui/icons-material/DeleteForever'
import CachedIcon from '@mui/icons-material/Cached'
Expand All @@ -32,6 +33,7 @@ export const EmojiSettings = (): JSX.Element => {
const path = useLocation()
const actions = useGlobalActions()
const { enqueueSnackbar } = useSnackbar()
const [emojiPackages] = usePreference('emojiPackages')

const [addingPackageURL, setAddingPackageURL] = useState<string>('')
const [preview, setPreview] = useState<Partial<EmojiPackage> | null>(null)
Expand Down Expand Up @@ -76,18 +78,30 @@ export const EmojiSettings = (): JSX.Element => {
<Box display="flex" flexDirection="column" gap={1}>
<Box display="flex" justifyContent="space-between" alignItems="center" flexWrap="wrap">
<Typography variant="h3">{t('emojiPackage')}</Typography>
<Button
onClick={() => {
Object.keys(localStorage)
.filter((k) => k.startsWith('emojiPackage:'))
.forEach((k) => {
localStorage.removeItem(k)
})
window.location.reload()
}}
>
{t('updateAll')}
</Button>
<Box display="flex" gap={1}>
<Button
variant="outlined"
startIcon={<ContentPasteIcon />}
onClick={() => {
navigator.clipboard.writeText(JSON.stringify(emojiPackages))
enqueueSnackbar(t('copiedAll'), { variant: 'success' })
}}
>
{t('copyAll')}
</Button>
<Button
onClick={() => {
Object.keys(localStorage)
.filter((k) => k.startsWith('emojiPackage:'))
.forEach((k) => {
localStorage.removeItem(k)
})
window.location.reload()
}}
>
{t('updateAll')}
</Button>
</Box>
</Box>
<Box
sx={{
Expand Down
Loading