Use forked Emoji Mart picker to do the font icon picker instead

icon_picker_admin_config
Sean King 4 years ago
parent 3d64f9647c
commit 9507b7a82f
No known key found for this signature in database
GPG Key ID: 510C52BACD6E7257

@ -11,7 +11,7 @@ import Icon from 'soapbox/components/icon';
const messages = defineMessages({ const messages = defineMessages({
emoji: { id: 'icon_button.label', defaultMessage: 'Select icon' }, emoji: { id: 'icon_button.label', defaultMessage: 'Select icon' },
emoji_search: { id: 'emoji_button.search', defaultMessage: 'Search...' }, emoji_search: { id: 'emoji_button.search', defaultMessage: 'Search...' },
emoji_not_found: { id: 'emoji_button.not_found', defaultMessage: 'No emojos!! (╯°□°)╯︵ ┻━┻' }, emoji_not_found: { id: 'icon_button.not_found', defaultMessage: 'No icons!! (╯°□°)╯︵ ┻━┻' },
custom: { id: 'icon_button.icons', defaultMessage: 'Icons' }, custom: { id: 'icon_button.icons', defaultMessage: 'Icons' },
search_results: { id: 'emoji_button.search_results', defaultMessage: 'Search results' }, search_results: { id: 'emoji_button.search_results', defaultMessage: 'Search results' },
}); });
@ -101,7 +101,7 @@ class IconPickerMenu extends React.PureComponent {
emoticons: [], emoticons: [],
keywords: [name], keywords: [name],
imageUrl: '', imageUrl: '',
custom: true, render: <Icon id={name} />,
}); });
}); });
}); });
@ -124,12 +124,12 @@ class IconPickerMenu extends React.PureComponent {
<IconPicker <IconPicker
perLine={8} perLine={8}
emojiSize={22} emojiSize={22}
include={categoriesSort}
sheetSize={32} sheetSize={32}
custom={this.buildIcons(custom_emojis)} custom={this.buildIcons(custom_emojis)}
include={categoriesSort}
color='' color=''
emoji='' emoji=''
set='twitter' set=''
title={title} title={title}
i18n={this.getI18n()} i18n={this.getI18n()}
onClick={this.handleClick} onClick={this.handleClick}
@ -137,6 +137,8 @@ class IconPickerMenu extends React.PureComponent {
backgroundImageFn={backgroundImageFn} backgroundImageFn={backgroundImageFn}
autoFocus autoFocus
emojiTooltip emojiTooltip
overwriteRender
noShowAnchors
/> />
</div> </div>
); );

