Remove more unused code
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
b9e5358cd7
commit
9a089bb168
21 changed files with 37 additions and 264 deletions
|
@ -9,10 +9,9 @@ import api, { getLinks } from '../api';
|
|||
import { fetchRelationships } from './accounts';
|
||||
import { importFetchedAccounts, importFetchedStatus } from './importer';
|
||||
import { openModal } from './modals';
|
||||
import { expandGroupFeaturedTimeline } from './timelines';
|
||||
|
||||
import type { AppDispatch, RootState } from 'soapbox/store';
|
||||
import type { APIEntity, Group, Status as StatusEntity } from 'soapbox/types/entities';
|
||||
import type { APIEntity, Status as StatusEntity } from 'soapbox/types/entities';
|
||||
|
||||
const REBLOG_REQUEST = 'REBLOG_REQUEST';
|
||||
const REBLOG_SUCCESS = 'REBLOG_SUCCESS';
|
||||
|
@ -629,20 +628,6 @@ const pin = (status: StatusEntity) =>
|
|||
});
|
||||
};
|
||||
|
||||
const pinToGroup = (status: StatusEntity, group: Group) =>
|
||||
(dispatch: AppDispatch, getState: () => RootState) => {
|
||||
return api(getState)
|
||||
.post(`/api/v1/groups/${group.id}/statuses/${status.id}/pin`)
|
||||
.then(() => dispatch(expandGroupFeaturedTimeline(group.id)));
|
||||
};
|
||||
|
||||
const unpinFromGroup = (status: StatusEntity, group: Group) =>
|
||||
(dispatch: AppDispatch, getState: () => RootState) => {
|
||||
return api(getState)
|
||||
.post(`/api/v1/groups/${group.id}/statuses/${status.id}/unpin`)
|
||||
.then(() => dispatch(expandGroupFeaturedTimeline(group.id)));
|
||||
};
|
||||
|
||||
const pinRequest = (status: StatusEntity) => ({
|
||||
type: PIN_REQUEST,
|
||||
status,
|
||||
|
@ -855,8 +840,6 @@ export {
|
|||
unpinSuccess,
|
||||
unpinFail,
|
||||
togglePin,
|
||||
pinToGroup,
|
||||
unpinFromGroup,
|
||||
remoteInteraction,
|
||||
remoteInteractionRequest,
|
||||
remoteInteractionSuccess,
|
||||
|
|
|
@ -85,7 +85,7 @@ const LocationSearch: React.FC<ILocationSearch> = ({ onSelected }) => {
|
|||
}, [value]);
|
||||
|
||||
return (
|
||||
<div className='search'>
|
||||
<div className='relative'>
|
||||
<AutosuggestInput
|
||||
className='rounded-full'
|
||||
placeholder={intl.formatMessage(messages.placeholder)}
|
||||
|
|
|
@ -6,7 +6,7 @@ import { blockAccount } from 'soapbox/actions/accounts';
|
|||
import { launchChat } from 'soapbox/actions/chats';
|
||||
import { directCompose, mentionCompose, quoteCompose, replyCompose } from 'soapbox/actions/compose';
|
||||
import { editEvent } from 'soapbox/actions/events';
|
||||
import { pinToGroup, toggleBookmark, toggleDislike, toggleFavourite, togglePin, toggleReblog, unpinFromGroup, zap } from 'soapbox/actions/interactions';
|
||||
import { toggleBookmark, toggleDislike, toggleFavourite, togglePin, toggleReblog, zap } from 'soapbox/actions/interactions';
|
||||
import { openModal } from 'soapbox/actions/modals';
|
||||
import { deleteStatusModal, toggleStatusSensitivityModal } from 'soapbox/actions/moderation';
|
||||
import { initMuteModal } from 'soapbox/actions/mutes';
|
||||
|
@ -72,8 +72,6 @@ const messages = defineMessages({
|
|||
muteConversation: { id: 'status.mute_conversation', defaultMessage: 'Mute Conversation' },
|
||||
open: { id: 'status.open', defaultMessage: 'Show Post Details' },
|
||||
pin: { id: 'status.pin', defaultMessage: 'Pin on profile' },
|
||||
pinToGroup: { id: 'status.pin_to_group', defaultMessage: 'Pin to Group' },
|
||||
pinToGroupSuccess: { id: 'status.pin_to_group.success', defaultMessage: 'Pinned to Group!' },
|
||||
quotePost: { id: 'status.quote', defaultMessage: 'Quote post' },
|
||||
reactionCry: { id: 'status.reactions.cry', defaultMessage: 'Sad' },
|
||||
reactionHeart: { id: 'status.reactions.heart', defaultMessage: 'Love' },
|
||||
|
@ -97,7 +95,6 @@ const messages = defineMessages({
|
|||
unbookmark: { id: 'status.unbookmark', defaultMessage: 'Remove bookmark' },
|
||||
unmuteConversation: { id: 'status.unmute_conversation', defaultMessage: 'Unmute Conversation' },
|
||||
unpin: { id: 'status.unpin', defaultMessage: 'Unpin from profile' },
|
||||
unpinFromGroup: { id: 'status.unpin_to_group', defaultMessage: 'Unpin from Group' },
|
||||
zap: { id: 'status.zap', defaultMessage: 'Zap' },
|
||||
});
|
||||
|
||||
|
@ -255,18 +252,6 @@ const StatusActionBar: React.FC<IStatusActionBar> = ({
|
|||
dispatch(togglePin(status));
|
||||
};
|
||||
|
||||
const handleGroupPinClick: React.EventHandler<React.MouseEvent> = () => {
|
||||
const group = status.group as Group;
|
||||
|
||||
if (status.pinned) {
|
||||
dispatch(unpinFromGroup(status, group));
|
||||
} else {
|
||||
dispatch(pinToGroup(status, group))
|
||||
.then(() => toast.success(intl.formatMessage(messages.pinToGroupSuccess)))
|
||||
.catch(() => null);
|
||||
}
|
||||
};
|
||||
|
||||
const handleMentionClick: React.EventHandler<React.MouseEvent> = (e) => {
|
||||
dispatch(mentionCompose(status.account));
|
||||
};
|
||||
|
@ -404,17 +389,6 @@ const StatusActionBar: React.FC<IStatusActionBar> = ({
|
|||
}
|
||||
|
||||
const isGroupStatus = typeof status.group === 'object';
|
||||
if (isGroupStatus && !!status.group) {
|
||||
const isGroupOwner = groupRelationship?.role === GroupRoles.OWNER;
|
||||
|
||||
if (isGroupOwner) {
|
||||
menu.push({
|
||||
text: intl.formatMessage(status.pinned ? messages.unpinFromGroup : messages.pinToGroup),
|
||||
action: handleGroupPinClick,
|
||||
icon: status.pinned ? require('@tabler/icons/outline/pinned-off.svg') : require('@tabler/icons/outline/pin.svg'),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (features.bookmarks) {
|
||||
menu.push({
|
||||
|
|
|
@ -47,18 +47,18 @@ const Aliases = () => {
|
|||
const emptyMessage = <FormattedMessage id='empty_column.aliases' defaultMessage="You haven't created any account alias yet." />;
|
||||
|
||||
return (
|
||||
<Column className='aliases-settings-panel' label={intl.formatMessage(messages.heading)}>
|
||||
<Column className='flex-1' label={intl.formatMessage(messages.heading)}>
|
||||
<CardHeader>
|
||||
<CardTitle title={intl.formatMessage(messages.subheading_add_new)} />
|
||||
</CardHeader>
|
||||
<Search />
|
||||
{
|
||||
loaded && searchAccountIds.size === 0 ? (
|
||||
<div className='aliases__accounts empty-column-indicator'>
|
||||
<div className='empty-column-indicator'>
|
||||
<FormattedMessage id='empty_column.aliases.suggestions' defaultMessage='There are no account suggestions available for the provided term.' />
|
||||
</div>
|
||||
) : (
|
||||
<div className='aliases__accounts mb-4'>
|
||||
<div className='mb-4 overflow-y-auto'>
|
||||
{searchAccountIds.map(accountId => <Account key={accountId} accountId={accountId} aliases={aliases} />)}
|
||||
</div>
|
||||
)
|
||||
|
@ -66,7 +66,7 @@ const Aliases = () => {
|
|||
<CardHeader>
|
||||
<CardTitle title={intl.formatMessage(messages.subheading_aliases)} />
|
||||
</CardHeader>
|
||||
<div className='aliases-settings-panel'>
|
||||
<div className='flex-1'>
|
||||
<ScrollableList
|
||||
scrollKey='aliases'
|
||||
emptyMessage={emptyMessage}
|
||||
|
|
|
@ -13,11 +13,6 @@ import type { ChatMessage as ChatMessageEntity } from 'soapbox/types/entities';
|
|||
|
||||
const messages = defineMessages({
|
||||
today: { id: 'chats.dividers.today', defaultMessage: 'Today' },
|
||||
more: { id: 'chats.actions.more', defaultMessage: 'More' },
|
||||
delete: { id: 'chats.actions.delete', defaultMessage: 'Delete for both' },
|
||||
copy: { id: 'chats.actions.copy', defaultMessage: 'Copy' },
|
||||
report: { id: 'chats.actions.report', defaultMessage: 'Report' },
|
||||
deleteForMe: { id: 'chats.actions.delete_for_me', defaultMessage: 'Delete for me' },
|
||||
blockedBy: { id: 'chat_message_list.blocked_by', defaultMessage: 'You are blocked by' },
|
||||
networkFailureTitle: { id: 'chat_message_list.network_failure.title', defaultMessage: 'Whoops!' },
|
||||
networkFailureSubtitle: { id: 'chat_message_list.network_failure.subtitle', defaultMessage: 'We encountered a network failure.' },
|
||||
|
|
|
@ -24,7 +24,6 @@ const messages = defineMessages({
|
|||
delete: { id: 'chats.actions.delete', defaultMessage: 'Delete for both' },
|
||||
deleteForMe: { id: 'chats.actions.delete_for_me', defaultMessage: 'Delete for me' },
|
||||
more: { id: 'chats.actions.more', defaultMessage: 'More' },
|
||||
report: { id: 'chats.actions.report', defaultMessage: 'Report' },
|
||||
});
|
||||
|
||||
const BIG_EMOJI_LIMIT = 3;
|
||||
|
|
|
@ -27,7 +27,6 @@ const messages = defineMessages({
|
|||
leaveConfirm: { id: 'chat_settings.leave.confirm', defaultMessage: 'Leave Chat' },
|
||||
blockUser: { id: 'chat_settings.options.block_user', defaultMessage: 'Block @{acct}' },
|
||||
unblockUser: { id: 'chat_settings.options.unblock_user', defaultMessage: 'Unblock @{acct}' },
|
||||
reportUser: { id: 'chat_settings.options.report_user', defaultMessage: 'Report @{acct}' },
|
||||
leaveChat: { id: 'chat_settings.options.leave_chat', defaultMessage: 'Leave Chat' },
|
||||
});
|
||||
|
||||
|
|
|
@ -538,7 +538,7 @@ const AutosuggestPlugin = ({
|
|||
? ReactDOM.createPortal(
|
||||
<div
|
||||
className={clsx({
|
||||
'scroll-smooth snap-y snap-always will-change-scroll mt-6 overflow-y-auto max-h-56 relative w-max z-1000 shadow bg-white dark:bg-gray-900 rounded-lg py-1 space-y-0 dark:ring-2 dark:ring-primary-700 focus:outline-none': true,
|
||||
'scroll-smooth snap-y snap-always will-change-scroll mt-6 overflow-y-auto max-h-56 relative w-max z-[1000] shadow bg-white dark:bg-gray-900 rounded-lg py-1 space-y-0 dark:ring-2 dark:ring-primary-700 focus:outline-none': true,
|
||||
hidden: suggestionsHidden || suggestions.isEmpty(),
|
||||
block: !suggestionsHidden && !suggestions.isEmpty(),
|
||||
})}
|
||||
|
|
|
@ -17,7 +17,6 @@ const messages = defineMessages({
|
|||
confirmationMessage: { id: 'confirmations.leave_group.message', defaultMessage: 'You are about to leave the group. Do you want to continue?' },
|
||||
leave: { id: 'group.leave.label', defaultMessage: 'Leave' },
|
||||
leaveSuccess: { id: 'group.leave.success', defaultMessage: 'Left the group' },
|
||||
report: { id: 'group.report.label', defaultMessage: 'Report' },
|
||||
share: { id: 'group.share.label', defaultMessage: 'Share' },
|
||||
});
|
||||
|
||||
|
|
|
@ -77,15 +77,6 @@ const GroupTimeline: React.FC<IGroupTimeline> = (props) => {
|
|||
shouldCondense
|
||||
autoFocus={false}
|
||||
group={groupId}
|
||||
extra={!group.locked && (
|
||||
<HStack alignItems='center' space={4}>
|
||||
<label className='ml-auto cursor-pointer' htmlFor='group-timeline-visible'>
|
||||
<Text theme='muted'>
|
||||
<FormattedMessage id='compose_group.share_to_followers' defaultMessage='Share with my followers' />
|
||||
</Text>
|
||||
</label>
|
||||
</HStack>
|
||||
)}
|
||||
/>
|
||||
</HStack>
|
||||
</div>
|
||||
|
|
|
@ -19,7 +19,6 @@ const messages = defineMessages({
|
|||
all: { id: 'group.tabs.all', defaultMessage: 'All' },
|
||||
members: { id: 'group.tabs.members', defaultMessage: 'Members' },
|
||||
media: { id: 'group.tabs.media', defaultMessage: 'Media' },
|
||||
tags: { id: 'group.tabs.tags', defaultMessage: 'Topics' },
|
||||
});
|
||||
|
||||
interface IGroupPage {
|
||||
|
|
|
@ -4,13 +4,11 @@
|
|||
@import 'loading';
|
||||
@import 'ui';
|
||||
@import 'emoji-picker';
|
||||
@import 'rtl';
|
||||
@import 'accessibility';
|
||||
@import 'navigation';
|
||||
@import 'autosuggest';
|
||||
|
||||
// COMPONENTS
|
||||
@import 'components/buttons';
|
||||
@import 'components/modal';
|
||||
@import 'components/compose-form';
|
||||
@import 'components/status';
|
||||
|
|
|
@ -1,26 +1,3 @@
|
|||
.react-datepicker__input-container input {
|
||||
// display: block;
|
||||
// box-sizing: border-box;
|
||||
// width: 100%;
|
||||
// margin: 0;
|
||||
// background: transparent;
|
||||
// color: var(--primary-text-color);
|
||||
// padding: 10px;
|
||||
// font-family: inherit;
|
||||
// font-size: 16px;
|
||||
// resize: vertical;
|
||||
// border: 0;
|
||||
// outline: 0;
|
||||
|
||||
// &:focus {
|
||||
// outline: 0;
|
||||
// }
|
||||
|
||||
// @media screen and (max-width: 600px) {
|
||||
// font-size: 16px;
|
||||
// }
|
||||
}
|
||||
|
||||
.autosuggest-emoji {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
|
|
|
@ -1,14 +1,3 @@
|
|||
.aliases {
|
||||
&__accounts {
|
||||
overflow-y: auto;
|
||||
|
||||
&.empty-column-indicator {
|
||||
min-height: unset;
|
||||
overflow-y: unset;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.aliases-settings-panel {
|
||||
flex: 1;
|
||||
.aliases__accounts.empty-column-indicator {
|
||||
min-height: unset;
|
||||
}
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
button {
|
||||
font-family: inherit;
|
||||
cursor: pointer;
|
||||
|
||||
&:focus {
|
||||
outline: none;
|
||||
}
|
||||
}
|
|
@ -29,18 +29,6 @@
|
|||
font-family: inherit;
|
||||
}
|
||||
|
||||
&__upload-wrapper { overflow: hidden; }
|
||||
|
||||
&__uploads-wrapper {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
|
||||
&.contains-media {
|
||||
padding: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
&__upload {
|
||||
flex: 1 1 0;
|
||||
min-width: 40%;
|
||||
|
@ -49,18 +37,6 @@
|
|||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
|
||||
&__actions {
|
||||
@apply p-2 bg-gradient-to-b from-gray-900/80 via-gray-900/50 to-transparent flex items-start gap-2 justify-end opacity-0 transition-opacity duration-100 ease-linear;
|
||||
|
||||
&.active {
|
||||
@apply opacity-100;
|
||||
}
|
||||
|
||||
.icon-button {
|
||||
@apply text-gray-200 hover:text-white text-sm font-medium p-2.5 space-x-1 rtl:space-x-reverse flex items-center;
|
||||
}
|
||||
}
|
||||
|
||||
&-description {
|
||||
@apply bg-gradient-to-b from-transparent via-gray-900/50 to-gray-900/80 absolute z-[2px] bottom-0 left-0 right-0 p-2.5 opacity-0 transition-opacity duration-100 ease-linear;
|
||||
|
||||
|
@ -93,25 +69,25 @@
|
|||
object-fit: cover;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&__upload-thumbnail {
|
||||
background-position: center;
|
||||
background-size: contain;
|
||||
background-repeat: no-repeat;
|
||||
height: 160px;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
|
||||
&.video {
|
||||
background-image: url('../assets/images/video-placeholder.png');
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
&.audio {
|
||||
background-image: url('../assets/images/audio-placeholder.png');
|
||||
background-size: cover;
|
||||
|
||||
&-thumbnail {
|
||||
background-position: center;
|
||||
background-size: contain;
|
||||
background-repeat: no-repeat;
|
||||
height: 160px;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
|
||||
&.video {
|
||||
background-image: url('../assets/images/video-placeholder.png');
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
&.audio {
|
||||
background-image: url('../assets/images/audio-placeholder.png');
|
||||
background-size: cover;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,54 +29,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
.error-modal {
|
||||
@apply text-gray-900;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
&__body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 80vh;
|
||||
width: 80vw;
|
||||
max-width: 520px;
|
||||
max-height: 420px;
|
||||
position: relative;
|
||||
text-align: center;
|
||||
|
||||
& > div {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
padding: 25px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
opacity: 0;
|
||||
user-select: text;
|
||||
}
|
||||
}
|
||||
|
||||
&__footer {
|
||||
flex: 0 0 auto;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 25px;
|
||||
|
||||
& > div {
|
||||
min-width: 33px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.actions-modal {
|
||||
@apply flex-col relative text-gray-400 overflow-hidden w-full max-w-lg m-auto bg-white black:bg-black dark:bg-gray-900 shadow-xl rounded-2xl;
|
||||
max-height: calc(100vh - 3rem);
|
||||
|
|
|
@ -1,7 +1,3 @@
|
|||
.search {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.search__icon {
|
||||
&::-moz-focus-inner {
|
||||
border: 0;
|
||||
|
@ -30,15 +26,15 @@
|
|||
pointer-events: auto;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.svg-icon--search.active {
|
||||
pointer-events: none;
|
||||
}
|
||||
&--search.active {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.svg-icon--backspace {
|
||||
cursor: pointer;
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
&--backspace {
|
||||
cursor: pointer;
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,30 +11,5 @@
|
|||
|
||||
&__link {
|
||||
@apply px-2 py-2.5 space-y-1 flex flex-col flex-1 items-center text-gray-600 text-lg;
|
||||
|
||||
// padding: 8px 10px;
|
||||
// display: flex;
|
||||
// flex-direction: column;
|
||||
// align-items: center;
|
||||
// justify-content: end;
|
||||
// color: var(--primary-text-color);
|
||||
// text-decoration: none;
|
||||
// font-size: 20px;
|
||||
// width: 55px;
|
||||
|
||||
// span {
|
||||
// margin-top: 1px;
|
||||
// text-align: center;
|
||||
// font-size: 1.2rem;
|
||||
// }
|
||||
|
||||
// .svg-icon {
|
||||
// width: 24px;
|
||||
// height: 24px;
|
||||
|
||||
// svg {
|
||||
// stroke-width: 1px;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
body.rtl {
|
||||
direction: rtl;
|
||||
|
||||
.status {
|
||||
padding-left: 10px;
|
||||
padding-right: 68px;
|
||||
}
|
||||
|
||||
.table th,
|
||||
.table td {
|
||||
text-align: right;
|
||||
}
|
||||
}
|
|
@ -1,11 +1,3 @@
|
|||
.w-10i {
|
||||
width: 2.5rem !important;
|
||||
}
|
||||
|
||||
.z-1000 {
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.divide-x-dot > *:not(:last-child)::after {
|
||||
content: '·';
|
||||
padding-right: 4px;
|
||||
|
|
Loading…
Reference in a new issue