diff --git a/packages/pl-api/lib/client.ts b/packages/pl-api/lib/client.ts index 8ef031a25..6eded1f83 100644 --- a/packages/pl-api/lib/client.ts +++ b/packages/pl-api/lib/client.ts @@ -5267,7 +5267,7 @@ class PlApiClient { public readonly events = { /** * Creates an event - * @see {@link https://github.com/mkljczk/pl/blob/fork/docs/development/API/pleroma_api.md#apiv1pleromaevents} + * @see {@link https://codeberg.org/mkljczk/nicolex/src/branch/develop/docs/development/API/pleroma_api.md#api-v1-pleroma-events} */ createEvent: async (params: CreateEventParams) => { const response = await this.request('/api/v1/pleroma/events', { method: 'POST', body: params }); @@ -5277,7 +5277,7 @@ class PlApiClient { /** * Edits an event - * @see {@link https://github.com/mkljczk/pl/blob/fork/docs/development/API/pleroma_api.md#apiv1pleromaeventsid} + * @see {@link https://codeberg.org/mkljczk/nicolex/src/branch/develop/docs/development/API/pleroma_api.md#api-v1-pleroma-events-id} */ editEvent: async (statusId: string, params: EditEventParams) => { const response = await this.request(`/api/v1/pleroma/events/${statusId}`, { method: 'PUT', body: params }); @@ -5287,21 +5287,21 @@ class PlApiClient { /** * Gets user's joined events - * @see {@link https://github.com/mkljczk/pl/blob/fork/docs/development/API/pleroma_api.md#apiv1pleromaeventsjoined_events} + * @see {@link https://codeberg.org/mkljczk/nicolex/src/branch/develop/docs/development/API/pleroma_api.md#api-v1-pleroma-events-joined_events} */ getJoinedEvents: async (state?: 'pending' | 'reject' | 'accept', params?: GetJoinedEventsParams) => this.#paginatedGet('/api/v1/pleroma/events/joined_events', { params: { ...params, state } }, statusSchema), /** * Gets event participants - * @see {@link https://github.com/mkljczk/pl/blob/fork/docs/development/API/pleroma_api.md#apiv1pleromaeventsidparticipations} + * @see {@link https://codeberg.org/mkljczk/nicolex/src/branch/develop/docs/development/API/pleroma_api.md#api-v1-pleroma-events-id-participations} */ getEventParticipations: async (statusId: string, params?: GetEventParticipationsParams) => this.#paginatedGet(`/api/v1/pleroma/events/${statusId}/participations`, { params }, accountSchema), /** * Gets event participation requests - * @see {@link https://github.com/mkljczk/pl/blob/fork/docs/development/API/pleroma_api.md#apiv1pleromaeventsidparticipation_requests} + * @see {@link https://codeberg.org/mkljczk/nicolex/src/branch/develop/docs/development/API/pleroma_api.md#api-v1-pleroma-events-id-participation_requests} */ getEventParticipationRequests: async (statusId: string, params?: GetEventParticipationRequestsParams) => this.#paginatedGet(`/api/v1/pleroma/events/${statusId}/participation_requests`, { params }, v.object({ @@ -5311,7 +5311,7 @@ class PlApiClient { /** * Accepts user to the event - * @see {@link https://github.com/mkljczk/pl/blob/fork/docs/development/API/pleroma_api.md#apiv1pleromaeventsidparticipation_requestsparticipant_idauthorize} + * @see {@link https://codeberg.org/mkljczk/nicolex/src/branch/develop/docs/development/API/pleroma_api.md#api-v1-pleroma-events-id-participation_requests-participant_id-authorize} */ acceptEventParticipationRequest: async (statusId: string, accountId: string) => { const response = await this.request(`/api/v1/pleroma/events/${statusId}/participation_requests/${accountId}/authorize`, { method: 'POST' }); @@ -5321,7 +5321,7 @@ class PlApiClient { /** * Rejects user from the event - * @see {@link https://github.com/mkljczk/pl/blob/fork/docs/development/API/pleroma_api.md#rejects-user-from-the-event} + * @see {@link https://codeberg.org/mkljczk/nicolex/src/branch/develop/docs/development/API/pleroma_api.md#api-v1-pleroma-events-id-participation_requests-participant_id-reject} */ rejectEventParticipationRequest: async (statusId: string, accountId: string) => { const response = await this.request(`/api/v1/pleroma/events/${statusId}/participation_requests/${accountId}/reject`, { method: 'POST' }); @@ -5331,7 +5331,7 @@ class PlApiClient { /** * Joins the event - * @see {@link https://github.com/mkljczk/pl/blob/fork/docs/development/API/pleroma_api.md#joins-the-event} + * @see {@link https://codeberg.org/mkljczk/nicolex/src/branch/develop/docs/development/API/pleroma_api.md#api-v1-pleroma-events-id-join} */ joinEvent: async (statusId: string, participation_message?: string) => { const response = await this.request(`/api/v1/pleroma/events/${statusId}/join`, { method: 'POST', body: { participation_message } }); @@ -5341,7 +5341,7 @@ class PlApiClient { /** * Leaves the event - * @see {@link https://github.com/mkljczk/pl/blob/fork/docs/development/API/pleroma_api.md#leaves-the-event} + * @see {@link https://codeberg.org/mkljczk/nicolex/src/branch/develop/docs/development/API/pleroma_api.md#api-v1-pleroma-events-id-leave} */ leaveEvent: async (statusId: string) => { const response = await this.request(`/api/v1/pleroma/events/${statusId}/leave`, { method: 'POST' }); @@ -5351,7 +5351,7 @@ class PlApiClient { /** * Event ICS file - * @see {@link https://github.com/mkljczk/pl/blob/fork/docs/development/API/pleroma_api.md#event-ics-file} + * @see {@link https://codeberg.org/mkljczk/nicolex/src/branch/develop/docs/development/API/pleroma_api.md#event-ics-file} */ getEventIcs: async (statusId: string) => { const response = await this.request(`/api/v1/pleroma/events/${statusId}/ics`, { contentType: '' }); diff --git a/packages/pl-fe/src/components/quoted-status.tsx b/packages/pl-fe/src/components/quoted-status.tsx index 157cd67fa..48a58aec0 100644 --- a/packages/pl-fe/src/components/quoted-status.tsx +++ b/packages/pl-fe/src/components/quoted-status.tsx @@ -3,16 +3,13 @@ import clsx from 'clsx'; import React, { MouseEventHandler } from 'react'; import { defineMessages, useIntl } from 'react-intl'; -import StatusMedia from 'pl-fe/components/status-media'; import Stack from 'pl-fe/components/ui/stack'; import AccountContainer from 'pl-fe/containers/account-container'; import EventPreview from './event-preview'; import OutlineBox from './outline-box'; -import QuotedStatusIndicator from './quoted-status-indicator'; import StatusContent from './status-content'; import StatusReplyMentions from './status-reply-mentions'; -import SensitiveContentOverlay from './statuses/sensitive-content-overlay'; import type { SelectedStatus } from 'pl-fe/selectors'; @@ -108,16 +105,9 @@ const QuotedStatus: React.FC = ({ status, onCancel, compose }) => status={status} collapsable isQuote + withMedia + compose={compose} /> - - {status.quote_id && } - - {status.media_attachments.length > 0 && ( -
- - -
- )} )} diff --git a/packages/pl-fe/src/components/status-content.tsx b/packages/pl-fe/src/components/status-content.tsx index e95344621..d7af79e86 100644 --- a/packages/pl-fe/src/components/status-content.tsx +++ b/packages/pl-fe/src/components/status-content.tsx @@ -23,6 +23,7 @@ import OutlineBox from './outline-box'; import { parseContent } from './parsed-content'; import { ParsedMfm } from './parsed-mfm'; import Poll from './polls/poll'; +import QuotedStatusIndicator from './quoted-status-indicator'; import StatusMedia from './status-media'; import SensitiveContentOverlay from './statuses/sensitive-content-overlay'; import TranslateButton from './translate-button'; @@ -72,6 +73,7 @@ interface IStatusContent { isQuote?: boolean; preview?: boolean; withMedia?: boolean; + compose?: boolean; } /** Renders the text content of a status */ @@ -84,6 +86,7 @@ const StatusContent: React.FC = React.memo(({ isQuote = false, preview, withMedia, + compose = false, }) => { const { urlPrivacy, displaySpoilers, renderMfm } = useSettings(); const { greentext } = usePlFeConfig(); @@ -234,7 +237,11 @@ const StatusContent: React.FC = React.memo(({ let quote; if (withMedia && status.quote_id) { - if ((status.quote_visible ?? true) === false) { + if (isQuote) { + quote = ( + + ); + } else if ((status.quote_visible ?? true) === false) { quote = (

@@ -250,7 +257,7 @@ const StatusContent: React.FC = React.memo(({ {((withMedia && status.media_attachments.length > 0) || (status.card && !quote)) && (
- {withMedia && } + {withMedia && }
)} diff --git a/packages/pl-fe/src/components/upload.tsx b/packages/pl-fe/src/components/upload.tsx index 5d7325248..522411f64 100644 --- a/packages/pl-fe/src/components/upload.tsx +++ b/packages/pl-fe/src/components/upload.tsx @@ -159,6 +159,9 @@ const Upload: React.FC = ({ /> ); + const backgroundImage = (mediaType === 'image' || ['.png', '.jpg', '.jpeg'].some(ext => media.preview_url.endsWith(ext))) ? `url(${media.preview_url})` : undefined; + const hasBackgroundImage = !!(backgroundImage); + return (
= ({ className={clsx('compose-form__upload-thumbnail relative h-40 w-full overflow-hidden bg-contain bg-center bg-no-repeat', mediaType)} style={{ scale: styles.scale, - backgroundImage: mediaType === 'image' ? `url(${media.preview_url})` : undefined, + backgroundImage, backgroundPosition: typeof x === 'number' && typeof y === 'number' ? `${x}% ${y}%` : undefined, }} > @@ -226,7 +229,7 @@ const Upload: React.FC = ({ )} -
+
{mediaType === 'video' && (