Skip to content

Commit

Permalink
Prettier changes only
Browse files Browse the repository at this point in the history
  • Loading branch information
arnautov-anton committed Dec 7, 2024
1 parent 4505339 commit 361ec32
Show file tree
Hide file tree
Showing 263 changed files with 1,188 additions and 1,434 deletions.
8 changes: 5 additions & 3 deletions .releaserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,11 @@
}
],
[
"@semantic-release/exec", {
"prepareCmd": "NEXT_VERSION=${nextRelease.version} npm run build"
}],
"@semantic-release/exec",
{
"prepareCmd": "NEXT_VERSION=${nextRelease.version} npm run build"
}
],
[
"@semantic-release/changelog",
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,4 @@
"troubleshooting/troubleshooting",
"resources/resources"
]
}
}
5 changes: 1 addition & 4 deletions docusaurus/react_versions.json
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
[
"11.x.x",
"11.x.x-legacy"
]
["11.x.x", "11.x.x-legacy"]
5 changes: 4 additions & 1 deletion e2e/user/Controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import type { Page } from '@playwright/test';
import selectors from './selectors';

export class Controller {
constructor(private baseURL: string | undefined, private page: Page) {}
constructor(
private baseURL: string | undefined,
private page: Page,
) {}

async openStory(story: string, waitForPresence: string) {
await Promise.all([
Expand Down
2 changes: 1 addition & 1 deletion e2e/user/components/Attachment/Attachment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, Page } from '@playwright/test';

const attachmentTypes = ['card', 'img', 'gallery', 'video', 'file', 'media'] as const;

type AttachmentType = typeof attachmentTypes[number];
type AttachmentType = (typeof attachmentTypes)[number];

export function getAttachment(page: Page, type: AttachmentType) {
return page.locator(`.str-chat__message-attachment--${type}`);
Expand Down
2 changes: 1 addition & 1 deletion examples/capacitor/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const apiKey = process.env.REACT_APP_STREAM_KEY as string;
const userId = process.env.REACT_APP_USER_ID as string;
const userToken = process.env.REACT_APP_USER_TOKEN as string;

const filters: ChannelFilters = { type: 'messaging', members: {$in: [userId]} };
const filters: ChannelFilters = { type: 'messaging', members: { $in: [userId] } };
const options: ChannelOptions = { state: true, presence: true, limit: 10 };
const sort: ChannelSort = { last_message_at: -1, updated_at: -1 };

Expand Down
8 changes: 2 additions & 6 deletions examples/capacitor/src/components/CustomMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,8 @@ import {
import './CustomMessage.scss';

export const CustomMessage = () => {
const {
showDetailedReactions,
isReactionEnabled,
message,
reactionSelectorRef,
} = useMessageContext();
const { showDetailedReactions, isReactionEnabled, message, reactionSelectorRef } =
useMessageContext();

const messageWrapperRef = useRef<HTMLDivElement>(null);

Expand Down
2 changes: 1 addition & 1 deletion examples/capacitor/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as serviceWorker from './serviceWorker';
createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<App />
</React.StrictMode>
</React.StrictMode>,
);

// If you want your app to work offline and load faster, you can change
Expand Down
4 changes: 2 additions & 2 deletions examples/typescript/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import {
Window,
} from 'stream-chat-react';

const params = (new Proxy(new URLSearchParams(window.location.search), {
const params = new Proxy(new URLSearchParams(window.location.search), {
get: (searchParams, property) => searchParams.get(property as string),
}) as unknown) as Record<string, string | null>;
}) as unknown as Record<string, string | null>;

const apiKey = process.env.REACT_APP_STREAM_KEY as string;
const userId = params.uid || (process.env.REACT_APP_USER_ID as string);
Expand Down
8 changes: 2 additions & 6 deletions examples/typescript/src/components/CustomMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,8 @@ import {
import './CustomMessage.scss';

export const CustomMessage = () => {
const {
showDetailedReactions,
isReactionEnabled,
message,
reactionSelectorRef,
} = useMessageContext();
const { showDetailedReactions, isReactionEnabled, message, reactionSelectorRef } =
useMessageContext();

const messageWrapperRef = useRef<HTMLDivElement>(null);

Expand Down
4 changes: 2 additions & 2 deletions examples/vite/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import {
} from 'stream-chat-react';
import 'stream-chat-react/css/v2/index.css';

const params = (new Proxy(new URLSearchParams(window.location.search), {
const params = new Proxy(new URLSearchParams(window.location.search), {
get: (searchParams, property) => searchParams.get(property as string),
}) as unknown) as Record<string, string | null>;
}) as unknown as Record<string, string | null>;

const parseUserIdFromToken = (token: string) => {
const [, payload] = token.split('.');
Expand Down
9 changes: 4 additions & 5 deletions src/components/AIStateIndicator/AIStateIndicator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,19 @@ import { useChannelStateContext, useTranslationContext } from '../../context';
import type { DefaultStreamChatGenerics } from '../../types/types';

export type AIStateIndicatorProps<
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
> = {
channel?: Channel<StreamChatGenerics>;
};

export const AIStateIndicator = <
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
>({
channel: channelFromProps,
}: AIStateIndicatorProps<StreamChatGenerics>) => {
const { t } = useTranslationContext();
const { channel: channelFromContext } = useChannelStateContext<StreamChatGenerics>(
'AIStateIndicator',
);
const { channel: channelFromContext } =
useChannelStateContext<StreamChatGenerics>('AIStateIndicator');
const channel = channelFromProps || channelFromContext;
const { aiState } = useAIState(channel);
const allowedStates = {
Expand Down
2 changes: 1 addition & 1 deletion src/components/AIStateIndicator/hooks/useAIState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const AIStates = {
* @returns {{ aiState: AIState }} The current AI state for the given channel.
*/
export const useAIState = <
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
>(
channel?: Channel<StreamChatGenerics>,
): { aiState: AIState } => {
Expand Down
8 changes: 4 additions & 4 deletions src/components/Attachment/Attachment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const ATTACHMENT_GROUPS_ORDER = [
] as const;

export type AttachmentProps<
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
> = {
/** The message attachments to render, see [attachment structure](https://getstream.io/chat/docs/javascript/message_format/?language=javascript) **/
attachments: StreamAttachment<StreamChatGenerics>[];
Expand Down Expand Up @@ -87,7 +87,7 @@ export type AttachmentProps<
* A component used for rendering message attachments. By default, the component supports: AttachmentActions, Audio, Card, File, Gallery, Image, and Video
*/
export const Attachment = <
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
>(
props: AttachmentProps<StreamChatGenerics>,
) => {
Expand All @@ -107,7 +107,7 @@ export const Attachment = <
};

const renderGroupedAttachments = <
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
>({
attachments,
...rest
Expand Down Expand Up @@ -169,7 +169,7 @@ const renderGroupedAttachments = <
};

const getAttachmentType = <
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
>(
attachment: AttachmentProps<StreamChatGenerics>['attachments'][number],
): keyof typeof CONTAINER_MAP => {
Expand Down
4 changes: 2 additions & 2 deletions src/components/Attachment/AttachmentActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type { ActionHandlerReturnType } from '../Message/hooks/useActionHandler'
import type { DefaultStreamChatGenerics } from '../../types/types';

export type AttachmentActionsProps<
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
> = Attachment<StreamChatGenerics> & {
/** A list of actions */
actions: Action[];
Expand All @@ -20,7 +20,7 @@ export type AttachmentActionsProps<
};

const UnMemoizedAttachmentActions = <
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
>(
props: AttachmentActionsProps<StreamChatGenerics>,
) => {
Expand Down
32 changes: 15 additions & 17 deletions src/components/Attachment/AttachmentContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ import type {
import type { Attachment } from 'stream-chat';

export type AttachmentContainerProps<
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
> = {
attachment: Attachment<StreamChatGenerics> | GalleryAttachment<StreamChatGenerics>;
componentType: AttachmentComponentType;
};
export const AttachmentWithinContainer = <
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
>({
attachment,
children,
Expand All @@ -50,8 +50,8 @@ export const AttachmentWithinContainer = <
componentType === 'card' && !attachment?.image_url && !attachment?.thumb_url
? 'no-image'
: attachment?.actions?.length
? 'actions'
: '';
? 'actions'
: '';
}

const classNames = clsx(
Expand All @@ -69,7 +69,7 @@ export const AttachmentWithinContainer = <
};

export const AttachmentActionsContainer = <
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
>({
actionHandler,
attachment,
Expand Down Expand Up @@ -108,7 +108,7 @@ function getCssDimensionsVariables(url: string) {
}

export const GalleryContainer = <
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
>({
attachment,
Gallery = DefaultGallery,
Expand Down Expand Up @@ -150,7 +150,7 @@ export const GalleryContainer = <
};

export const ImageContainer = <
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
>(
props: RenderAttachmentProps<StreamChatGenerics>,
) => {
Expand Down Expand Up @@ -194,7 +194,7 @@ export const ImageContainer = <
};

export const CardContainer = <
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
>(
props: RenderAttachmentProps<StreamChatGenerics>,
) => {
Expand All @@ -220,7 +220,7 @@ export const CardContainer = <
};

export const FileContainer = <
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
>({
attachment,
File = DefaultFile,
Expand All @@ -234,7 +234,7 @@ export const FileContainer = <
);
};
export const AudioContainer = <
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
>({
attachment,
Audio = DefaultAudio,
Expand All @@ -247,7 +247,7 @@ export const AudioContainer = <
);

export const VoiceRecordingContainer = <
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
>({
attachment,
VoiceRecording = DefaultVoiceRecording,
Expand All @@ -261,18 +261,16 @@ export const VoiceRecordingContainer = <
);

export const MediaContainer = <
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
>(
props: RenderAttachmentProps<StreamChatGenerics>,
) => {
const { attachment, Media = ReactPlayer } = props;
const componentType = 'media';
const { shouldGenerateVideoThumbnail, videoAttachmentSizeHandler } = useChannelStateContext();
const videoElement = useRef<HTMLDivElement>(null);
const [
attachmentConfiguration,
setAttachmentConfiguration,
] = useState<VideoAttachmentConfiguration>();
const [attachmentConfiguration, setAttachmentConfiguration] =
useState<VideoAttachmentConfiguration>();

useLayoutEffect(() => {
if (videoElement.current && videoAttachmentSizeHandler) {
Expand Down Expand Up @@ -319,7 +317,7 @@ export const MediaContainer = <
};

export const UnsupportedAttachmentContainer = <
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
>({
attachment,
UnsupportedAttachment = DefaultUnsupportedAttachment,
Expand Down
4 changes: 2 additions & 2 deletions src/components/Attachment/Audio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import { useAudioController } from './hooks/useAudioController';
import type { DefaultStreamChatGenerics } from '../../types/types';

export type AudioProps<
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
> = {
// fixme: rename og to attachment
og: Attachment<StreamChatGenerics>;
};

const UnMemoizedAudio = <
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
>(
props: AudioProps<StreamChatGenerics>,
) => {
Expand Down
4 changes: 2 additions & 2 deletions src/components/Attachment/FileAttachment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import { DownloadButton, FileSizeIndicator } from './components';
import type { DefaultStreamChatGenerics } from '../../types/types';

export type FileAttachmentProps<
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
> = {
attachment: Attachment<StreamChatGenerics>;
};

const UnMemoizedFileAttachment = <
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
>({
attachment,
}: FileAttachmentProps<StreamChatGenerics>) => (
Expand Down
4 changes: 2 additions & 2 deletions src/components/Attachment/UnsupportedAttachment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import type { Attachment } from 'stream-chat';
import type { DefaultStreamChatGenerics } from '../../types/types';

export type UnsupportedAttachmentProps<
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
> = {
attachment: Attachment<StreamChatGenerics>;
};

export const UnsupportedAttachment = <
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
>({
attachment,
}: UnsupportedAttachmentProps<StreamChatGenerics>) => {
Expand Down
Loading

0 comments on commit 361ec32

Please sign in to comment.