0
0
Fork 0

Change icon SVG imports to use a default import (#28709)

This commit is contained in:
Renaud Chaput 2024-01-12 11:31:24 +01:00 committed by GitHub
parent c6684aa1e3
commit 608f66f978
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
106 changed files with 255 additions and 250 deletions

View file

@ -7,7 +7,7 @@ import classNames from 'classnames';
import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component';
import { ReactComponent as LinkIcon } from '@material-symbols/svg-600/outlined/link.svg';
import LinkIcon from '@material-symbols/svg-600/outlined/link.svg?react';
import { Icon } from 'mastodon/components/icon';

View file

@ -2,9 +2,9 @@ import PropTypes from 'prop-types';
import { FormattedMessage } from 'react-intl';
import { ReactComponent as GroupsIcon } from '@material-symbols/svg-600/outlined/group.svg';
import { ReactComponent as PersonIcon } from '@material-symbols/svg-600/outlined/person.svg';
import { ReactComponent as SmartToyIcon } from '@material-symbols/svg-600/outlined/smart_toy.svg';
import GroupsIcon from '@material-symbols/svg-600/outlined/group.svg?react';
import PersonIcon from '@material-symbols/svg-600/outlined/person.svg?react';
import SmartToyIcon from '@material-symbols/svg-600/outlined/smart_toy.svg?react';
export const Badge = ({ icon, label, domain }) => (
@ -31,4 +31,4 @@ export const GroupBadge = () => (
export const AutomatedBadge = () => (
<Badge icon={<SmartToyIcon />} label={<FormattedMessage id='account.badges.bot' defaultMessage='Automated' />} />
);
);

View file

@ -2,7 +2,7 @@ import { useCallback } from 'react';
import { FormattedMessage } from 'react-intl';
import { ReactComponent as ArrowBackIcon } from '@material-symbols/svg-600/outlined/arrow_back.svg';
import ArrowBackIcon from '@material-symbols/svg-600/outlined/arrow_back.svg?react';
import { Icon } from 'mastodon/components/icon';
import { ButtonInTabsBar } from 'mastodon/features/ui/util/columns_context';

View file

@ -6,12 +6,12 @@ import { FormattedMessage, injectIntl, defineMessages } from 'react-intl';
import classNames from 'classnames';
import { withRouter } from 'react-router-dom';
import { ReactComponent as AddIcon } from '@material-symbols/svg-600/outlined/add.svg';
import { ReactComponent as ArrowBackIcon } from '@material-symbols/svg-600/outlined/arrow_back.svg';
import { ReactComponent as ChevronLeftIcon } from '@material-symbols/svg-600/outlined/chevron_left.svg';
import { ReactComponent as ChevronRightIcon } from '@material-symbols/svg-600/outlined/chevron_right.svg';
import { ReactComponent as CloseIcon } from '@material-symbols/svg-600/outlined/close.svg';
import { ReactComponent as TuneIcon } from '@material-symbols/svg-600/outlined/tune.svg';
import AddIcon from '@material-symbols/svg-600/outlined/add.svg?react';
import ArrowBackIcon from '@material-symbols/svg-600/outlined/arrow_back.svg?react';
import ChevronLeftIcon from '@material-symbols/svg-600/outlined/chevron_left.svg?react';
import ChevronRightIcon from '@material-symbols/svg-600/outlined/chevron_right.svg?react';
import CloseIcon from '@material-symbols/svg-600/outlined/close.svg?react';
import TuneIcon from '@material-symbols/svg-600/outlined/tune.svg?react';
import { Icon } from 'mastodon/components/icon';
import { ButtonInTabsBar, useColumnsContext } from 'mastodon/features/ui/util/columns_context';

View file

@ -7,7 +7,7 @@ import classNames from 'classnames';
import { useDispatch } from 'react-redux';
import { ReactComponent as ContentCopyIcon } from '@material-symbols/svg-600/outlined/content_copy.svg';
import ContentCopyIcon from '@material-symbols/svg-600/outlined/content_copy.svg?react';
import { showAlert } from 'mastodon/actions/alerts';
import { IconButton } from 'mastodon/components/icon_button';

View file

@ -8,7 +8,7 @@ import { useCallback, useState, useEffect } from 'react';
import { defineMessages, useIntl } from 'react-intl';
import { ReactComponent as CloseIcon } from '@material-symbols/svg-600/outlined/close.svg';
import CloseIcon from '@material-symbols/svg-600/outlined/close.svg?react';
import { changeSetting } from 'mastodon/actions/settings';
import { bannerSettings } from 'mastodon/settings';

View file

@ -2,7 +2,7 @@ import { useCallback } from 'react';
import { defineMessages, useIntl } from 'react-intl';
import { ReactComponent as LockOpenIcon } from '@material-symbols/svg-600/outlined/lock_open.svg';
import LockOpenIcon from '@material-symbols/svg-600/outlined/lock_open.svg?react';
import { IconButton } from './icon_button';

View file

@ -6,7 +6,7 @@ import { withRouter } from 'react-router-dom';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { ReactComponent as CloseIcon } from '@material-symbols/svg-600/outlined/close.svg';
import CloseIcon from '@material-symbols/svg-600/outlined/close.svg?react';
import { supportsPassiveEvents } from 'detect-passive-events';
import Overlay from 'react-overlays/Overlay';

View file

@ -5,7 +5,7 @@ import { FormattedMessage, injectIntl } from 'react-intl';
import { connect } from 'react-redux';
import { ReactComponent as ArrowDropDownIcon } from '@material-symbols/svg-600/outlined/arrow_drop_down.svg';
import ArrowDropDownIcon from '@material-symbols/svg-600/outlined/arrow_drop_down.svg?react';
import { openModal } from 'mastodon/actions/modal';
import { Icon } from 'mastodon/components/icon';

View file

@ -1,6 +1,6 @@
import classNames from 'classnames';
import { ReactComponent as CheckBoxOutlineBlankIcon } from '@material-symbols/svg-600/outlined/check_box_outline_blank.svg';
import CheckBoxOutlineBlankIcon from '@material-symbols/svg-600/outlined/check_box_outline_blank.svg?react';
import { isProduction } from 'mastodon/utils/environment';

View file

@ -2,7 +2,7 @@ import { useCallback } from 'react';
import { useIntl, defineMessages } from 'react-intl';
import { ReactComponent as MoreHorizIcon } from '@material-symbols/svg-600/outlined/more_horiz.svg';
import MoreHorizIcon from '@material-symbols/svg-600/outlined/more_horiz.svg?react';
import { Icon } from 'mastodon/components/icon';

View file

@ -8,7 +8,7 @@ import classNames from 'classnames';
import { is } from 'immutable';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { ReactComponent as VisibilityOffIcon } from '@material-symbols/svg-600/outlined/visibility_off.svg';
import VisibilityOffIcon from '@material-symbols/svg-600/outlined/visibility_off.svg?react';
import { debounce } from 'lodash';
import { Blurhash } from 'mastodon/components/blurhash';

View file

@ -5,7 +5,7 @@ import { FormattedMessage } from 'react-intl';
import { connect } from 'react-redux';
import { ReactComponent as CancelPresentationIcon } from '@material-symbols/svg-600/outlined/cancel_presentation.svg';
import CancelPresentationIcon from '@material-symbols/svg-600/outlined/cancel_presentation.svg?react';
import { removePictureInPicture } from 'mastodon/actions/picture_in_picture';
import { Icon } from 'mastodon/components/icon';

View file

@ -7,7 +7,7 @@ import classNames from 'classnames';
import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component';
import { ReactComponent as CheckIcon } from '@material-symbols/svg-600/outlined/check.svg';
import CheckIcon from '@material-symbols/svg-600/outlined/check.svg?react';
import escapeTextContentForBrowser from 'escape-html';
import spring from 'react-motion/lib/spring';

View file

@ -7,10 +7,10 @@ import classNames from 'classnames';
import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component';
import { ReactComponent as AlternateEmailIcon } from '@material-symbols/svg-600/outlined/alternate_email.svg';
import { ReactComponent as PushPinIcon } from '@material-symbols/svg-600/outlined/push_pin.svg';
import { ReactComponent as RepeatIcon } from '@material-symbols/svg-600/outlined/repeat.svg';
import { ReactComponent as ReplyIcon } from '@material-symbols/svg-600/outlined/reply.svg';
import AlternateEmailIcon from '@material-symbols/svg-600/outlined/alternate_email.svg?react';
import PushPinIcon from '@material-symbols/svg-600/outlined/push_pin.svg?react';
import RepeatIcon from '@material-symbols/svg-600/outlined/repeat.svg?react';
import ReplyIcon from '@material-symbols/svg-600/outlined/reply.svg?react';
import { HotKeys } from 'react-hotkeys';
import { Icon } from 'mastodon/components/icon';

View file

@ -9,18 +9,18 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component';
import { connect } from 'react-redux';
import { ReactComponent as BookmarkIcon } from '@material-symbols/svg-600/outlined/bookmark-fill.svg';
import { ReactComponent as BookmarkBorderIcon } from '@material-symbols/svg-600/outlined/bookmark.svg';
import { ReactComponent as MoreHorizIcon } from '@material-symbols/svg-600/outlined/more_horiz.svg';
import { ReactComponent as RepeatIcon } from '@material-symbols/svg-600/outlined/repeat.svg';
import { ReactComponent as ReplyIcon } from '@material-symbols/svg-600/outlined/reply.svg';
import { ReactComponent as ReplyAllIcon } from '@material-symbols/svg-600/outlined/reply_all.svg';
import { ReactComponent as StarIcon } from '@material-symbols/svg-600/outlined/star-fill.svg';
import { ReactComponent as StarBorderIcon } from '@material-symbols/svg-600/outlined/star.svg';
import { ReactComponent as VisibilityIcon } from '@material-symbols/svg-600/outlined/visibility.svg';
import BookmarkIcon from '@material-symbols/svg-600/outlined/bookmark-fill.svg';
import BookmarkBorderIcon from '@material-symbols/svg-600/outlined/bookmark.svg?react';
import MoreHorizIcon from '@material-symbols/svg-600/outlined/more_horiz.svg?react';
import RepeatIcon from '@material-symbols/svg-600/outlined/repeat.svg?react';
import ReplyIcon from '@material-symbols/svg-600/outlined/reply.svg?react';
import ReplyAllIcon from '@material-symbols/svg-600/outlined/reply_all.svg?react';
import StarIcon from '@material-symbols/svg-600/outlined/star-fill.svg?react';
import StarBorderIcon from '@material-symbols/svg-600/outlined/star.svg?react';
import VisibilityIcon from '@material-symbols/svg-600/outlined/visibility.svg?react';
import { ReactComponent as RepeatDisabledIcon } from 'mastodon/../svg-icons/repeat_disabled.svg';
import { ReactComponent as RepeatPrivateIcon } from 'mastodon/../svg-icons/repeat_private.svg';
import RepeatDisabledIcon from 'mastodon/../svg-icons/repeat_disabled.svg?react';
import RepeatPrivateIcon from 'mastodon/../svg-icons/repeat_private.svg?react';
import { PERMISSION_MANAGE_USERS, PERMISSION_MANAGE_FEDERATION } from 'mastodon/permissions';
import { WithRouterPropTypes } from 'mastodon/utils/react_router';

View file

@ -9,7 +9,7 @@ import { Link, withRouter } from 'react-router-dom';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { connect } from 'react-redux';
import { ReactComponent as ChevronRightIcon } from '@material-symbols/svg-600/outlined/chevron_right.svg';
import ChevronRightIcon from '@material-symbols/svg-600/outlined/chevron_right.svg?react';
import { Icon } from 'mastodon/components/icon';
import PollContainer from 'mastodon/containers/poll_container';

View file

@ -1,4 +1,4 @@
import { ReactComponent as CheckIcon } from '@material-symbols/svg-600/outlined/check.svg';
import CheckIcon from '@material-symbols/svg-600/outlined/check.svg?react';
import { Icon } from './icon';

View file

@ -1,9 +1,9 @@
import { defineMessages, useIntl } from 'react-intl';
import { ReactComponent as AlternateEmailIcon } from '@material-symbols/svg-600/outlined/alternate_email.svg';
import { ReactComponent as LockIcon } from '@material-symbols/svg-600/outlined/lock.svg';
import { ReactComponent as LockOpenIcon } from '@material-symbols/svg-600/outlined/lock_open.svg';
import { ReactComponent as PublicIcon } from '@material-symbols/svg-600/outlined/public.svg';
import AlternateEmailIcon from '@material-symbols/svg-600/outlined/alternate_email.svg?react';
import LockIcon from '@material-symbols/svg-600/outlined/lock.svg?react';
import LockOpenIcon from '@material-symbols/svg-600/outlined/lock_open.svg?react';
import PublicIcon from '@material-symbols/svg-600/outlined/public.svg?react';
import { Icon } from './icon';