Skip to content

Commit

Permalink
fix: build and lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
khushal87 committed Jun 13, 2024
1 parent bc1099b commit 0a9bbb8
Show file tree
Hide file tree
Showing 22 changed files with 35 additions and 36 deletions.
2 changes: 1 addition & 1 deletion package/src/components/Attachment/__tests__/Giphy.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { generateMember } from '../../../mock-builders/generator/member';
import { generateMessage } from '../../../mock-builders/generator/message';
import { generateUser } from '../../../mock-builders/generator/user';
import { getTestClientWithUser } from '../../../mock-builders/mock';
import { Streami18n } from '../../../utils/Streami18n';
import { Streami18n } from '../../../utils/i18n/Streami18n';
import { ImageLoadingFailedIndicator } from '../../Attachment/ImageLoadingFailedIndicator';
import { ImageLoadingIndicator } from '../../Attachment/ImageLoadingIndicator';
import { Channel } from '../../Channel/Channel';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { useTranslationContext } from '../../contexts/translationContext/Transla
import { Check, CheckAll } from '../../icons';

import type { DefaultStreamChatGenerics } from '../../types/types';
import { getDateString } from '../../utils/getDateString';
import { getDateString } from '../../utils/i18n/getDateString';

const styles = StyleSheet.create({
date: {
Expand Down
2 changes: 1 addition & 1 deletion package/src/components/Chat/Chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import { SDK } from '../../native';
import { QuickSqliteClient } from '../../store/QuickSqliteClient';
import type { DefaultStreamChatGenerics } from '../../types/types';
import { DBSyncManager } from '../../utils/DBSyncManager';
import type { Streami18n } from '../../utils/i18n/Streami18n';
import { StreamChatRN } from '../../utils/StreamChatRN';
import type { Streami18n } from '../../utils/Streami18n';
import { version } from '../../version.json';

init();
Expand Down
2 changes: 1 addition & 1 deletion package/src/components/Chat/__tests__/Chat.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { useTranslationContext } from '../../../contexts/translationContext/Tran
import dispatchConnectionChangedEvent from '../../../mock-builders/event/connectionChanged';
import dispatchConnectionRecoveredEvent from '../../../mock-builders/event/connectionRecovered';
import { getTestClient } from '../../../mock-builders/mock';
import { Streami18n } from '../../../utils/Streami18n';
import { Streami18n } from '../../../utils/i18n/Streami18n';
import { Chat } from '../Chat';

const ChatContextConsumer = ({ fn }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { useTranslationContext } from '../../../contexts/translationContext/Tran
import { Close } from '../../../icons';

import type { DefaultStreamChatGenerics } from '../../../types/types';
import { getDateString } from '../../../utils/getDateString';
import { getDateString } from '../../../utils/i18n/getDateString';
import type { Photo } from '../ImageGallery';

const ReanimatedSafeAreaView = Animated.createAnimatedComponent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
TranslationContextValue,
useTranslationContext,
} from '../../../contexts/translationContext/TranslationContext';
import { getDateString } from '../../../utils/getDateString';
import { getDateString } from '../../../utils/i18n/getDateString';

export type MessageTimestampProps = Partial<Pick<TranslationContextValue, 'tDateTimeParser'>> & {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { cleanup, render, waitFor } from '@testing-library/react-native';
import { generateMessage } from '../../../../mock-builders/generator/message';
import { generateStaticUser, generateUser } from '../../../../mock-builders/generator/user';
import { getTestClientWithUser } from '../../../../mock-builders/mock';
import { Streami18n } from '../../../../utils/Streami18n';
import { Streami18n } from '../../../../utils/i18n/Streami18n';
import { Chat } from '../../../Chat/Chat';
import { MessageStatus } from '../MessageStatus';

Expand Down
2 changes: 1 addition & 1 deletion package/src/components/MessageList/InlineDateSeparator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { StyleSheet, Text, View } from 'react-native';

import { useTheme } from '../../contexts/themeContext/ThemeContext';
import { useTranslationContext } from '../../contexts/translationContext/TranslationContext';
import { getDateString } from '../../utils/getDateString';
import { getDateString } from '../../utils/i18n/getDateString';

const styles = StyleSheet.create({
container: {
Expand Down
2 changes: 1 addition & 1 deletion package/src/components/MessageList/MessageSystem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { useTheme } from '../../contexts/themeContext/ThemeContext';
import { useTranslationContext } from '../../contexts/translationContext/TranslationContext';

import type { DefaultStreamChatGenerics } from '../../types/types';
import { getDateString } from '../../utils/getDateString';
import { getDateString } from '../../utils/i18n/getDateString';

export type MessageSystemProps<
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
Expand Down
2 changes: 1 addition & 1 deletion package/src/components/MessageList/StickyHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { MessagesContextValue } from '../../contexts/messagesContext/MessagesCon
import { useTranslationContext } from '../../contexts/translationContext/TranslationContext';

import { DefaultStreamChatGenerics } from '../../types/types';
import { getDateString } from '../../utils/getDateString';
import { getDateString } from '../../utils/i18n/getDateString';

/**
* Props for the StickyHeader component.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { TranslationProvider } from '../../../contexts/translationContext/Transl

import { generateMessage, generateStaticMessage } from '../../../mock-builders/generator/message';
import { generateStaticUser } from '../../../mock-builders/generator/user';
import { Streami18n } from '../../../utils/Streami18n';
import { Streami18n } from '../../../utils/i18n/Streami18n';
import { MessageSystem } from '../MessageSystem';

afterEach(cleanup);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { cleanup, fireEvent, render, waitFor } from '@testing-library/react-nati

import { ThemeProvider } from '../../../contexts/themeContext/ThemeContext';
import { TranslationProvider } from '../../../contexts/translationContext/TranslationContext';
import { Streami18n } from '../../../utils/Streami18n';
import { Streami18n } from '../../../utils/i18n/Streami18n';
import { ScrollToBottomButton } from '../ScrollToBottomButton';

afterEach(cleanup);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { TypingProvider } from '../../../contexts/typingContext/TypingContext';

import { generateStaticUser, generateUser } from '../../../mock-builders/generator/user';
import { getTestClientWithUser } from '../../../mock-builders/mock';
import { Streami18n } from '../../../utils/Streami18n';
import { Streami18n } from '../../../utils/i18n/Streami18n';
import { Chat } from '../../Chat/Chat';
import { TypingIndicator } from '../TypingIndicator';

Expand Down
2 changes: 1 addition & 1 deletion package/src/components/Thread/__tests__/Thread.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { generateMember } from '../../../mock-builders/generator/member';
import { generateMessage, generateStaticMessage } from '../../../mock-builders/generator/message';
import { generateStaticUser } from '../../../mock-builders/generator/user';
import { getTestClientWithUser } from '../../../mock-builders/mock';
import { Streami18n } from '../../../utils/Streami18n';
import { Streami18n } from '../../../utils/i18n/Streami18n';
import { Channel } from '../../Channel/Channel';
import { Chat } from '../../Chat/Chat';
import { Thread } from '../Thread';
Expand Down
2 changes: 1 addition & 1 deletion package/src/contexts/overlayContext/OverlayContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type { ImageGalleryCustomComponents } from '../../components/ImageGallery

import type { MessageType } from '../../components/MessageList/hooks/useMessageList';
import type { DefaultStreamChatGenerics } from '../../types/types';
import type { Streami18n } from '../../utils/Streami18n';
import type { Streami18n } from '../../utils/i18n/Streami18n';
import type { AttachmentPickerContextValue } from '../attachmentPickerContext/AttachmentPickerContext';
import type { MessageOverlayContextValue } from '../messageOverlayContext/MessageOverlayContext';
import type { DeepPartial } from '../themeContext/ThemeContext';
Expand Down
2 changes: 1 addition & 1 deletion package/src/hooks/useStreami18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Dayjs from 'dayjs';
import { useIsMountedRef } from './useIsMountedRef';

import type { TranslatorFunctions } from '../contexts/translationContext/TranslationContext';
import { Streami18n } from '../utils/Streami18n';
import { Streami18n } from '../utils/i18n/Streami18n';

export const useStreami18n = (i18nInstance?: Streami18n) => {
const [translators, setTranslators] = useState<TranslatorFunctions>({
Expand Down
2 changes: 1 addition & 1 deletion package/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export * from './icons';
export * from './types/types';

export * from './utils/patchMessageTextCommand';
export * from './utils/Streami18n';
export * from './utils/i18n/Streami18n';
export * from './utils/utils';
export * from './utils/StreamChatRN';

Expand Down
2 changes: 1 addition & 1 deletion package/src/utils/__tests__/Streami18n.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import localeData from 'dayjs/plugin/localeData';

import frTranslations from '../../i18n/fr.json';
import nlTranslations from '../../i18n/nl.json';
import { Streami18n } from '../Streami18n';
import { Streami18n } from '../i18n/Streami18n';

Dayjs.extend(localeData);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,26 @@ import i18n, { FallbackLng, TFunction } from 'i18next';

import type moment from 'moment';

import { calendarFormats } from './calendarFormats';
import {
CustomFormatters,
PredefinedFormatters,
predefinedFormatters,
} from './predefinedFormatters';

import type { TDateTimeParser } from '../contexts/translationContext/TranslationContext';
import { calendarFormats } from '../i18n/calendarFormats';
import enTranslations from '../i18n/en.json';
import esTranslations from '../i18n/es.json';
import frTranslations from '../i18n/fr.json';
import heTranslations from '../i18n/he.json';
import hiTranslations from '../i18n/hi.json';
import itTranslations from '../i18n/it.json';
import jaTranslations from '../i18n/ja.json';
import koTranslations from '../i18n/ko.json';
import nlTranslations from '../i18n/nl.json';
import ptBRTranslations from '../i18n/pt-BR.json';
import ruTranslations from '../i18n/ru.json';
import trTranslations from '../i18n/tr.json';
import type { TDateTimeParser } from '../../contexts/translationContext/TranslationContext';
import enTranslations from '../../i18n/en.json';
import esTranslations from '../../i18n/es.json';
import frTranslations from '../../i18n/fr.json';
import heTranslations from '../../i18n/he.json';
import hiTranslations from '../../i18n/hi.json';
import itTranslations from '../../i18n/it.json';
import jaTranslations from '../../i18n/ja.json';
import koTranslations from '../../i18n/ko.json';
import nlTranslations from '../../i18n/nl.json';
import ptBRTranslations from '../../i18n/pt-BR.json';
import ruTranslations from '../../i18n/ru.json';
import trTranslations from '../../i18n/tr.json';

import 'dayjs/locale/es';
import 'dayjs/locale/fr';
Expand All @@ -48,7 +48,7 @@ import 'dayjs/locale/tr';
*/
import 'dayjs/locale/en';

import type { DefaultStreamChatGenerics } from '../types/types';
import type { DefaultStreamChatGenerics } from '../../types/types';

const defaultNS = 'translation';
const defaultLng = 'en';
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { TimestampFormatterOptions } from './predefinedFormatters';
import {
isDayOrMoment,
TranslatorFunctions,
} from '../contexts/translationContext/TranslationContext';
} from '../../contexts/translationContext/TranslationContext';

type DateFormatterOptions = TimestampFormatterOptions &
Partial<TranslatorFunctions> & {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { calendarFormats as calendarFormatsDefault } from './calendarFormats';
import { getDateString } from './getDateString';
import { Streami18n } from './Streami18n';

import { calendarFormats as calendarFormatsDefault } from '../i18n/calendarFormats';

export type TimestampFormatterOptions = {
/* If true, call the `Day.js` calendar function to get the date string to display (e.g. "Yesterday at 3:58 PM"). */
calendar?: boolean | null;
Expand Down

0 comments on commit 0a9bbb8

Please sign in to comment.