From 98cf4b7ba0fc6cfcd282d8ea9a39f06366225723 Mon Sep 17 00:00:00 2001 From: Claire Date: Fri, 8 Mar 2024 12:42:03 +0100 Subject: [PATCH] Reduce code differences with upstream --- .../flavours/glitch/actions/accounts.js | 7 - .../flavours/glitch/actions/statuses.js | 4 +- .../glitch/components/attachment_list.jsx | 1 - .../glitch/components/column_header.jsx | 1 - .../components/edited_timestamp/index.jsx | 1 - .../components/regeneration_indicator.jsx | 2 +- .../flavours/glitch/features/about/index.jsx | 1 - .../account_gallery/components/media_item.jsx | 1 - .../flavours/glitch/features/audio/index.jsx | 1 - .../features/community_timeline/index.jsx | 1 - .../glitch/features/directory/index.jsx | 1 - .../glitch/features/explore/index.jsx | 1 - .../glitch/features/explore/results.jsx | 1 - .../glitch/features/filters/select_filter.jsx | 2 +- .../glitch/features/firehose/index.jsx | 1 - .../glitch/features/home_timeline/index.jsx | 1 - .../features/keyboard_shortcuts/index.jsx | 1 - .../features/list_adder/components/list.jsx | 1 - .../list_editor/components/search.jsx | 1 - .../glitch/features/list_timeline/index.jsx | 2 - .../flavours/glitch/features/lists/index.jsx | 1 - .../components/clear_column_button.jsx | 1 - .../notifications/components/filter_bar.jsx | 1 - .../notifications_permission_banner.jsx | 1 - .../features/onboarding/components/step.jsx | 1 - .../glitch/features/onboarding/index.jsx | 1 - .../picture_in_picture/components/footer.jsx | 1 - .../picture_in_picture/components/header.jsx | 1 - .../glitch/features/pinned_statuses/index.jsx | 1 - .../glitch/features/public_timeline/index.jsx | 1 - .../glitch/features/reblogs/index.jsx | 1 - .../features/report/components/option.jsx | 1 - .../report/components/status_check_box.jsx | 1 + .../features/status/components/action_bar.jsx | 4 +- .../subscribed_languages_modal/index.jsx | 1 - .../features/ui/components/embed_modal.jsx | 1 - .../features/ui/components/filter_modal.jsx | 1 - .../components/notifications_counter_icon.js | 1 + .../features/ui/util/async-components.js | 248 +++++++++--------- .../glitch/images/elephant_ui_working.svg | 1 - .../flavours/glitch/initial_state.js | 17 +- .../flavours/glitch/reducers/settings.js | 3 - 42 files changed, 140 insertions(+), 182 deletions(-) delete mode 100644 app/javascript/flavours/glitch/images/elephant_ui_working.svg diff --git a/app/javascript/flavours/glitch/actions/accounts.js b/app/javascript/flavours/glitch/actions/accounts.js index af10af9fe9..bb26035e97 100644 --- a/app/javascript/flavours/glitch/actions/accounts.js +++ b/app/javascript/flavours/glitch/actions/accounts.js @@ -66,11 +66,9 @@ export const FOLLOW_REQUESTS_EXPAND_SUCCESS = 'FOLLOW_REQUESTS_EXPAND_SUCCESS'; export const FOLLOW_REQUESTS_EXPAND_FAIL = 'FOLLOW_REQUESTS_EXPAND_FAIL'; export const FOLLOW_REQUEST_AUTHORIZE_REQUEST = 'FOLLOW_REQUEST_AUTHORIZE_REQUEST'; -export const FOLLOW_REQUEST_AUTHORIZE_SUCCESS = 'FOLLOW_REQUEST_AUTHORIZE_SUCCESS'; export const FOLLOW_REQUEST_AUTHORIZE_FAIL = 'FOLLOW_REQUEST_AUTHORIZE_FAIL'; export const FOLLOW_REQUEST_REJECT_REQUEST = 'FOLLOW_REQUEST_REJECT_REQUEST'; -export const FOLLOW_REQUEST_REJECT_SUCCESS = 'FOLLOW_REQUEST_REJECT_SUCCESS'; export const FOLLOW_REQUEST_REJECT_FAIL = 'FOLLOW_REQUEST_REJECT_FAIL'; export const PINNED_ACCOUNTS_FETCH_REQUEST = 'PINNED_ACCOUNTS_FETCH_REQUEST'; @@ -93,11 +91,6 @@ export * from './accounts_typed'; export function fetchAccount(id) { return (dispatch, getState) => { dispatch(fetchRelationships([id])); - - if (getState().getIn(['accounts', id], null) !== null) { - return; - } - dispatch(fetchAccountRequest(id)); api(getState).get(`/api/v1/accounts/${id}`).then(response => { diff --git a/app/javascript/flavours/glitch/actions/statuses.js b/app/javascript/flavours/glitch/actions/statuses.js index 5bdd31c343..332057ee67 100644 --- a/app/javascript/flavours/glitch/actions/statuses.js +++ b/app/javascript/flavours/glitch/actions/statuses.js @@ -1,7 +1,7 @@ import api from '../api'; import { ensureComposeIsVisible, setComposeToStatus } from './compose'; -import { importFetchedStatus, importFetchedStatuses } from './importer'; +import { importFetchedStatus, importFetchedStatuses, importFetchedAccount } from './importer'; import { deleteFromTimelines } from './timelines'; export const STATUS_FETCH_REQUEST = 'STATUS_FETCH_REQUEST'; @@ -138,10 +138,10 @@ export function deleteStatus(id, routerHistory, withRedraft = false) { api(getState).delete(`/api/v1/statuses/${id}`).then(response => { dispatch(deleteStatusSuccess(id)); dispatch(deleteFromTimelines(id)); + dispatch(importFetchedAccount(response.data.account)); if (withRedraft) { dispatch(redraft(status, response.data.text, response.data.content_type)); - ensureComposeIsVisible(getState, routerHistory); } }).catch(error => { diff --git a/app/javascript/flavours/glitch/components/attachment_list.jsx b/app/javascript/flavours/glitch/components/attachment_list.jsx index 44b8bf78ee..60800f41ec 100644 --- a/app/javascript/flavours/glitch/components/attachment_list.jsx +++ b/app/javascript/flavours/glitch/components/attachment_list.jsx @@ -10,7 +10,6 @@ import ImmutablePureComponent from 'react-immutable-pure-component'; import LinkIcon from '@/material-icons/400-24px/link.svg?react'; import { Icon } from 'flavours/glitch/components/icon'; - const filename = url => url.split('/').pop().split('#')[0].split('?')[0]; export default class AttachmentList extends ImmutablePureComponent { diff --git a/app/javascript/flavours/glitch/components/column_header.jsx b/app/javascript/flavours/glitch/components/column_header.jsx index ec99698d0c..262166d2d1 100644 --- a/app/javascript/flavours/glitch/components/column_header.jsx +++ b/app/javascript/flavours/glitch/components/column_header.jsx @@ -16,7 +16,6 @@ import { Icon } from 'flavours/glitch/components/icon'; import { ButtonInTabsBar, useColumnsContext } from 'flavours/glitch/features/ui/util/columns_context'; import { WithRouterPropTypes } from 'flavours/glitch/utils/react_router'; - import { useAppHistory } from './router'; const messages = defineMessages({ diff --git a/app/javascript/flavours/glitch/components/edited_timestamp/index.jsx b/app/javascript/flavours/glitch/components/edited_timestamp/index.jsx index 2363f132f1..5a16f67530 100644 --- a/app/javascript/flavours/glitch/components/edited_timestamp/index.jsx +++ b/app/javascript/flavours/glitch/components/edited_timestamp/index.jsx @@ -5,7 +5,6 @@ import { FormattedMessage, injectIntl } from 'react-intl'; import { connect } from 'react-redux'; - import ArrowDropDownIcon from '@/material-icons/400-24px/arrow_drop_down.svg?react'; import { openModal } from 'flavours/glitch/actions/modal'; import { Icon } from 'flavours/glitch/components/icon'; diff --git a/app/javascript/flavours/glitch/components/regeneration_indicator.jsx b/app/javascript/flavours/glitch/components/regeneration_indicator.jsx index 78844f389d..d42a7d7c72 100644 --- a/app/javascript/flavours/glitch/components/regeneration_indicator.jsx +++ b/app/javascript/flavours/glitch/components/regeneration_indicator.jsx @@ -1,6 +1,6 @@ import { FormattedMessage } from 'react-intl'; -import illustration from 'flavours/glitch/images/elephant_ui_working.svg'; +import illustration from '@/images/elephant_ui_working.svg'; const RegenerationIndicator = () => (
diff --git a/app/javascript/flavours/glitch/features/about/index.jsx b/app/javascript/flavours/glitch/features/about/index.jsx index e5544c8a74..623f89ed3d 100644 --- a/app/javascript/flavours/glitch/features/about/index.jsx +++ b/app/javascript/flavours/glitch/features/about/index.jsx @@ -10,7 +10,6 @@ import { List as ImmutableList } from 'immutable'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { connect } from 'react-redux'; - import ChevronRightIcon from '@/material-icons/400-24px/chevron_right.svg?react'; import ExpandMoreIcon from '@/material-icons/400-24px/expand_more.svg?react'; import { fetchServer, fetchExtendedDescription, fetchDomainBlocks } from 'flavours/glitch/actions/server'; diff --git a/app/javascript/flavours/glitch/features/account_gallery/components/media_item.jsx b/app/javascript/flavours/glitch/features/account_gallery/components/media_item.jsx index ebd156a4f9..c709e58db1 100644 --- a/app/javascript/flavours/glitch/features/account_gallery/components/media_item.jsx +++ b/app/javascript/flavours/glitch/features/account_gallery/components/media_item.jsx @@ -12,7 +12,6 @@ import { Blurhash } from 'flavours/glitch/components/blurhash'; import { Icon } from 'flavours/glitch/components/icon'; import { autoPlayGif, displayMedia, useBlurhash } from 'flavours/glitch/initial_state'; - export default class MediaItem extends ImmutablePureComponent { static propTypes = { diff --git a/app/javascript/flavours/glitch/features/audio/index.jsx b/app/javascript/flavours/glitch/features/audio/index.jsx index dc9d76222d..6b0c2f6fea 100644 --- a/app/javascript/flavours/glitch/features/audio/index.jsx +++ b/app/javascript/flavours/glitch/features/audio/index.jsx @@ -18,7 +18,6 @@ import VolumeUpIcon from '@/material-icons/400-24px/volume_up-fill.svg?react'; import { Icon } from 'flavours/glitch/components/icon'; import { formatTime, getPointerPosition, fileNameFromURL } from 'flavours/glitch/features/video'; - import { Blurhash } from '../../components/blurhash'; import { displayMedia, useBlurhash } from '../../initial_state'; diff --git a/app/javascript/flavours/glitch/features/community_timeline/index.jsx b/app/javascript/flavours/glitch/features/community_timeline/index.jsx index e2b982aaf8..7be2196511 100644 --- a/app/javascript/flavours/glitch/features/community_timeline/index.jsx +++ b/app/javascript/flavours/glitch/features/community_timeline/index.jsx @@ -7,7 +7,6 @@ import { Helmet } from 'react-helmet'; import { connect } from 'react-redux'; - import PeopleIcon from '@/material-icons/400-24px/group.svg?react'; import { DismissableBanner } from 'flavours/glitch/components/dismissable_banner'; import { domain } from 'flavours/glitch/initial_state'; diff --git a/app/javascript/flavours/glitch/features/directory/index.jsx b/app/javascript/flavours/glitch/features/directory/index.jsx index 0d8742b255..293b89272a 100644 --- a/app/javascript/flavours/glitch/features/directory/index.jsx +++ b/app/javascript/flavours/glitch/features/directory/index.jsx @@ -9,7 +9,6 @@ import { List as ImmutableList } from 'immutable'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { connect } from 'react-redux'; - import PeopleIcon from '@/material-icons/400-24px/group.svg?react'; import { addColumn, removeColumn, moveColumn, changeColumnParams } from 'flavours/glitch/actions/columns'; import { fetchDirectory, expandDirectory } from 'flavours/glitch/actions/directory'; diff --git a/app/javascript/flavours/glitch/features/explore/index.jsx b/app/javascript/flavours/glitch/features/explore/index.jsx index dca2e59c5c..cca9cada47 100644 --- a/app/javascript/flavours/glitch/features/explore/index.jsx +++ b/app/javascript/flavours/glitch/features/explore/index.jsx @@ -8,7 +8,6 @@ import { NavLink, Switch, Route } from 'react-router-dom'; import { connect } from 'react-redux'; - import ExploreIcon from '@/material-icons/400-24px/explore.svg?react'; import SearchIcon from '@/material-icons/400-24px/search.svg?react'; import Column from 'flavours/glitch/components/column'; diff --git a/app/javascript/flavours/glitch/features/explore/results.jsx b/app/javascript/flavours/glitch/features/explore/results.jsx index 53285988c3..e0162f713a 100644 --- a/app/javascript/flavours/glitch/features/explore/results.jsx +++ b/app/javascript/flavours/glitch/features/explore/results.jsx @@ -9,7 +9,6 @@ import { List as ImmutableList } from 'immutable'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { connect } from 'react-redux'; - import FindInPageIcon from '@/material-icons/400-24px/find_in_page.svg?react'; import PeopleIcon from '@/material-icons/400-24px/group.svg?react'; import TagIcon from '@/material-icons/400-24px/tag.svg?react'; diff --git a/app/javascript/flavours/glitch/features/filters/select_filter.jsx b/app/javascript/flavours/glitch/features/filters/select_filter.jsx index f409cc2d70..3a46b8bd48 100644 --- a/app/javascript/flavours/glitch/features/filters/select_filter.jsx +++ b/app/javascript/flavours/glitch/features/filters/select_filter.jsx @@ -180,7 +180,7 @@ class SelectFilter extends PureComponent {
- +
diff --git a/app/javascript/flavours/glitch/features/firehose/index.jsx b/app/javascript/flavours/glitch/features/firehose/index.jsx index 29219974a9..678bc3525a 100644 --- a/app/javascript/flavours/glitch/features/firehose/index.jsx +++ b/app/javascript/flavours/glitch/features/firehose/index.jsx @@ -6,7 +6,6 @@ import { useIntl, defineMessages, FormattedMessage } from 'react-intl'; import { Helmet } from 'react-helmet'; import { NavLink } from 'react-router-dom'; - import PublicIcon from '@/material-icons/400-24px/public.svg?react'; import { addColumn } from 'flavours/glitch/actions/columns'; import { changeSetting } from 'flavours/glitch/actions/settings'; diff --git a/app/javascript/flavours/glitch/features/home_timeline/index.jsx b/app/javascript/flavours/glitch/features/home_timeline/index.jsx index f383a6e48c..a2683f587f 100644 --- a/app/javascript/flavours/glitch/features/home_timeline/index.jsx +++ b/app/javascript/flavours/glitch/features/home_timeline/index.jsx @@ -8,7 +8,6 @@ import { Helmet } from 'react-helmet'; import { connect } from 'react-redux'; - import CampaignIcon from '@/material-icons/400-24px/campaign.svg?react'; import HomeIcon from '@/material-icons/400-24px/home-fill.svg?react'; import { fetchAnnouncements, toggleShowAnnouncements } from 'flavours/glitch/actions/announcements'; diff --git a/app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx b/app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx index 98f65d9b50..858d760c24 100644 --- a/app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx +++ b/app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx @@ -7,7 +7,6 @@ import { Helmet } from 'react-helmet'; import ImmutablePureComponent from 'react-immutable-pure-component'; import { connect } from 'react-redux'; - import InfoIcon from '@/material-icons/400-24px/info.svg?react'; import Column from 'flavours/glitch/components/column'; import ColumnHeader from 'flavours/glitch/components/column_header'; diff --git a/app/javascript/flavours/glitch/features/list_adder/components/list.jsx b/app/javascript/flavours/glitch/features/list_adder/components/list.jsx index adbb16fcd6..e91c8e35bd 100644 --- a/app/javascript/flavours/glitch/features/list_adder/components/list.jsx +++ b/app/javascript/flavours/glitch/features/list_adder/components/list.jsx @@ -11,7 +11,6 @@ import CloseIcon from '@/material-icons/400-24px/close.svg?react'; import ListAltIcon from '@/material-icons/400-24px/list_alt.svg?react'; import { Icon } from 'flavours/glitch/components/icon'; - import { removeFromListAdder, addToListAdder } from '../../../actions/lists'; import { IconButton } from '../../../components/icon_button'; diff --git a/app/javascript/flavours/glitch/features/list_editor/components/search.jsx b/app/javascript/flavours/glitch/features/list_editor/components/search.jsx index 6e9cd44835..23e4b427dc 100644 --- a/app/javascript/flavours/glitch/features/list_editor/components/search.jsx +++ b/app/javascript/flavours/glitch/features/list_editor/components/search.jsx @@ -11,7 +11,6 @@ import CancelIcon from '@/material-icons/400-24px/cancel.svg?react'; import SearchIcon from '@/material-icons/400-24px/search.svg?react'; import { Icon } from 'flavours/glitch/components/icon'; - import { fetchListSuggestions, clearListSuggestions, changeListSuggestions } from '../../../actions/lists'; const messages = defineMessages({ diff --git a/app/javascript/flavours/glitch/features/list_timeline/index.jsx b/app/javascript/flavours/glitch/features/list_timeline/index.jsx index ae9f75318f..abc664e0a1 100644 --- a/app/javascript/flavours/glitch/features/list_timeline/index.jsx +++ b/app/javascript/flavours/glitch/features/list_timeline/index.jsx @@ -222,8 +222,6 @@ class ListTimeline extends PureComponent {
)} - -
{ const content = ( <> diff --git a/app/javascript/flavours/glitch/features/onboarding/index.jsx b/app/javascript/flavours/glitch/features/onboarding/index.jsx index fb9df29aeb..187ee3b770 100644 --- a/app/javascript/flavours/glitch/features/onboarding/index.jsx +++ b/app/javascript/flavours/glitch/features/onboarding/index.jsx @@ -8,7 +8,6 @@ import { Link, Switch, Route, useHistory } from 'react-router-dom'; import { useDispatch } from 'react-redux'; - import illustration from '@/images/elephant_ui_conversation.svg'; import AccountCircleIcon from '@/material-icons/400-24px/account_circle.svg?react'; import ArrowRightAltIcon from '@/material-icons/400-24px/arrow_right_alt.svg?react'; diff --git a/app/javascript/flavours/glitch/features/picture_in_picture/components/footer.jsx b/app/javascript/flavours/glitch/features/picture_in_picture/components/footer.jsx index 83e53d9263..3bf4f3b857 100644 --- a/app/javascript/flavours/glitch/features/picture_in_picture/components/footer.jsx +++ b/app/javascript/flavours/glitch/features/picture_in_picture/components/footer.jsx @@ -9,7 +9,6 @@ import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; import { connect } from 'react-redux'; - import OpenInNewIcon from '@/material-icons/400-24px/open_in_new.svg?react'; import RepeatIcon from '@/material-icons/400-24px/repeat.svg?react'; import ReplyIcon from '@/material-icons/400-24px/reply.svg?react'; diff --git a/app/javascript/flavours/glitch/features/picture_in_picture/components/header.jsx b/app/javascript/flavours/glitch/features/picture_in_picture/components/header.jsx index dd90cd3522..5996ab240d 100644 --- a/app/javascript/flavours/glitch/features/picture_in_picture/components/header.jsx +++ b/app/javascript/flavours/glitch/features/picture_in_picture/components/header.jsx @@ -8,7 +8,6 @@ import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; import { connect } from 'react-redux'; - import CloseIcon from '@/material-icons/400-24px/close.svg?react'; import { Avatar } from 'flavours/glitch/components/avatar'; import { DisplayName } from 'flavours/glitch/components/display_name'; diff --git a/app/javascript/flavours/glitch/features/pinned_statuses/index.jsx b/app/javascript/flavours/glitch/features/pinned_statuses/index.jsx index 94d5f6cb4c..7b4e36cdaf 100644 --- a/app/javascript/flavours/glitch/features/pinned_statuses/index.jsx +++ b/app/javascript/flavours/glitch/features/pinned_statuses/index.jsx @@ -11,7 +11,6 @@ import { connect } from 'react-redux'; import PushPinIcon from '@/material-icons/400-24px/push_pin.svg?react'; import { getStatusList } from 'flavours/glitch/selectors'; - import { fetchPinnedStatuses } from '../../actions/pin_statuses'; import StatusList from '../../components/status_list'; import Column from '../ui/components/column'; diff --git a/app/javascript/flavours/glitch/features/public_timeline/index.jsx b/app/javascript/flavours/glitch/features/public_timeline/index.jsx index 0062a9f719..8b9503928b 100644 --- a/app/javascript/flavours/glitch/features/public_timeline/index.jsx +++ b/app/javascript/flavours/glitch/features/public_timeline/index.jsx @@ -7,7 +7,6 @@ import { Helmet } from 'react-helmet'; import { connect } from 'react-redux'; - import PublicIcon from '@/material-icons/400-24px/public.svg?react'; import { DismissableBanner } from 'flavours/glitch/components/dismissable_banner'; import { domain } from 'flavours/glitch/initial_state'; diff --git a/app/javascript/flavours/glitch/features/reblogs/index.jsx b/app/javascript/flavours/glitch/features/reblogs/index.jsx index 52e9a35833..3c02293e58 100644 --- a/app/javascript/flavours/glitch/features/reblogs/index.jsx +++ b/app/javascript/flavours/glitch/features/reblogs/index.jsx @@ -14,7 +14,6 @@ import RefreshIcon from '@/material-icons/400-24px/refresh.svg?react'; import RepeatIcon from '@/material-icons/400-24px/repeat.svg?react'; import { Icon } from 'flavours/glitch/components/icon'; - import { fetchReblogs, expandReblogs } from '../../actions/interactions'; import ColumnHeader from '../../components/column_header'; import { LoadingIndicator } from '../../components/loading_indicator'; diff --git a/app/javascript/flavours/glitch/features/report/components/option.jsx b/app/javascript/flavours/glitch/features/report/components/option.jsx index 3b40de8cba..8edeed28ad 100644 --- a/app/javascript/flavours/glitch/features/report/components/option.jsx +++ b/app/javascript/flavours/glitch/features/report/components/option.jsx @@ -6,7 +6,6 @@ import classNames from 'classnames'; import CheckIcon from '@/material-icons/400-24px/done.svg?react'; import { Icon } from 'flavours/glitch/components/icon'; - export default class Option extends PureComponent { static propTypes = { diff --git a/app/javascript/flavours/glitch/features/report/components/status_check_box.jsx b/app/javascript/flavours/glitch/features/report/components/status_check_box.jsx index 0ae20b8f48..06ed6ac33c 100644 --- a/app/javascript/flavours/glitch/features/report/components/status_check_box.jsx +++ b/app/javascript/flavours/glitch/features/report/components/status_check_box.jsx @@ -19,6 +19,7 @@ class StatusCheckBox extends PureComponent { status: ImmutablePropTypes.map.isRequired, checked: PropTypes.bool, onToggle: PropTypes.func.isRequired, + intl: PropTypes.object.isRequired, }; handleStatusesToggle = (value, checked) => { diff --git a/app/javascript/flavours/glitch/features/status/components/action_bar.jsx b/app/javascript/flavours/glitch/features/status/components/action_bar.jsx index 1d8707ccbf..ab00091200 100644 --- a/app/javascript/flavours/glitch/features/status/components/action_bar.jsx +++ b/app/javascript/flavours/glitch/features/status/components/action_bar.jsx @@ -17,8 +17,8 @@ import ReplyAllIcon from '@/material-icons/400-24px/reply_all.svg?react'; import StarIcon from '@/material-icons/400-24px/star-fill.svg?react'; import StarBorderIcon from '@/material-icons/400-24px/star.svg?react'; import RepeatActiveIcon from '@/svg-icons/repeat_active.svg?react'; -import RepeatDisabledIcon from '@/svg-icons/repeat_disabled.svg'; -import RepeatPrivateIcon from '@/svg-icons/repeat_private.svg'; +import RepeatDisabledIcon from '@/svg-icons/repeat_disabled.svg?react'; +import RepeatPrivateIcon from '@/svg-icons/repeat_private.svg?react'; import RepeatPrivateActiveIcon from '@/svg-icons/repeat_private_active.svg?react'; import { PERMISSION_MANAGE_USERS, PERMISSION_MANAGE_FEDERATION } from 'flavours/glitch/permissions'; import { accountAdminLink, statusAdminLink } from 'flavours/glitch/utils/backend_links'; diff --git a/app/javascript/flavours/glitch/features/subscribed_languages_modal/index.jsx b/app/javascript/flavours/glitch/features/subscribed_languages_modal/index.jsx index 1edfe700fe..c02a6ed037 100644 --- a/app/javascript/flavours/glitch/features/subscribed_languages_modal/index.jsx +++ b/app/javascript/flavours/glitch/features/subscribed_languages_modal/index.jsx @@ -8,7 +8,6 @@ import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; import { connect } from 'react-redux'; - import CloseIcon from '@/material-icons/400-24px/close.svg?react'; import { followAccount } from 'flavours/glitch/actions/accounts'; import { Button } from 'flavours/glitch/components/button'; diff --git a/app/javascript/flavours/glitch/features/ui/components/embed_modal.jsx b/app/javascript/flavours/glitch/features/ui/components/embed_modal.jsx index edd2fb8940..87316b7f23 100644 --- a/app/javascript/flavours/glitch/features/ui/components/embed_modal.jsx +++ b/app/javascript/flavours/glitch/features/ui/components/embed_modal.jsx @@ -4,7 +4,6 @@ import { defineMessages, FormattedMessage, injectIntl } from 'react-intl'; import ImmutablePureComponent from 'react-immutable-pure-component'; - import CloseIcon from '@/material-icons/400-24px/close.svg?react'; import api from 'flavours/glitch/api'; import { IconButton } from 'flavours/glitch/components/icon_button'; diff --git a/app/javascript/flavours/glitch/features/ui/components/filter_modal.jsx b/app/javascript/flavours/glitch/features/ui/components/filter_modal.jsx index 9ce5eec874..92f83d8d59 100644 --- a/app/javascript/flavours/glitch/features/ui/components/filter_modal.jsx +++ b/app/javascript/flavours/glitch/features/ui/components/filter_modal.jsx @@ -5,7 +5,6 @@ import { defineMessages, FormattedMessage, injectIntl } from 'react-intl'; import ImmutablePureComponent from 'react-immutable-pure-component'; import { connect } from 'react-redux'; - import CloseIcon from '@/material-icons/400-24px/close.svg?react'; import { fetchFilters, createFilter, createFilterStatus } from 'flavours/glitch/actions/filters'; import { fetchStatus } from 'flavours/glitch/actions/statuses'; diff --git a/app/javascript/flavours/glitch/features/ui/components/notifications_counter_icon.js b/app/javascript/flavours/glitch/features/ui/components/notifications_counter_icon.js index 8e38acfe80..0816e9660f 100644 --- a/app/javascript/flavours/glitch/features/ui/components/notifications_counter_icon.js +++ b/app/javascript/flavours/glitch/features/ui/components/notifications_counter_icon.js @@ -3,6 +3,7 @@ import { connect } from 'react-redux'; import NotificationsIcon from '@/material-icons/400-24px/notifications-fill.svg?react'; import { IconWithBadge } from 'flavours/glitch/components/icon_with_badge'; + const mapStateToProps = state => ({ count: state.getIn(['local_settings', 'notifications', 'tab_badge']) ? state.getIn(['notifications', 'unread']) : 0, id: 'bell', diff --git a/app/javascript/flavours/glitch/features/ui/util/async-components.js b/app/javascript/flavours/glitch/features/ui/util/async-components.js index 762df7ecf4..c17bb206e3 100644 --- a/app/javascript/flavours/glitch/features/ui/util/async-components.js +++ b/app/javascript/flavours/glitch/features/ui/util/async-components.js @@ -1,25 +1,25 @@ export function EmojiPicker () { - return import(/* webpackChunkName: "flavours/glitch/async/emoji_picker" */'flavours/glitch/features/emoji/emoji_picker'); + return import(/* webpackChunkName: "flavours/glitch/async/emoji_picker" */'../../emoji/emoji_picker'); } export function Compose () { - return import(/* webpackChunkName: "flavours/glitch/async/compose" */'flavours/glitch/features/compose'); + return import(/* webpackChunkName: "flavours/glitch/async/compose" */'../../compose'); } export function Notifications () { - return import(/* webpackChunkName: "flavours/glitch/async/notifications" */'flavours/glitch/features/notifications'); + return import(/* webpackChunkName: "flavours/glitch/async/notifications" */'../../notifications'); } export function HomeTimeline () { - return import(/* webpackChunkName: "flavours/glitch/async/home_timeline" */'flavours/glitch/features/home_timeline'); + return import(/* webpackChunkName: "flavours/glitch/async/home_timeline" */'../../home_timeline'); } export function PublicTimeline () { - return import(/* webpackChunkName: "flavours/glitch/async/public_timeline" */'flavours/glitch/features/public_timeline'); + return import(/* webpackChunkName: "flavours/glitch/async/public_timeline" */'../../public_timeline'); } export function CommunityTimeline () { - return import(/* webpackChunkName: "flavours/glitch/async/community_timeline" */'flavours/glitch/features/community_timeline'); + return import(/* webpackChunkName: "flavours/glitch/async/community_timeline" */'../../community_timeline'); } export function Firehose () { @@ -27,177 +27,177 @@ export function Firehose () { } export function HashtagTimeline () { - return import(/* webpackChunkName: "flavours/glitch/async/hashtag_timeline" */'flavours/glitch/features/hashtag_timeline'); + return import(/* webpackChunkName: "flavours/glitch/async/hashtag_timeline" */'../../hashtag_timeline'); } export function ListTimeline () { - return import(/* webpackChunkName: "flavours/glitch/async/list_timeline" */'flavours/glitch/features/list_timeline'); + return import(/* webpackChunkName: "flavours/glitch/async/list_timeline" */'../../list_timeline'); } export function Lists () { - return import(/* webpackChunkName: "flavours/glitch/async/lists" */'flavours/glitch/features/lists'); -} - -export function ListEditor () { - return import(/* webpackChunkName: "flavours/glitch/async/list_editor" */'flavours/glitch/features/list_editor'); + return import(/* webpackChunkName: "flavours/glitch/async/lists" */'../../lists'); } export function PinnedAccountsEditor () { - return import(/* webpackChunkName: "flavours/glitch/async/pinned_accounts_editor" */'flavours/glitch/features/pinned_accounts_editor'); + return import(/* webpackChunkName: "flavours/glitch/async/pinned_accounts_editor" */'../../pinned_accounts_editor'); } export function DirectTimeline() { - return import(/* webpackChunkName: "flavours/glitch/async/direct_timeline" */'flavours/glitch/features/direct_timeline'); + return import(/* webpackChunkName: "flavours/glitch/async/direct_timeline" */'../../direct_timeline'); } export function Status () { - return import(/* webpackChunkName: "flavours/glitch/async/status" */'flavours/glitch/features/status'); + return import(/* webpackChunkName: "flavours/glitch/async/status" */'../../status'); } export function GettingStarted () { - return import(/* webpackChunkName: "flavours/glitch/async/getting_started" */'flavours/glitch/features/getting_started'); -} - -export function KeyboardShortcuts () { - return import(/* webpackChunkName: "flavours/glitch/async/keyboard_shortcuts" */'flavours/glitch/features/keyboard_shortcuts'); -} - -export function PinnedStatuses () { - return import(/* webpackChunkName: "flavours/glitch/async/pinned_statuses" */'flavours/glitch/features/pinned_statuses'); -} - -export function AccountTimeline () { - return import(/* webpackChunkName: "flavours/glitch/async/account_timeline" */'flavours/glitch/features/account_timeline'); -} - -export function AccountGallery () { - return import(/* webpackChunkName: "flavours/glitch/async/account_gallery" */'flavours/glitch/features/account_gallery'); -} - -export function Followers () { - return import(/* webpackChunkName: "flavours/glitch/async/followers" */'flavours/glitch/features/followers'); -} - -export function Following () { - return import(/* webpackChunkName: "flavours/glitch/async/following" */'flavours/glitch/features/following'); -} - -export function Reblogs () { - return import(/* webpackChunkName: "flavours/glitch/async/reblogs" */'flavours/glitch/features/reblogs'); -} - -export function Favourites () { - return import(/* webpackChunkName: "flavours/glitch/async/favourites" */'flavours/glitch/features/favourites'); -} - -export function FollowRequests () { - return import(/* webpackChunkName: "flavours/glitch/async/follow_requests" */'flavours/glitch/features/follow_requests'); -} - -export function FavouritedStatuses () { - return import(/* webpackChunkName: "flavours/glitch/async/favourited_statuses" */'flavours/glitch/features/favourited_statuses'); -} - -export function FollowedTags () { - return import(/* webpackChunkName: "flavours/glitch/async/followed_tags" */'flavours/glitch/features/followed_tags'); -} - -export function BookmarkedStatuses () { - return import(/* webpackChunkName: "flavours/glitch/async/bookmarked_statuses" */'flavours/glitch/features/bookmarked_statuses'); -} - -export function Blocks () { - return import(/* webpackChunkName: "flavours/glitch/async/blocks" */'flavours/glitch/features/blocks'); -} - -export function DomainBlocks () { - return import(/* webpackChunkName: "flavours/glitch/async/domain_blocks" */'flavours/glitch/features/domain_blocks'); -} - -export function Mutes () { - return import(/* webpackChunkName: "flavours/glitch/async/mutes" */'flavours/glitch/features/mutes'); -} - -export function MuteModal () { - return import(/* webpackChunkName: "flavours/glitch/async/mute_modal" */'flavours/glitch/features/ui/components/mute_modal'); -} - -export function BlockModal () { - return import(/* webpackChunkName: "flavours/glitch/async/block_modal" */'flavours/glitch/features/ui/components/block_modal'); -} - -export function ReportModal () { - return import(/* webpackChunkName: "flavours/glitch/async/report_modal" */'flavours/glitch/features/ui/components/report_modal'); -} - -export function SettingsModal () { - return import(/* webpackChunkName: "flavours/glitch/async/settings_modal" */'flavours/glitch/features/local_settings'); -} - -export function MediaGallery () { - return import(/* webpackChunkName: "flavours/glitch/async/media_gallery" */'flavours/glitch/components/media_gallery'); -} - -export function Video () { - return import(/* webpackChunkName: "flavours/glitch/async/video" */'flavours/glitch/features/video'); -} - -export function Audio () { - return import(/* webpackChunkName: "features/glitch/async/audio" */'flavours/glitch/features/audio'); -} - -export function EmbedModal () { - return import(/* webpackChunkName: "flavours/glitch/async/embed_modal" */'flavours/glitch/features/ui/components/embed_modal'); + return import(/* webpackChunkName: "flavours/glitch/async/getting_started" */'../../getting_started'); } export function GettingStartedMisc () { - return import(/* webpackChunkName: "flavours/glitch/async/getting_started_misc" */'flavours/glitch/features/getting_started_misc'); + return import(/* webpackChunkName: "flavours/glitch/async/getting_started_misc" */'../../getting_started_misc'); +} + +export function KeyboardShortcuts () { + return import(/* webpackChunkName: "flavours/glitch/async/keyboard_shortcuts" */'../../keyboard_shortcuts'); +} + +export function PinnedStatuses () { + return import(/* webpackChunkName: "flavours/glitch/async/pinned_statuses" */'../../pinned_statuses'); +} + +export function AccountTimeline () { + return import(/* webpackChunkName: "flavours/glitch/async/account_timeline" */'../../account_timeline'); +} + +export function AccountGallery () { + return import(/* webpackChunkName: "flavours/glitch/async/account_gallery" */'../../account_gallery'); +} + +export function Followers () { + return import(/* webpackChunkName: "flavours/glitch/async/followers" */'../../followers'); +} + +export function Following () { + return import(/* webpackChunkName: "flavours/glitch/async/following" */'../../following'); +} + +export function Reblogs () { + return import(/* webpackChunkName: "flavours/glitch/async/reblogs" */'../../reblogs'); +} + +export function Favourites () { + return import(/* webpackChunkName: "flavours/glitch/async/favourites" */'../../favourites'); +} + +export function FollowRequests () { + return import(/* webpackChunkName: "flavours/glitch/async/follow_requests" */'../../follow_requests'); +} + +export function FavouritedStatuses () { + return import(/* webpackChunkName: "flavours/glitch/async/favourited_statuses" */'../../favourited_statuses'); +} + +export function FollowedTags () { + return import(/* webpackChunkName: "flavours/glitch/async/followed_tags" */'../../followed_tags'); +} + +export function BookmarkedStatuses () { + return import(/* webpackChunkName: "flavours/glitch/async/bookmarked_statuses" */'../../bookmarked_statuses'); +} + +export function Blocks () { + return import(/* webpackChunkName: "flavours/glitch/async/blocks" */'../../blocks'); +} + +export function DomainBlocks () { + return import(/* webpackChunkName: "flavours/glitch/async/domain_blocks" */'../../domain_blocks'); +} + +export function Mutes () { + return import(/* webpackChunkName: "flavours/glitch/async/mutes" */'../../mutes'); +} + +export function MuteModal () { + return import(/* webpackChunkName: "flavours/glitch/async/mute_modal" */'../components/mute_modal'); +} + +export function BlockModal () { + return import(/* webpackChunkName: "flavours/glitch/async/block_modal" */'../components/block_modal'); +} + +export function ReportModal () { + return import(/* webpackChunkName: "flavours/glitch/async/report_modal" */'../components/report_modal'); +} + +export function SettingsModal () { + return import(/* webpackChunkName: "flavours/glitch/async/settings_modal" */'../../local_settings'); +} + +export function MediaGallery () { + return import(/* webpackChunkName: "flavours/glitch/async/media_gallery" */'../../../components/media_gallery'); +} + +export function Video () { + return import(/* webpackChunkName: "flavours/glitch/async/video" */'../../video'); +} + +export function EmbedModal () { + return import(/* webpackChunkName: "flavours/glitch/async/embed_modal" */'../components/embed_modal'); +} + +export function ListEditor () { + return import(/* webpackChunkName: "flavours/glitch/async/list_editor" */'../../list_editor'); } export function ListAdder () { - return import(/* webpackChunkName: "features/glitch/async/list_adder" */'flavours/glitch/features/list_adder'); + return import(/* webpackChunkName: "features/glitch/async/list_adder" */'../../list_adder'); } export function Tesseract () { return import(/*webpackChunkName: "tesseract" */'tesseract.js'); } +export function Audio () { + return import(/* webpackChunkName: "features/glitch/async/audio" */'../../audio'); +} + export function Directory () { - return import(/* webpackChunkName: "features/glitch/async/directory" */'flavours/glitch/features/directory'); + return import(/* webpackChunkName: "features/glitch/async/directory" */'../../directory'); } export function Onboarding () { - return import(/* webpackChunkName: "features/glitch/async/onboarding" */'flavours/glitch/features/onboarding'); + return import(/* webpackChunkName: "features/glitch/async/onboarding" */'../../onboarding'); } export function CompareHistoryModal () { - return import(/*webpackChunkName: "flavours/glitch/async/compare_history_modal" */'flavours/glitch/features/ui/components/compare_history_modal'); -} - -export function FilterModal () { - return import(/*webpackChunkName: "flavours/glitch/async/filter_modal" */'flavours/glitch/features/ui/components/filter_modal'); + return import(/*webpackChunkName: "flavours/glitch/async/compare_history_modal" */'../components/compare_history_modal'); } export function Explore () { - return import(/* webpackChunkName: "flavours/glitch/async/explore" */'flavours/glitch/features/explore'); + return import(/* webpackChunkName: "flavours/glitch/async/explore" */'../../explore'); +} + +export function FilterModal () { + return import(/*webpackChunkName: "flavours/glitch/async/filter_modal" */'../components/filter_modal'); } export function InteractionModal () { - return import(/*webpackChunkName: "flavours/glitch/async/modals/interaction_modal" */'flavours/glitch/features/interaction_modal'); + return import(/*webpackChunkName: "flavours/glitch/async/modals/interaction_modal" */'../../interaction_modal'); } export function SubscribedLanguagesModal () { - return import(/*webpackChunkName: "flavours/glitch/async/modals/subscribed_languages_modal" */'flavours/glitch/features/subscribed_languages_modal'); + return import(/*webpackChunkName: "flavours/glitch/async/modals/subscribed_languages_modal" */'../../subscribed_languages_modal'); } export function ClosedRegistrationsModal () { - return import(/*webpackChunkName: "flavours/glitch/async/modals/closed_registrations_modal" */'flavours/glitch/features/closed_registrations_modal'); + return import(/*webpackChunkName: "flavours/glitch/async/modals/closed_registrations_modal" */'../../closed_registrations_modal'); } export function About () { - return import(/*webpackChunkName: "features/glitch/async/about" */'flavours/glitch/features/about'); + return import(/*webpackChunkName: "features/glitch/async/about" */'../../about'); } export function PrivacyPolicy () { - return import(/*webpackChunkName: "features/glitch/async/privacy_policy" */'flavours/glitch/features/privacy_policy'); + return import(/*webpackChunkName: "features/glitch/async/privacy_policy" */'../../privacy_policy'); } diff --git a/app/javascript/flavours/glitch/images/elephant_ui_working.svg b/app/javascript/flavours/glitch/images/elephant_ui_working.svg deleted file mode 100644 index 8ba475db0a..0000000000 --- a/app/javascript/flavours/glitch/images/elephant_ui_working.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/app/javascript/flavours/glitch/initial_state.js b/app/javascript/flavours/glitch/initial_state.js index 15f2673fa2..93991b19cf 100644 --- a/app/javascript/flavours/glitch/initial_state.js +++ b/app/javascript/flavours/glitch/initial_state.js @@ -45,20 +45,11 @@ * @property {boolean=} use_pending_items * @property {string} version * @property {string} sso_redirect - * @property {boolean} translation_enabled * @property {string} status_page_url * @property {boolean} system_emoji_font * @property {string} default_content_type */ -/** @type {string} */ -const initialPath = document.querySelector("head meta[name=initialPath]")?.getAttribute("content") ?? ''; -/** @type {boolean} */ -export const hasMultiColumnPath = initialPath === '/' - || initialPath === '/getting-started' - || initialPath === '/home' - || initialPath.startsWith('/deck'); - /** * @typedef InitialState * @property {Record} accounts @@ -74,6 +65,14 @@ const element = document.getElementById('initial-state'); /** @type {InitialState | undefined} */ const initialState = element?.textContent && JSON.parse(element.textContent); +/** @type {string} */ +const initialPath = document.querySelector("head meta[name=initialPath]")?.getAttribute("content") ?? ''; +/** @type {boolean} */ +export const hasMultiColumnPath = initialPath === '/' + || initialPath === '/getting-started' + || initialPath === '/home' + || initialPath.startsWith('/deck'); + // Glitch-soc-specific “local settings” if (initialState) { try { diff --git a/app/javascript/flavours/glitch/reducers/settings.js b/app/javascript/flavours/glitch/reducers/settings.js index 59b2e5dd40..f5768aedc6 100644 --- a/app/javascript/flavours/glitch/reducers/settings.js +++ b/app/javascript/flavours/glitch/reducers/settings.js @@ -12,9 +12,6 @@ import { uuid } from '../uuid'; const initialState = ImmutableMap({ saved: true, - onboarded: false, - layout: 'auto', - skinTone: 1, trends: ImmutableMap({