@ -392,25 +392,7 @@
"fa fa-spell-check", "fa fa-spell-check",
"fa fa-moon", "fa fa-moon",
"fa fa-sun", "fa fa-sun",
"fa fa-biometric", "fa fa-biometric"
"fa fa-volume-mute",
"fa fa-bell-ringing",
"fa fa-bell-ringing-o",
"fa fa-bunny",
"fa fa-cc-by",
"fa fa-cc-cc",
"fa fa-cc-nc-eu",
"fa fa-cc-nc-jp",
"fa fa-cc-nc",
"fa fa-cc-nd",
"fa fa-cc-pd",
"fa fa-cc-remix",
"fa fa-cc-sa",
"fa fa-cc-share",
"fa fa-cc-zero",
"fa fa-email-bulk",
"fa fa-email-bulk-o",
"fa fa-skate"
], ],
"Text Editor Icons": [ "Text Editor Icons": [
"fa fa-th-large", "fa fa-th-large",
@ -730,41 +712,7 @@
"fa fa-unsplash", "fa fa-unsplash",
"fa fa-hackster", "fa fa-hackster",
"fa fa-f-droid", "fa fa-f-droid",
"fa fa-wire", "fa fa-signalapp"
"fa fa-tor-onion",
"fa fa-hal",
"fa fa-jupyter",
"fa fa-julia",
"fa fa-classicpress",
"fa fa-classicpress-circle",
"fa fa-open-collective",
"fa fa-orcid",
"fa fa-researchgate",
"fa fa-funkwhale",
"fa fa-boardgamegeek",
"fa fa-buymeacoffee",
"fa fa-conway-glider",
"fa fa-csharp",
"fa fa-gnu",
"fa fa-google-play",
"fa fa-heroku",
"fa fa-home-assistant",
"fa fa-java",
"fa fa-mariadb",
"fa fa-markdown",
"fa fa-mysql",
"fa fa-nordcast",
"fa fa-plume",
"fa fa-postgresql",
"fa fa-sass-alt",
"fa fa-sass",
"fa fa-sketchfab",
"fa fa-tex",
"fa fa-textpattern",
"fa fa-unity",
"fa fa-signalapp",
"fa fa-askfm",
"fa fa-blockstack"
], ],
"Medical Icons": [ "Medical Icons": [
"fa fa-user-md", "fa fa-user-md",

@ -26,7 +26,6 @@ import Accordion from '../ui/components/accordion';
import SitePreview from './components/site_preview'; import SitePreview from './components/site_preview';
import ThemeToggle from 'soapbox/features/ui/components/theme_toggle'; import ThemeToggle from 'soapbox/features/ui/components/theme_toggle';
import { defaultSettings } from 'soapbox/actions/settings'; import { defaultSettings } from 'soapbox/actions/settings';
import forkAwesomeIcons from './forkawesome.json';
import IconPickerDropdown from './components/icon_picker_dropdown'; import IconPickerDropdown from './components/icon_picker_dropdown';
const messages = defineMessages({ const messages = defineMessages({
@ -438,10 +437,6 @@ export class IconPicker extends ImmutablePureComponent {
onChange: PropTypes.func.isRequired, onChange: PropTypes.func.isRequired,
} }
static defaultProps = {
icons: forkAwesomeIcons,
};
render() { render() {
const { onChange, value, label } = this.props; const { onChange, value, label } = this.props;

@ -173,6 +173,13 @@
display: inline-block; display: inline-block;
font-size: 0; font-size: 0;
.fa {
font-size: 18px;
width: 22px;
height: 22px;
text-align: center;
}
span { span {
width: 22px; width: 22px;
height: 22px; height: 22px;

@ -518,6 +518,7 @@ code {
padding: 9px; padding: 9px;
border: 1px solid var(--highlight-text-color); border: 1px solid var(--highlight-text-color);
border-radius: 4px; border-radius: 4px;
cursor: pointer;
.fa { .fa {
font-size: 18px; font-size: 18px;

@ -62,7 +62,7 @@
"cssnano": "^4.1.10", "cssnano": "^4.1.10",
"detect-passive-events": "^1.0.2", "detect-passive-events": "^1.0.2",
"dotenv": "^8.0.0", "dotenv": "^8.0.0",
"emoji-mart": "Gargron/emoji-mart#build", "emoji-mart": "https://gitlab.com/seanking2919/emoji-mart#build",
"es6-symbol": "^3.1.1", "es6-symbol": "^3.1.1",
"escape-html": "^1.0.3", "escape-html": "^1.0.3",
"exif-js": "^2.3.0", "exif-js": "^2.3.0",

@ -4473,9 +4473,9 @@ elliptic@^6.0.0:
minimalistic-assert "^1.0.0" minimalistic-assert "^1.0.0"
minimalistic-crypto-utils "^1.0.0" minimalistic-crypto-utils "^1.0.0"
emoji-mart@Gargron/emoji-mart#build: "emoji-mart@https://gitlab.com/seanking2919/emoji-mart#build":
version "2.6.2" version "2.6.3"
resolved "https://codeload.github.com/Gargron/emoji-mart/tar.gz/ff00dc470b5b2d9f145a6d6e977a54de5df2b4c9" resolved "https://gitlab.com/seanking2919/emoji-mart#c2d4dc6232e1cb1fd9541a12d2748015cddb14b1"
emoji-regex@^7.0.1: emoji-regex@^7.0.1:
version "7.0.3" version "7.0.3"

Loading…
Cancel
Save