Merge remote-tracking branch 'origin/develop' into oauth-consumer-strategies

This commit is contained in:
Alex Gleason 2022-08-15 12:10:54 -05:00
commit 5dc5407c12
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7
11 changed files with 36 additions and 41 deletions

View file

@ -444,7 +444,7 @@ const StatusActionBar: React.FC<IStatusActionBar> = ({
action: handleChatClick, action: handleChatClick,
icon: require('@tabler/icons/messages.svg'), icon: require('@tabler/icons/messages.svg'),
}); });
} else { } else if (features.privacyScopes) {
menu.push({ menu.push({
text: intl.formatMessage(messages.direct, { name: username }), text: intl.formatMessage(messages.direct, { name: username }),
action: handleDirectClick, action: handleDirectClick,

View file

@ -47,6 +47,7 @@ export interface IStatus {
featured?: boolean, featured?: boolean,
hideActionBar?: boolean, hideActionBar?: boolean,
hoverable?: boolean, hoverable?: boolean,
withDismiss?: boolean,
} }
const Status: React.FC<IStatus> = (props) => { const Status: React.FC<IStatus> = (props) => {
@ -63,6 +64,7 @@ const Status: React.FC<IStatus> = (props) => {
unread, unread,
group, group,
hideActionBar, hideActionBar,
withDismiss,
} = props; } = props;
const intl = useIntl(); const intl = useIntl();
const history = useHistory(); const history = useHistory();
@ -179,7 +181,7 @@ const Status: React.FC<IStatus> = (props) => {
}; };
if (!status) return null; if (!status) return null;
let prepend, rebloggedByText, reblogElement, reblogElementMobile; let rebloggedByText, reblogElement, reblogElementMobile;
if (hidden) { if (hidden) {
return ( return (
@ -205,20 +207,6 @@ const Status: React.FC<IStatus> = (props) => {
); );
} }
if (featured) {
prepend = (
<div className='pt-4 px-4'>
<HStack alignItems='center' space={1}>
<Icon src={require('@tabler/icons/pinned.svg')} className='text-gray-600 dark:text-gray-400' />
<Text size='sm' theme='muted' weight='medium'>
<FormattedMessage id='status.pinned' defaultMessage='Pinned post' />
</Text>
</HStack>
</div>
);
}
if (status.reblog && typeof status.reblog === 'object') { if (status.reblog && typeof status.reblog === 'object') {
const displayNameHtml = { __html: String(status.getIn(['account', 'display_name_html'])) }; const displayNameHtml = { __html: String(status.getIn(['account', 'display_name_html'])) };
@ -316,7 +304,17 @@ const Status: React.FC<IStatus> = (props) => {
onClick={() => history.push(statusUrl)} onClick={() => history.push(statusUrl)}
role='link' role='link'
> >
{prepend} {featured && (
<div className='pt-4 px-4'>
<HStack alignItems='center' space={1}>
<Icon src={require('@tabler/icons/pinned.svg')} className='text-gray-600 dark:text-gray-400' />
<Text size='sm' theme='muted' weight='medium'>
<FormattedMessage id='status.pinned' defaultMessage='Pinned post' />
</Text>
</HStack>
</div>
)}
<div <div
className={classNames('status__wrapper', `status-${actualStatus.visibility}`, { className={classNames('status__wrapper', `status-${actualStatus.visibility}`, {
@ -374,7 +372,7 @@ const Status: React.FC<IStatus> = (props) => {
{!hideActionBar && ( {!hideActionBar && (
<div className='pt-4'> <div className='pt-4'>
<StatusActionBar status={actualStatus} /> <StatusActionBar status={actualStatus} withDismiss={withDismiss} />
</div> </div>
)} )}
</div> </div>

View file

@ -122,7 +122,6 @@ const StatusList: React.FC<IStatusList> = ({
const renderStatus = (statusId: string) => { const renderStatus = (statusId: string) => {
return ( return (
// @ts-ignore
<StatusContainer <StatusContainer
key={statusId} key={statusId}
id={statusId} id={statusId}
@ -157,7 +156,6 @@ const StatusList: React.FC<IStatusList> = ({
if (!featuredStatusIds) return []; if (!featuredStatusIds) return [];
return featuredStatusIds.toArray().map(statusId => ( return featuredStatusIds.toArray().map(statusId => (
// @ts-ignore
<StatusContainer <StatusContainer
key={`f-${statusId}`} key={`f-${statusId}`}
id={statusId} id={statusId}

View file

@ -4,15 +4,13 @@ import Status, { IStatus } from 'soapbox/components/status';
import { useAppSelector } from 'soapbox/hooks'; import { useAppSelector } from 'soapbox/hooks';
import { makeGetStatus } from 'soapbox/selectors'; import { makeGetStatus } from 'soapbox/selectors';
interface IStatusContainer extends Omit<IStatus, 'id'> { interface IStatusContainer extends Omit<IStatus, 'status'> {
id: string, id: string,
/** @deprecated Unused. */ /** @deprecated Unused. */
contextType?: any, contextType?: any,
/** @deprecated Unused. */ /** @deprecated Unused. */
otherAccounts?: any, otherAccounts?: any,
/** @deprecated Unused. */ /** @deprecated Unused. */
withDismiss?: any,
/** @deprecated Unused. */
getScrollPosition?: any, getScrollPosition?: any,
/** @deprecated Unused. */ /** @deprecated Unused. */
updateScrollBottom?: any, updateScrollBottom?: any,
@ -24,11 +22,12 @@ const getStatus = makeGetStatus();
* Legacy Status wrapper accepting a status ID instead of the full entity. * Legacy Status wrapper accepting a status ID instead of the full entity.
* @deprecated Use the Status component directly. * @deprecated Use the Status component directly.
*/ */
const StatusContainer: React.FC<IStatusContainer> = ({ id, onMoveUp, onMoveDown }) => { const StatusContainer: React.FC<IStatusContainer> = (props) => {
const { id, ...rest } = props;
const status = useAppSelector(state => getStatus(state, { id })); const status = useAppSelector(state => getStatus(state, { id }));
if (status) { if (status) {
return <Status status={status} onMoveUp={onMoveUp} onMoveDown={onMoveDown} />; return <Status status={status} {...rest} />;
} else { } else {
return null; return null;
} }

View file

@ -65,7 +65,7 @@ const AccountTimeline: React.FC<IAccountTimeline> = ({ params, withReplies = fal
if (account) { if (account) {
dispatch(expandAccountTimeline(account.id, { withReplies })); dispatch(expandAccountTimeline(account.id, { withReplies }));
} }
}, [account?.id]); }, [account?.id, withReplies]);
const handleLoadMore = (maxId: string) => { const handleLoadMore = (maxId: string) => {
if (account) { if (account) {

View file

@ -18,7 +18,7 @@ import { makeGetNotification } from 'soapbox/selectors';
import { NotificationType, validType } from 'soapbox/utils/notification'; import { NotificationType, validType } from 'soapbox/utils/notification';
import type { ScrollPosition } from 'soapbox/components/status'; import type { ScrollPosition } from 'soapbox/components/status';
import type { Account, Status, Notification as NotificationEntity } from 'soapbox/types/entities'; import type { Account, Status as StatusEntity, Notification as NotificationEntity } from 'soapbox/types/entities';
const getNotification = makeGetNotification(); const getNotification = makeGetNotification();
@ -143,7 +143,7 @@ interface INotificaton {
notification: NotificationEntity, notification: NotificationEntity,
onMoveUp?: (notificationId: string) => void, onMoveUp?: (notificationId: string) => void,
onMoveDown?: (notificationId: string) => void, onMoveDown?: (notificationId: string) => void,
onReblog?: (status: Status, e?: KeyboardEvent) => void, onReblog?: (status: StatusEntity, e?: KeyboardEvent) => void,
getScrollPosition?: () => ScrollPosition | undefined, getScrollPosition?: () => ScrollPosition | undefined,
updateScrollBottom?: (bottom: number) => void, updateScrollBottom?: (bottom: number) => void,
} }
@ -216,7 +216,7 @@ const Notification: React.FC<INotificaton> = (props) => {
if (e?.shiftKey || !boostModal) { if (e?.shiftKey || !boostModal) {
dispatch(reblog(status)); dispatch(reblog(status));
} else { } else {
dispatch(openModal('BOOST', { status, onReblog: (status: Status) => { dispatch(openModal('BOOST', { status, onReblog: (status: StatusEntity) => {
dispatch(reblog(status)); dispatch(reblog(status));
} })); } }));
} }
@ -303,16 +303,12 @@ const Notification: React.FC<INotificaton> = (props) => {
case 'update': case 'update':
case 'pleroma:emoji_reaction': case 'pleroma:emoji_reaction':
return status && typeof status === 'object' ? ( return status && typeof status === 'object' ? (
// @ts-ignore
<StatusContainer <StatusContainer
id={status.id} id={status.id}
withDismiss withDismiss
hidden={hidden} hidden={hidden}
onMoveDown={handleMoveDown} onMoveDown={handleMoveDown}
onMoveUp={handleMoveUp} onMoveUp={handleMoveUp}
contextType='notifications'
getScrollPosition={props.getScrollPosition}
updateScrollBottom={props.updateScrollBottom}
/> />
) : null; ) : null;
default: default:

View file

@ -5,7 +5,7 @@ import Icon from 'soapbox/components/icon';
import StatusMedia from 'soapbox/components/status-media'; import StatusMedia from 'soapbox/components/status-media';
import StatusReplyMentions from 'soapbox/components/status-reply-mentions'; import StatusReplyMentions from 'soapbox/components/status-reply-mentions';
import StatusContent from 'soapbox/components/status_content'; import StatusContent from 'soapbox/components/status_content';
import { HStack, Text } from 'soapbox/components/ui'; import { HStack, Stack, Text } from 'soapbox/components/ui';
import AccountContainer from 'soapbox/containers/account_container'; import AccountContainer from 'soapbox/containers/account_container';
import QuotedStatus from 'soapbox/features/status/containers/quoted_status_container'; import QuotedStatus from 'soapbox/features/status/containers/quoted_status_container';
import { getActualStatus } from 'soapbox/utils/status'; import { getActualStatus } from 'soapbox/utils/status';
@ -65,9 +65,9 @@ const DetailedStatus: React.FC<IDetailedStatus> = ({
} }
if (actualStatus.visibility === 'direct') { if (actualStatus.visibility === 'direct') {
statusTypeIcon = <Icon src={require('@tabler/icons/mail.svg')} />; statusTypeIcon = <Icon className='text-gray-700 dark:text-gray-600' src={require('@tabler/icons/mail.svg')} />;
} else if (actualStatus.visibility === 'private') { } else if (actualStatus.visibility === 'private') {
statusTypeIcon = <Icon src={require('@tabler/icons/lock.svg')} />; statusTypeIcon = <Icon className='text-gray-700 dark:text-gray-600' src={require('@tabler/icons/lock.svg')} />;
} }
return ( return (
@ -102,7 +102,7 @@ const DetailedStatus: React.FC<IDetailedStatus> = ({
<HStack justifyContent='between' alignItems='center' className='py-2'> <HStack justifyContent='between' alignItems='center' className='py-2'>
<StatusInteractionBar status={actualStatus} /> <StatusInteractionBar status={actualStatus} />
<div className='detailed-actualStatus__timestamp'> <Stack space={1} alignItems='center'>
{statusTypeIcon} {statusTypeIcon}
<span> <span>
@ -128,7 +128,7 @@ const DetailedStatus: React.FC<IDetailedStatus> = ({
</> </>
)} )}
</span> </span>
</div> </Stack>
</HStack> </HStack>
</div> </div>
</div> </div>

View file

@ -304,7 +304,7 @@
li:not(:empty) { li:not(:empty) {
a, a,
button { button {
@apply flex items-center px-4 py-3 text-gray-600 dark:text-gray-300 no-underline hover:bg-gray-100 dark:bg-gray-800 hover:text-gray-800 dark:hover:text-gray-200; @apply flex items-center px-4 py-3 text-gray-600 dark:text-gray-300 no-underline hover:bg-gray-100 dark:bg-gray-800 hover:text-gray-800 dark:hover:text-gray-200 text-left;
&.destructive { &.destructive {
@apply text-danger-600; @apply text-danger-600;
@ -325,7 +325,7 @@
} }
button[type="button"] { button[type="button"] {
@apply w-full justify-center; @apply w-full justify-center text-center;
} }
} }
} }

0
custom/modules/.gitkeep Normal file
View file

View file

@ -66,7 +66,10 @@ module.exports = [{
}, { }, {
test: /\.svg$/, test: /\.svg$/,
type: 'asset/resource', type: 'asset/resource',
include: resolve('node_modules', '@tabler'), include: [
resolve('node_modules', '@tabler'),
resolve('custom', 'modules', '@tabler'),
],
generator: { generator: {
filename: 'packs/icons/[name]-[contenthash:8][ext]', filename: 'packs/icons/[name]-[contenthash:8][ext]',
}, },

View file

@ -141,6 +141,7 @@ module.exports = {
resolve: { resolve: {
extensions: settings.extensions, extensions: settings.extensions,
modules: [ modules: [
resolve('custom', 'modules'),
resolve(settings.source_path), resolve(settings.source_path),
'node_modules', 'node_modules',
], ],