mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-30 08:32:26 -05:00
[feature/frogend] modify local emoji (#1143)
* update danger button red * emoji category and image modification * debug bundles in dev * fix linting error
This commit is contained in:
parent
b6dbe21026
commit
665d902fd7
11 changed files with 322 additions and 82 deletions
|
|
@ -20,11 +20,11 @@
|
|||
|
||||
const React = require("react");
|
||||
const {Link} = require("wouter");
|
||||
const splitFilterN = require("split-filter-n");
|
||||
|
||||
const NewEmojiForm = require("./new-emoji");
|
||||
|
||||
const query = require("../../lib/query");
|
||||
const { useEmojiByCategory } = require("./category-select");
|
||||
|
||||
const base = "/settings/admin/custom-emoji";
|
||||
|
||||
|
|
@ -35,13 +35,6 @@ module.exports = function EmojiOverview() {
|
|||
error
|
||||
} = query.useGetAllEmojiQuery({filter: "domain:local"});
|
||||
|
||||
// split all emoji over an object keyed by the category names (or Unsorted)
|
||||
const emojiByCategory = React.useMemo(() => splitFilterN(
|
||||
emoji,
|
||||
[],
|
||||
(entry) => entry.category ?? "Unsorted"
|
||||
), [emoji]);
|
||||
|
||||
return (
|
||||
<>
|
||||
<h1>Custom Emoji</h1>
|
||||
|
|
@ -51,15 +44,17 @@ module.exports = function EmojiOverview() {
|
|||
{isLoading
|
||||
? "Loading..."
|
||||
: <>
|
||||
<EmojiList emoji={emoji} emojiByCategory={emojiByCategory}/>
|
||||
<NewEmojiForm emoji={emoji} emojiByCategory={emojiByCategory}/>
|
||||
<EmojiList emoji={emoji}/>
|
||||
<NewEmojiForm emoji={emoji}/>
|
||||
</>
|
||||
}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
function EmojiList({emoji, emojiByCategory}) {
|
||||
function EmojiList({emoji}) {
|
||||
const emojiByCategory = useEmojiByCategory(emoji);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<h2>Overview</h2>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue