eslint: use semicolon TypeScript delimeter

environments/review-interface-5ivyb6/deployments/4081
Alex Gleason 2023-10-02 13:54:02 -05:00
rodzic 702124fb79
commit 645ce60a5f
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
479 zmienionych plików z 1928 dodań i 1938 usunięć

Wyświetl plik

@ -258,17 +258,7 @@ module.exports = {
alphabetize: { order: 'asc' }, alphabetize: { order: 'asc' },
}, },
], ],
'@typescript-eslint/member-delimiter-style': [ '@typescript-eslint/member-delimiter-style': 'error',
'error',
{
multiline: {
delimiter: 'none',
},
singleline: {
delimiter: 'comma',
},
},
],
'promise/catch-or-return': 'error', 'promise/catch-or-return': 'error',

Wyświetl plik

@ -8,8 +8,8 @@ import yargs from 'yargs';
type Validator = (language: string) => void; type Validator = (language: string) => void;
interface LanguageResult { interface LanguageResult {
language: string language: string;
error: any error: any;
} }
const RFC5646_REGEXP = /^[a-z]{2,3}(?:-(?:x|[A-Za-z]{2,4}))*$/; const RFC5646_REGEXP = /^[a-z]{2,3}(?:-(?:x|[A-Za-z]{2,4}))*$/;
@ -164,8 +164,8 @@ const extractedMessages = extractedMessagesFiles.reduce((acc, messageFile) => {
}, [] as ExtractedDescriptor[]); }, [] as ExtractedDescriptor[]);
interface Translation { interface Translation {
language: string language: string;
data: Record<string, string> data: Record<string, string>;
} }
const translations: Translation[] = languages.map((language: string) => { const translations: Translation[] = languages.map((language: string) => {
@ -188,10 +188,10 @@ function pushIfUnique<T>(arr: T[], newItem: T): void {
} }
interface Problem { interface Problem {
language: string language: string;
id: ExtractedDescriptor['id'] id: ExtractedDescriptor['id'];
severity: 'error' | 'warning' severity: 'error' | 'warning';
type: string type: string;
} }
const problems: Problem[] = translations.reduce((acc, translation) => { const problems: Problem[] = translations.reduce((acc, translation) => {

Wyświetl plik

@ -201,7 +201,7 @@ const fetchReports = (params: Record<string, any> = {}) =>
} }
}; };
const patchMastodonReports = (reports: { id: string, state: string }[]) => const patchMastodonReports = (reports: { id: string; state: string }[]) =>
(dispatch: AppDispatch, getState: () => RootState) => (dispatch: AppDispatch, getState: () => RootState) =>
Promise.all(reports.map(({ id, state }) => api(getState) Promise.all(reports.map(({ id, state }) => api(getState)
.post(`/api/v1/admin/reports/${id}/${state === 'resolved' ? 'reopen' : 'resolve'}`) .post(`/api/v1/admin/reports/${id}/${state === 'resolved' ? 'reopen' : 'resolve'}`)
@ -212,7 +212,7 @@ const patchMastodonReports = (reports: { id: string, state: string }[]) =>
}), }),
)); ));
const patchPleromaReports = (reports: { id: string, state: string }[]) => const patchPleromaReports = (reports: { id: string; state: string }[]) =>
(dispatch: AppDispatch, getState: () => RootState) => (dispatch: AppDispatch, getState: () => RootState) =>
api(getState) api(getState)
.patch('/api/v1/pleroma/admin/reports', { reports }) .patch('/api/v1/pleroma/admin/reports', { reports })

Wyświetl plik

@ -101,15 +101,15 @@ const messages = defineMessages({
}); });
interface ComposeSetStatusAction { interface ComposeSetStatusAction {
type: typeof COMPOSE_SET_STATUS type: typeof COMPOSE_SET_STATUS;
id: string id: string;
status: Status status: Status;
rawText: string rawText: string;
explicitAddressing: boolean explicitAddressing: boolean;
spoilerText?: string spoilerText?: string;
contentType?: string | false contentType?: string | false;
v: ReturnType<typeof parseVersion> v: ReturnType<typeof parseVersion>;
withRedraft?: boolean withRedraft?: boolean;
} }
const setComposeToStatus = (status: Status, rawText: string, spoilerText?: string, contentType?: string | false, withRedraft?: boolean) => const setComposeToStatus = (status: Status, rawText: string, spoilerText?: string, contentType?: string | false, withRedraft?: boolean) =>
@ -139,12 +139,12 @@ const changeCompose = (composeId: string, text: string) => ({
}); });
interface ComposeReplyAction { interface ComposeReplyAction {
type: typeof COMPOSE_REPLY type: typeof COMPOSE_REPLY;
id: string id: string;
status: Status status: Status;
account: Account account: Account;
explicitAddressing: boolean explicitAddressing: boolean;
preserveSpoilers: boolean preserveSpoilers: boolean;
} }
const replyCompose = (status: Status) => const replyCompose = (status: Status) =>
@ -176,11 +176,11 @@ const cancelReplyCompose = () => ({
}); });
interface ComposeQuoteAction { interface ComposeQuoteAction {
type: typeof COMPOSE_QUOTE type: typeof COMPOSE_QUOTE;
id: string id: string;
status: Status status: Status;
account: Account | undefined account: Account | undefined;
explicitAddressing: boolean explicitAddressing: boolean;
} }
const quoteCompose = (status: Status) => const quoteCompose = (status: Status) =>
@ -220,9 +220,9 @@ const resetCompose = (composeId = 'compose-modal') => ({
}); });
interface ComposeMentionAction { interface ComposeMentionAction {
type: typeof COMPOSE_MENTION type: typeof COMPOSE_MENTION;
id: string id: string;
account: Account account: Account;
} }
const mentionCompose = (account: Account) => const mentionCompose = (account: Account) =>
@ -238,9 +238,9 @@ const mentionCompose = (account: Account) =>
}; };
interface ComposeDirectAction { interface ComposeDirectAction {
type: typeof COMPOSE_DIRECT type: typeof COMPOSE_DIRECT;
id: string id: string;
account: Account account: Account;
} }
const directCompose = (account: Account) => const directCompose = (account: Account) =>
@ -593,11 +593,11 @@ const fetchComposeSuggestions = (composeId: string, token: string) =>
}; };
interface ComposeSuggestionsReadyAction { interface ComposeSuggestionsReadyAction {
type: typeof COMPOSE_SUGGESTIONS_READY type: typeof COMPOSE_SUGGESTIONS_READY;
id: string id: string;
token: string token: string;
emojis?: Emoji[] emojis?: Emoji[];
accounts?: APIEntity[] accounts?: APIEntity[];
} }
const readyComposeSuggestionsEmojis = (composeId: string, token: string, emojis: Emoji[]) => ({ const readyComposeSuggestionsEmojis = (composeId: string, token: string, emojis: Emoji[]) => ({
@ -615,12 +615,12 @@ const readyComposeSuggestionsAccounts = (composeId: string, token: string, accou
}); });
interface ComposeSuggestionSelectAction { interface ComposeSuggestionSelectAction {
type: typeof COMPOSE_SUGGESTION_SELECT type: typeof COMPOSE_SUGGESTION_SELECT;
id: string id: string;
position: number position: number;
token: string | null token: string | null;
completion: string completion: string;
path: Array<string | number> path: Array<string | number>;
} }
const selectComposeSuggestion = (composeId: string, position: number, token: string | null, suggestion: AutoSuggestion, path: Array<string | number>) => const selectComposeSuggestion = (composeId: string, position: number, token: string | null, suggestion: AutoSuggestion, path: Array<string | number>) =>
@ -774,9 +774,9 @@ const openComposeWithText = (composeId: string, text = '') =>
}; };
interface ComposeAddToMentionsAction { interface ComposeAddToMentionsAction {
type: typeof COMPOSE_ADD_TO_MENTIONS type: typeof COMPOSE_ADD_TO_MENTIONS;
id: string id: string;
account: string account: string;
} }
const addToMentions = (composeId: string, accountId: string) => const addToMentions = (composeId: string, accountId: string) =>
@ -795,9 +795,9 @@ const addToMentions = (composeId: string, accountId: string) =>
}; };
interface ComposeRemoveFromMentionsAction { interface ComposeRemoveFromMentionsAction {
type: typeof COMPOSE_REMOVE_FROM_MENTIONS type: typeof COMPOSE_REMOVE_FROM_MENTIONS;
id: string id: string;
account: string account: string;
} }
const removeFromMentions = (composeId: string, accountId: string) => const removeFromMentions = (composeId: string, accountId: string) =>
@ -816,11 +816,11 @@ const removeFromMentions = (composeId: string, accountId: string) =>
}; };
interface ComposeEventReplyAction { interface ComposeEventReplyAction {
type: typeof COMPOSE_EVENT_REPLY type: typeof COMPOSE_EVENT_REPLY;
id: string id: string;
status: Status status: Status;
account: Account account: Account;
explicitAddressing: boolean explicitAddressing: boolean;
} }
const eventDiscussionCompose = (composeId: string, status: Status) => const eventDiscussionCompose = (composeId: string, status: Status) =>

Wyświetl plik

@ -545,10 +545,10 @@ const cancelEventCompose = () => ({
}); });
interface EventFormSetAction { interface EventFormSetAction {
type: typeof EVENT_FORM_SET type: typeof EVENT_FORM_SET;
status: ReducerStatus status: ReducerStatus;
text: string text: string;
location: Record<string, any> location: Record<string, any>;
} }
const editEvent = (id: string) => (dispatch: AppDispatch, getState: () => RootState) => { const editEvent = (id: string) => (dispatch: AppDispatch, getState: () => RootState) => {

Wyświetl plik

@ -34,8 +34,8 @@ type ExportDataActions = {
| typeof EXPORT_BLOCKS_FAIL | typeof EXPORT_BLOCKS_FAIL
| typeof EXPORT_MUTES_REQUEST | typeof EXPORT_MUTES_REQUEST
| typeof EXPORT_MUTES_SUCCESS | typeof EXPORT_MUTES_SUCCESS
| typeof EXPORT_MUTES_FAIL | typeof EXPORT_MUTES_FAIL;
error?: any error?: any;
} }
function fileExport(content: string, fileName: string) { function fileExport(content: string, fileName: string) {

Wyświetl plik

@ -33,7 +33,7 @@ const messages = defineMessages({
removed: { id: 'filters.removed', defaultMessage: 'Filter deleted.' }, removed: { id: 'filters.removed', defaultMessage: 'Filter deleted.' },
}); });
type FilterKeywords = { keyword: string, whole_word: boolean }[]; type FilterKeywords = { keyword: string; whole_word: boolean }[];
const fetchFiltersV1 = () => const fetchFiltersV1 = () =>
(dispatch: AppDispatch, getState: () => RootState) => { (dispatch: AppDispatch, getState: () => RootState) => {

Wyświetl plik

@ -27,9 +27,9 @@ type ImportDataActions = {
| typeof IMPORT_BLOCKS_FAIL | typeof IMPORT_BLOCKS_FAIL
| typeof IMPORT_MUTES_REQUEST | typeof IMPORT_MUTES_REQUEST
| typeof IMPORT_MUTES_SUCCESS | typeof IMPORT_MUTES_SUCCESS
| typeof IMPORT_MUTES_FAIL | typeof IMPORT_MUTES_FAIL;
error?: any error?: any;
config?: string config?: string;
} }
const messages = defineMessages({ const messages = defineMessages({

Wyświetl plik

@ -104,8 +104,8 @@ const patchMeRequest = () => ({
}); });
interface MePatchSuccessAction { interface MePatchSuccessAction {
type: typeof ME_PATCH_SUCCESS type: typeof ME_PATCH_SUCCESS;
me: APIEntity me: APIEntity;
} }
const patchMeSuccess = (me: APIEntity) => const patchMeSuccess = (me: APIEntity) =>

Wyświetl plik

@ -4,11 +4,11 @@ const ONBOARDING_END = 'ONBOARDING_END';
const ONBOARDING_LOCAL_STORAGE_KEY = 'soapbox:onboarding'; const ONBOARDING_LOCAL_STORAGE_KEY = 'soapbox:onboarding';
type OnboardingStartAction = { type OnboardingStartAction = {
type: typeof ONBOARDING_START type: typeof ONBOARDING_START;
} }
type OnboardingEndAction = { type OnboardingEndAction = {
type: typeof ONBOARDING_END type: typeof ONBOARDING_END;
} }
export type OnboardingActions = OnboardingStartAction | OnboardingEndAction export type OnboardingActions = OnboardingStartAction | OnboardingEndAction

Wyświetl plik

@ -37,8 +37,8 @@ const subscribe = (registration: ServiceWorkerRegistration, getState: () => Root
}); });
const unsubscribe = ({ registration, subscription }: { const unsubscribe = ({ registration, subscription }: {
registration: ServiceWorkerRegistration registration: ServiceWorkerRegistration;
subscription: PushSubscription | null subscription: PushSubscription | null;
}) => }) =>
subscription ? subscription.unsubscribe().then(() => registration) : new Promise<ServiceWorkerRegistration>(r => r(registration)); subscription ? subscription.unsubscribe().then(() => registration) : new Promise<ServiceWorkerRegistration>(r => r(registration));
@ -82,8 +82,8 @@ const register = () =>
.then(getPushSubscription) .then(getPushSubscription)
// @ts-ignore // @ts-ignore
.then(({ registration, subscription }: { .then(({ registration, subscription }: {
registration: ServiceWorkerRegistration registration: ServiceWorkerRegistration;
subscription: PushSubscription | null subscription: PushSubscription | null;
}) => { }) => {
if (subscription !== null) { if (subscription !== null) {
// We have a subscription, check if it is still valid // We have a subscription, check if it is still valid

Wyświetl plik

@ -29,9 +29,9 @@ enum ReportableEntities {
} }
type ReportedEntity = { type ReportedEntity = {
status?: Status status?: Status;
chatMessage?: ChatMessage chatMessage?: ChatMessage;
group?: Group group?: Group;
} }
const initReport = (entityType: ReportableEntities, account: Account, entities?: ReportedEntity) => (dispatch: AppDispatch) => { const initReport = (entityType: ReportableEntities, account: Account, entities?: ReportedEntity) => (dispatch: AppDispatch) => {

Wyświetl plik

@ -7,12 +7,12 @@ const RULES_FETCH_REQUEST = 'RULES_FETCH_REQUEST';
const RULES_FETCH_SUCCESS = 'RULES_FETCH_SUCCESS'; const RULES_FETCH_SUCCESS = 'RULES_FETCH_SUCCESS';
type RulesFetchRequestAction = { type RulesFetchRequestAction = {
type: typeof RULES_FETCH_REQUEST type: typeof RULES_FETCH_REQUEST;
} }
type RulesFetchRequestSuccessAction = { type RulesFetchRequestSuccessAction = {
type: typeof RULES_FETCH_SUCCESS type: typeof RULES_FETCH_SUCCESS;
payload: Rule[] payload: Rule[];
} }
export type RulesActions = RulesFetchRequestAction | RulesFetchRequestSuccessAction export type RulesActions = RulesFetchRequestAction | RulesFetchRequestSuccessAction

Wyświetl plik

@ -19,7 +19,7 @@ const FE_NAME = 'soapbox_fe';
/** Options when changing/saving settings. */ /** Options when changing/saving settings. */
type SettingOpts = { type SettingOpts = {
/** Whether to display an alert when settings are saved. */ /** Whether to display an alert when settings are saved. */
showAlert?: boolean showAlert?: boolean;
} }
const saveSuccessMessage = defineMessage({ id: 'settings.save.success', defaultMessage: 'Your preferences have been saved!' }); const saveSuccessMessage = defineMessage({ id: 'settings.save.success', defaultMessage: 'Your preferences have been saved!' });
@ -183,9 +183,9 @@ const getSettings = createSelector([
}); });
interface SettingChangeAction { interface SettingChangeAction {
type: typeof SETTING_CHANGE type: typeof SETTING_CHANGE;
path: string[] path: string[];
value: any value: any;
} }
const changeSettingImmediate = (path: string[], value: any, opts?: SettingOpts) => const changeSettingImmediate = (path: string[], value: any, opts?: SettingOpts) =>

Wyświetl plik

@ -65,8 +65,8 @@ const updateChatQuery = (chat: IChat) => {
}; };
interface TimelineStreamOpts { interface TimelineStreamOpts {
statContext?: IStatContext statContext?: IStatContext;
enabled?: boolean enabled?: boolean;
} }
const connectTimelineStream = ( const connectTimelineStream = (
@ -192,17 +192,17 @@ function followStateToRelationship(followState: string) {
} }
interface FollowUpdate { interface FollowUpdate {
state: 'follow_pending' | 'follow_accept' | 'follow_reject' state: 'follow_pending' | 'follow_accept' | 'follow_reject';
follower: { follower: {
id: string id: string;
follower_count: number follower_count: number;
following_count: number following_count: number;
} };
following: { following: {
id: string id: string;
follower_count: number follower_count: number;
following_count: number following_count: number;
} };
} }
function updateFollowRelationships(update: FollowUpdate) { function updateFollowRelationships(update: FollowUpdate) {

Wyświetl plik

@ -110,11 +110,11 @@ const dequeueTimeline = (timelineId: string, expandFunc?: (lastStatusId: string)
}; };
interface TimelineDeleteAction { interface TimelineDeleteAction {
type: typeof TIMELINE_DELETE type: typeof TIMELINE_DELETE;
id: string id: string;
accountId: string accountId: string;
references: ImmutableMap<string, readonly [statusId: string, accountId: string]> references: ImmutableMap<string, readonly [statusId: string, accountId: string]>;
reblogOf: unknown reblogOf: unknown;
} }
const deleteFromTimelines = (id: string) => const deleteFromTimelines = (id: string) =>
@ -193,14 +193,14 @@ const expandTimeline = (timelineId: string, path: string, params: Record<string,
}; };
interface ExpandHomeTimelineOpts { interface ExpandHomeTimelineOpts {
maxId?: string maxId?: string;
url?: string url?: string;
} }
interface HomeTimelineParams { interface HomeTimelineParams {
max_id?: string max_id?: string;
exclude_replies?: boolean exclude_replies?: boolean;
with_muted?: boolean with_muted?: boolean;
} }
const expandHomeTimeline = ({ url, maxId }: ExpandHomeTimelineOpts = {}, done = noOp) => { const expandHomeTimeline = ({ url, maxId }: ExpandHomeTimelineOpts = {}, done = noOp) => {

Wyświetl plik

@ -10,7 +10,7 @@ import { type Account, accountSchema } from 'soapbox/schemas';
import { useRelationship } from './useRelationship'; import { useRelationship } from './useRelationship';
interface UseAccountOpts { interface UseAccountOpts {
withRelationship?: boolean withRelationship?: boolean;
} }
function useAccount(accountId?: string, opts: UseAccountOpts = {}) { function useAccount(accountId?: string, opts: UseAccountOpts = {}) {

Wyświetl plik

@ -8,7 +8,7 @@ import { useRelationships } from './useRelationships';
import type { EntityFn } from 'soapbox/entity-store/hooks/types'; import type { EntityFn } from 'soapbox/entity-store/hooks/types';
interface useAccountListOpts { interface useAccountListOpts {
enabled?: boolean enabled?: boolean;
} }
function useAccountList(listKey: string[], entityFn: EntityFn<void>, opts: useAccountListOpts = {}) { function useAccountList(listKey: string[], entityFn: EntityFn<void>, opts: useAccountListOpts = {}) {

Wyświetl plik

@ -10,7 +10,7 @@ import { type Account, accountSchema } from 'soapbox/schemas';
import { useRelationship } from './useRelationship'; import { useRelationship } from './useRelationship';
interface UseAccountLookupOpts { interface UseAccountLookupOpts {
withRelationship?: boolean withRelationship?: boolean;
} }
function useAccountLookup(acct: string | undefined, opts: UseAccountLookupOpts = {}) { function useAccountLookup(acct: string | undefined, opts: UseAccountLookupOpts = {}) {

Wyświetl plik

@ -6,9 +6,9 @@ import { useApi } from 'soapbox/hooks/useApi';
import { relationshipSchema } from 'soapbox/schemas'; import { relationshipSchema } from 'soapbox/schemas';
interface FollowOpts { interface FollowOpts {
reblogs?: boolean reblogs?: boolean;
notify?: boolean notify?: boolean;
languages?: string[] languages?: string[];
} }
function useFollow() { function useFollow() {

Wyświetl plik

@ -6,7 +6,7 @@ import { useApi } from 'soapbox/hooks';
import { type Relationship, relationshipSchema } from 'soapbox/schemas'; import { type Relationship, relationshipSchema } from 'soapbox/schemas';
interface UseRelationshipOpts { interface UseRelationshipOpts {
enabled?: boolean enabled?: boolean;
} }
function useRelationship(accountId: string | undefined, opts: UseRelationshipOpts = {}) { function useRelationship(accountId: string | undefined, opts: UseRelationshipOpts = {}) {

Wyświetl plik

@ -4,13 +4,13 @@ import { useApi } from 'soapbox/hooks/useApi';
import { groupSchema } from 'soapbox/schemas'; import { groupSchema } from 'soapbox/schemas';
interface CreateGroupParams { interface CreateGroupParams {
display_name?: string display_name?: string;
note?: string note?: string;
avatar?: File avatar?: File;
header?: File header?: File;
group_visibility?: 'members_only' | 'everyone' group_visibility?: 'members_only' | 'everyone';
discoverable?: boolean discoverable?: boolean;
tags?: string[] tags?: string[];
} }
function useCreateGroup() { function useCreateGroup() {

Wyświetl plik

@ -4,8 +4,8 @@ import { useApi } from 'soapbox/hooks/useApi';
import { useFeatures } from 'soapbox/hooks/useFeatures'; import { useFeatures } from 'soapbox/hooks/useFeatures';
type Validation = { type Validation = {
error: string error: string;
message: string message: string;
} }
const ValidationKeys = { const ValidationKeys = {

Wyświetl plik

@ -4,13 +4,13 @@ import { useApi } from 'soapbox/hooks/useApi';
import { groupSchema } from 'soapbox/schemas'; import { groupSchema } from 'soapbox/schemas';
interface UpdateGroupParams { interface UpdateGroupParams {
display_name?: string display_name?: string;
note?: string note?: string;
avatar?: File | '' avatar?: File | '';
header?: File | '' header?: File | '';
group_visibility?: string group_visibility?: string;
discoverable?: boolean discoverable?: boolean;
tags?: string[] tags?: string[];
} }
function useUpdateGroup(groupId: string) { function useUpdateGroup(groupId: string) {

Wyświetl plik

@ -1,8 +1,8 @@
import { useTimelineStream } from './useTimelineStream'; import { useTimelineStream } from './useTimelineStream';
interface UseCommunityStreamOpts { interface UseCommunityStreamOpts {
onlyMedia?: boolean onlyMedia?: boolean;
enabled?: boolean enabled?: boolean;
} }
function useCommunityStream({ onlyMedia, enabled }: UseCommunityStreamOpts = {}) { function useCommunityStream({ onlyMedia, enabled }: UseCommunityStreamOpts = {}) {

Wyświetl plik

@ -1,7 +1,7 @@
import { useTimelineStream } from './useTimelineStream'; import { useTimelineStream } from './useTimelineStream';
interface UsePublicStreamOpts { interface UsePublicStreamOpts {
onlyMedia?: boolean onlyMedia?: boolean;
} }
function usePublicStream({ onlyMedia }: UsePublicStreamOpts = {}) { function usePublicStream({ onlyMedia }: UsePublicStreamOpts = {}) {

Wyświetl plik

@ -1,8 +1,8 @@
import { useTimelineStream } from './useTimelineStream'; import { useTimelineStream } from './useTimelineStream';
interface UseRemoteStreamOpts { interface UseRemoteStreamOpts {
instance: string instance: string;
onlyMedia?: boolean onlyMedia?: boolean;
} }
function useRemoteStream({ instance, onlyMedia }: UseRemoteStreamOpts) { function useRemoteStream({ instance, onlyMedia }: UseRemoteStreamOpts) {

Wyświetl plik

@ -1,7 +1,7 @@
import React from 'react'; import React from 'react';
interface IInlineSVG { interface IInlineSVG {
loader?: JSX.Element loader?: JSX.Element;
} }
const InlineSVG: React.FC<IInlineSVG> = ({ loader }): JSX.Element => { const InlineSVG: React.FC<IInlineSVG> = ({ loader }): JSX.Element => {

Wyświetl plik

@ -12,9 +12,9 @@ const messages = defineMessages({
interface IAccountSearch { interface IAccountSearch {
/** Callback when a searched account is chosen. */ /** Callback when a searched account is chosen. */
onSelected: (accountId: string) => void onSelected: (accountId: string) => void;
/** Override the default placeholder of the input. */ /** Override the default placeholder of the input. */
placeholder?: string placeholder?: string;
} }
/** Input to search for accounts. */ /** Input to search for accounts. */

Wyświetl plik

@ -17,8 +17,8 @@ import type { StatusApprovalStatus } from 'soapbox/normalizers/status';
import type { Account as AccountSchema } from 'soapbox/schemas'; import type { Account as AccountSchema } from 'soapbox/schemas';
interface IInstanceFavicon { interface IInstanceFavicon {
account: AccountSchema account: AccountSchema;
disabled?: boolean disabled?: boolean;
} }
const messages = defineMessages({ const messages = defineMessages({
@ -57,9 +57,9 @@ const InstanceFavicon: React.FC<IInstanceFavicon> = ({ account, disabled }) => {
}; };
interface IProfilePopper { interface IProfilePopper {
condition: boolean condition: boolean;
wrapper: (children: React.ReactNode) => React.ReactNode wrapper: (children: React.ReactNode) => React.ReactNode;
children: React.ReactNode children: React.ReactNode;
} }
const ProfilePopper: React.FC<IProfilePopper> = ({ condition, wrapper, children }) => { const ProfilePopper: React.FC<IProfilePopper> = ({ condition, wrapper, children }) => {
@ -71,31 +71,31 @@ const ProfilePopper: React.FC<IProfilePopper> = ({ condition, wrapper, children
}; };
export interface IAccount { export interface IAccount {
account: AccountSchema account: AccountSchema;
action?: React.ReactElement action?: React.ReactElement;
actionAlignment?: 'center' | 'top' actionAlignment?: 'center' | 'top';
actionIcon?: string actionIcon?: string;
actionTitle?: string actionTitle?: string;
/** Override other actions for specificity like mute/unmute. */ /** Override other actions for specificity like mute/unmute. */
actionType?: 'muting' | 'blocking' | 'follow_request' actionType?: 'muting' | 'blocking' | 'follow_request';
avatarSize?: number avatarSize?: number;
hidden?: boolean hidden?: boolean;
hideActions?: boolean hideActions?: boolean;
id?: string id?: string;
onActionClick?: (account: any) => void onActionClick?: (account: any) => void;
showProfileHoverCard?: boolean showProfileHoverCard?: boolean;
timestamp?: string timestamp?: string;
timestampUrl?: string timestampUrl?: string;
futureTimestamp?: boolean futureTimestamp?: boolean;
withAccountNote?: boolean withAccountNote?: boolean;
withDate?: boolean withDate?: boolean;
withLinkToProfile?: boolean withLinkToProfile?: boolean;
withRelationship?: boolean withRelationship?: boolean;
showEdit?: boolean showEdit?: boolean;
approvalStatus?: StatusApprovalStatus approvalStatus?: StatusApprovalStatus;
emoji?: string emoji?: string;
emojiUrl?: string emojiUrl?: string;
note?: string note?: string;
} }
const Account = ({ const Account = ({

Wyświetl plik

@ -15,8 +15,8 @@ const obfuscatedCount = (count: number) => {
}; };
interface IAnimatedNumber { interface IAnimatedNumber {
value: number value: number;
obfuscate?: boolean obfuscate?: boolean;
} }
const AnimatedNumber: React.FC<IAnimatedNumber> = ({ value, obfuscate }) => { const AnimatedNumber: React.FC<IAnimatedNumber> = ({ value, obfuscate }) => {

Wyświetl plik

@ -4,7 +4,7 @@ import { useHistory } from 'react-router-dom';
import type { Announcement as AnnouncementEntity, Mention as MentionEntity } from 'soapbox/types/entities'; import type { Announcement as AnnouncementEntity, Mention as MentionEntity } from 'soapbox/types/entities';
interface IAnnouncementContent { interface IAnnouncementContent {
announcement: AnnouncementEntity announcement: AnnouncementEntity;
} }
const AnnouncementContent: React.FC<IAnnouncementContent> = ({ announcement }) => { const AnnouncementContent: React.FC<IAnnouncementContent> = ({ announcement }) => {

Wyświetl plik

@ -11,10 +11,10 @@ import type { Map as ImmutableMap } from 'immutable';
import type { Announcement as AnnouncementEntity } from 'soapbox/types/entities'; import type { Announcement as AnnouncementEntity } from 'soapbox/types/entities';
interface IAnnouncement { interface IAnnouncement {
announcement: AnnouncementEntity announcement: AnnouncementEntity;
addReaction: (id: string, name: string) => void addReaction: (id: string, name: string) => void;
removeReaction: (id: string, name: string) => void removeReaction: (id: string, name: string) => void;
emojiMap: ImmutableMap<string, ImmutableMap<string, string>> emojiMap: ImmutableMap<string, ImmutableMap<string, string>>;
} }
const Announcement: React.FC<IAnnouncement> = ({ announcement, addReaction, removeReaction, emojiMap }) => { const Announcement: React.FC<IAnnouncement> = ({ announcement, addReaction, removeReaction, emojiMap }) => {

Wyświetl plik

@ -7,9 +7,9 @@ import { joinPublicPath } from 'soapbox/utils/static';
import type { Map as ImmutableMap } from 'immutable'; import type { Map as ImmutableMap } from 'immutable';
interface IEmoji { interface IEmoji {
emoji: string emoji: string;
emojiMap: ImmutableMap<string, ImmutableMap<string, string>> emojiMap: ImmutableMap<string, ImmutableMap<string, string>>;
hovered: boolean hovered: boolean;
} }
const Emoji: React.FC<IEmoji> = ({ emoji, emojiMap, hovered }) => { const Emoji: React.FC<IEmoji> = ({ emoji, emojiMap, hovered }) => {

Wyświetl plik

@ -10,12 +10,12 @@ import type { Map as ImmutableMap } from 'immutable';
import type { AnnouncementReaction } from 'soapbox/types/entities'; import type { AnnouncementReaction } from 'soapbox/types/entities';
interface IReaction { interface IReaction {
announcementId: string announcementId: string;
reaction: AnnouncementReaction reaction: AnnouncementReaction;
emojiMap: ImmutableMap<string, ImmutableMap<string, string>> emojiMap: ImmutableMap<string, ImmutableMap<string, string>>;
addReaction: (id: string, name: string) => void addReaction: (id: string, name: string) => void;
removeReaction: (id: string, name: string) => void removeReaction: (id: string, name: string) => void;
style: React.CSSProperties style: React.CSSProperties;
} }
const Reaction: React.FC<IReaction> = ({ announcementId, reaction, addReaction, removeReaction, emojiMap, style }) => { const Reaction: React.FC<IReaction> = ({ announcementId, reaction, addReaction, removeReaction, emojiMap, style }) => {

Wyświetl plik

@ -12,11 +12,11 @@ import type { Emoji, NativeEmoji } from 'soapbox/features/emoji';
import type { AnnouncementReaction } from 'soapbox/types/entities'; import type { AnnouncementReaction } from 'soapbox/types/entities';
interface IReactionsBar { interface IReactionsBar {
announcementId: string announcementId: string;
reactions: ImmutableList<AnnouncementReaction> reactions: ImmutableList<AnnouncementReaction>;
emojiMap: ImmutableMap<string, ImmutableMap<string, string>> emojiMap: ImmutableMap<string, ImmutableMap<string, string>>;
addReaction: (id: string, name: string) => void addReaction: (id: string, name: string) => void;
removeReaction: (id: string, name: string) => void removeReaction: (id: string, name: string) => void;
} }
const ReactionsBar: React.FC<IReactionsBar> = ({ announcementId, reactions, addReaction, removeReaction, emojiMap }) => { const ReactionsBar: React.FC<IReactionsBar> = ({ announcementId, reactions, addReaction, removeReaction, emojiMap }) => {

Wyświetl plik

@ -9,9 +9,9 @@ import type { List as ImmutableList } from 'immutable';
import type { Attachment } from 'soapbox/types/entities'; import type { Attachment } from 'soapbox/types/entities';
interface IAttachmentThumbs { interface IAttachmentThumbs {
media: ImmutableList<Attachment> media: ImmutableList<Attachment>;
onClick?(): void onClick?(): void;
sensitive?: boolean sensitive?: boolean;
} }
const AttachmentThumbs = (props: IAttachmentThumbs) => { const AttachmentThumbs = (props: IAttachmentThumbs) => {

Wyświetl plik

@ -5,9 +5,9 @@ import { FormattedMessage } from 'react-intl';
import { HStack, IconButton, Text } from 'soapbox/components/ui'; import { HStack, IconButton, Text } from 'soapbox/components/ui';
interface IAuthorizeRejectButtons { interface IAuthorizeRejectButtons {
onAuthorize(): Promise<unknown> | unknown onAuthorize(): Promise<unknown> | unknown;
onReject(): Promise<unknown> | unknown onReject(): Promise<unknown> | unknown;
countdown?: number countdown?: number;
} }
/** Buttons to approve or reject a pending item, usually an account. */ /** Buttons to approve or reject a pending item, usually an account. */
@ -126,7 +126,7 @@ const AuthorizeRejectButtons: React.FC<IAuthorizeRejectButtons> = ({ onAuthorize
}; };
interface IActionEmblem { interface IActionEmblem {
text: React.ReactNode text: React.ReactNode;
} }
const ActionEmblem: React.FC<IActionEmblem> = ({ text }) => { const ActionEmblem: React.FC<IActionEmblem> = ({ text }) => {
@ -140,12 +140,12 @@ const ActionEmblem: React.FC<IActionEmblem> = ({ text }) => {
}; };
interface IAuthorizeRejectButton { interface IAuthorizeRejectButton {
theme: 'primary' | 'danger' theme: 'primary' | 'danger';
icon: string icon: string;
action(): void action(): void;
isLoading?: boolean isLoading?: boolean;
disabled?: boolean disabled?: boolean;
style: React.CSSProperties style: React.CSSProperties;
} }
const AuthorizeRejectButton: React.FC<IAuthorizeRejectButton> = ({ theme, icon, action, isLoading, style, disabled }) => { const AuthorizeRejectButton: React.FC<IAuthorizeRejectButton> = ({ theme, icon, action, isLoading, style, disabled }) => {

Wyświetl plik

@ -12,16 +12,16 @@ import type { InputThemes } from 'soapbox/components/ui/input/input';
const noOp = () => { }; const noOp = () => { };
interface IAutosuggestAccountInput { interface IAutosuggestAccountInput {
onChange: React.ChangeEventHandler<HTMLInputElement> onChange: React.ChangeEventHandler<HTMLInputElement>;
onSelected: (accountId: string) => void onSelected: (accountId: string) => void;
autoFocus?: boolean autoFocus?: boolean;
value: string value: string;
limit?: number limit?: number;
className?: string className?: string;
autoSelect?: boolean autoSelect?: boolean;
menu?: Menu menu?: Menu;
onKeyDown?: React.KeyboardEventHandler onKeyDown?: React.KeyboardEventHandler;
theme?: InputThemes theme?: InputThemes;
} }
const AutosuggestAccountInput: React.FC<IAutosuggestAccountInput> = ({ const AutosuggestAccountInput: React.FC<IAutosuggestAccountInput> = ({

Wyświetl plik

@ -7,7 +7,7 @@ import { joinPublicPath } from 'soapbox/utils/static';
import type { Emoji } from 'soapbox/features/emoji'; import type { Emoji } from 'soapbox/features/emoji';
interface IAutosuggestEmoji { interface IAutosuggestEmoji {
emoji: Emoji emoji: Emoji;
} }
const AutosuggestEmoji: React.FC<IAutosuggestEmoji> = ({ emoji }) => { const AutosuggestEmoji: React.FC<IAutosuggestEmoji> = ({ emoji }) => {

Wyświetl plik

@ -17,23 +17,23 @@ import type { Emoji } from 'soapbox/features/emoji';
export type AutoSuggestion = string | Emoji; export type AutoSuggestion = string | Emoji;
export interface IAutosuggestInput extends Pick<React.HTMLAttributes<HTMLInputElement>, 'onChange' | 'onKeyUp' | 'onKeyDown'> { export interface IAutosuggestInput extends Pick<React.HTMLAttributes<HTMLInputElement>, 'onChange' | 'onKeyUp' | 'onKeyDown'> {
value: string value: string;
suggestions: ImmutableList<any> suggestions: ImmutableList<any>;
disabled?: boolean disabled?: boolean;
placeholder?: string placeholder?: string;
onSuggestionSelected: (tokenStart: number, lastToken: string | null, suggestion: AutoSuggestion) => void onSuggestionSelected: (tokenStart: number, lastToken: string | null, suggestion: AutoSuggestion) => void;
onSuggestionsClearRequested: () => void onSuggestionsClearRequested: () => void;
onSuggestionsFetchRequested: (token: string) => void onSuggestionsFetchRequested: (token: string) => void;
autoFocus: boolean autoFocus: boolean;
autoSelect: boolean autoSelect: boolean;
className?: string className?: string;
id?: string id?: string;
searchTokens: string[] searchTokens: string[];
maxLength?: number maxLength?: number;
menu?: Menu menu?: Menu;
renderSuggestion?: React.FC<{ id: string }> renderSuggestion?: React.FC<{ id: string }>;
hidePortal?: boolean hidePortal?: boolean;
theme?: InputThemes theme?: InputThemes;
} }
export default class AutosuggestInput extends ImmutablePureComponent<IAutosuggestInput> { export default class AutosuggestInput extends ImmutablePureComponent<IAutosuggestInput> {

Wyświetl plik

@ -19,7 +19,7 @@ export const ADDRESS_ICONS: Record<string, string> = {
}; };
interface IAutosuggestLocation { interface IAutosuggestLocation {
id: string id: string;
} }
const AutosuggestLocation: React.FC<IAutosuggestLocation> = ({ id }) => { const AutosuggestLocation: React.FC<IAutosuggestLocation> = ({ id }) => {

Wyświetl plik

@ -14,23 +14,23 @@ import type { List as ImmutableList } from 'immutable';
import type { Emoji } from 'soapbox/features/emoji'; import type { Emoji } from 'soapbox/features/emoji';
interface IAutosuggesteTextarea { interface IAutosuggesteTextarea {
id?: string id?: string;
value: string value: string;
suggestions: ImmutableList<string> suggestions: ImmutableList<string>;
disabled: boolean disabled: boolean;
placeholder: string placeholder: string;
onSuggestionSelected: (tokenStart: number, token: string | null, value: string | undefined) => void onSuggestionSelected: (tokenStart: number, token: string | null, value: string | undefined) => void;
onSuggestionsClearRequested: () => void onSuggestionsClearRequested: () => void;
onSuggestionsFetchRequested: (token: string | number) => void onSuggestionsFetchRequested: (token: string | number) => void;
onChange: React.ChangeEventHandler<HTMLTextAreaElement> onChange: React.ChangeEventHandler<HTMLTextAreaElement>;
onKeyUp?: React.KeyboardEventHandler<HTMLTextAreaElement> onKeyUp?: React.KeyboardEventHandler<HTMLTextAreaElement>;
onKeyDown?: React.KeyboardEventHandler<HTMLTextAreaElement> onKeyDown?: React.KeyboardEventHandler<HTMLTextAreaElement>;
onPaste: (files: FileList) => void onPaste: (files: FileList) => void;
autoFocus: boolean autoFocus: boolean;
onFocus: () => void onFocus: () => void;
onBlur?: () => void onBlur?: () => void;
condensed?: boolean condensed?: boolean;
children: React.ReactNode children: React.ReactNode;
} }
class AutosuggestTextarea extends ImmutablePureComponent<IAutosuggesteTextarea> { class AutosuggestTextarea extends ImmutablePureComponent<IAutosuggesteTextarea> {

Wyświetl plik

@ -11,8 +11,8 @@ import type { Account } from 'soapbox/types/entities';
const getAccount = makeGetAccount(); const getAccount = makeGetAccount();
interface IAvatarStack { interface IAvatarStack {
accountIds: ImmutableOrderedSet<string> accountIds: ImmutableOrderedSet<string>;
limit?: number limit?: number;
} }
const AvatarStack: React.FC<IAvatarStack> = ({ accountIds, limit = 3 }) => { const AvatarStack: React.FC<IAvatarStack> = ({ accountIds, limit = 3 }) => {

Wyświetl plik

@ -2,8 +2,8 @@ import clsx from 'clsx';
import React from 'react'; import React from 'react';
interface IBadge { interface IBadge {
title: React.ReactNode title: React.ReactNode;
slug: string slug: string;
} }
/** Badge to display on a user's profile. */ /** Badge to display on a user's profile. */
const Badge: React.FC<IBadge> = ({ title, slug }) => { const Badge: React.FC<IBadge> = ({ title, slug }) => {

Wyświetl plik

@ -3,9 +3,9 @@ import React from 'react';
import { Card, CardBody, Stack, Text } from 'soapbox/components/ui'; import { Card, CardBody, Stack, Text } from 'soapbox/components/ui';
interface IBigCard { interface IBigCard {
title: React.ReactNode title: React.ReactNode;
subtitle?: React.ReactNode subtitle?: React.ReactNode;
children: React.ReactNode children: React.ReactNode;
} }
const BigCard: React.FC<IBigCard> = ({ title, subtitle, children }) => { const BigCard: React.FC<IBigCard> = ({ title, subtitle, children }) => {

Wyświetl plik

@ -15,9 +15,9 @@ const messages = defineMessages({
}); });
interface IBirthdayInput { interface IBirthdayInput {
value?: string value?: string;
onChange: (value: string) => void onChange: (value: string) => void;
required?: boolean required?: boolean;
} }
const BirthdayInput: React.FC<IBirthdayInput> = ({ value, onChange, required }) => { const BirthdayInput: React.FC<IBirthdayInput> = ({ value, onChange, required }) => {
@ -56,15 +56,15 @@ const BirthdayInput: React.FC<IBirthdayInput> = ({ value, onChange, required })
nextYearButtonDisabled, nextYearButtonDisabled,
date, date,
}: { }: {
decreaseMonth(): void decreaseMonth(): void;
increaseMonth(): void increaseMonth(): void;
prevMonthButtonDisabled: boolean prevMonthButtonDisabled: boolean;
nextMonthButtonDisabled: boolean nextMonthButtonDisabled: boolean;
decreaseYear(): void decreaseYear(): void;
increaseYear(): void increaseYear(): void;
prevYearButtonDisabled: boolean prevYearButtonDisabled: boolean;
nextYearButtonDisabled: boolean nextYearButtonDisabled: boolean;
date: Date date: Date;
}) => { }) => {
return ( return (
<div className='flex flex-col gap-2'> <div className='flex flex-col gap-2'>

Wyświetl plik

@ -15,7 +15,7 @@ const timeToMidnight = () => {
}; };
interface IBirthdayPanel { interface IBirthdayPanel {
limit: number limit: number;
} }
const BirthdayPanel = ({ limit }: IBirthdayPanel) => { const BirthdayPanel = ({ limit }: IBirthdayPanel) => {

Wyświetl plik

@ -3,18 +3,18 @@ import React, { useRef, useEffect } from 'react';
interface IBlurhash { interface IBlurhash {
/** Hash to render */ /** Hash to render */
hash: string | null | undefined hash: string | null | undefined;
/** Width of the blurred region in pixels. Defaults to 32. */ /** Width of the blurred region in pixels. Defaults to 32. */
width?: number width?: number;
/** Height of the blurred region in pixels. Defaults to width. */ /** Height of the blurred region in pixels. Defaults to width. */
height?: number height?: number;
/** /**
* Whether dummy mode is enabled. If enabled, nothing is rendered * Whether dummy mode is enabled. If enabled, nothing is rendered
* and canvas left untouched. * and canvas left untouched.
*/ */
dummy?: boolean dummy?: boolean;
/** className of the canvas element. */ /** className of the canvas element. */
className?: string className?: string;
} }
/** /**

Wyświetl plik

@ -5,7 +5,7 @@ import { Button, HStack, Input } from './ui';
interface ICopyableInput { interface ICopyableInput {
/** Text to be copied. */ /** Text to be copied. */
value: string value: string;
} }
/** An input with copy abilities. */ /** An input with copy abilities. */

Wyświetl plik

@ -11,9 +11,9 @@ import VerificationBadge from './verification-badge';
import type { Account } from 'soapbox/schemas'; import type { Account } from 'soapbox/schemas';
interface IDisplayName { interface IDisplayName {
account: Pick<Account, 'id' | 'acct' | 'fqn' | 'verified' | 'display_name_html'> account: Pick<Account, 'id' | 'acct' | 'fqn' | 'verified' | 'display_name_html'>;
withSuffix?: boolean withSuffix?: boolean;
children?: React.ReactNode children?: React.ReactNode;
} }
const DisplayName: React.FC<IDisplayName> = ({ account, children, withSuffix = true }) => { const DisplayName: React.FC<IDisplayName> = ({ account, children, withSuffix = true }) => {

Wyświetl plik

@ -12,7 +12,7 @@ const messages = defineMessages({
}); });
interface IDomain { interface IDomain {
domain: string domain: string;
} }
const Domain: React.FC<IDomain> = ({ domain }) => { const Domain: React.FC<IDomain> = ({ domain }) => {

Wyświetl plik

@ -5,23 +5,23 @@ import { useHistory } from 'react-router-dom';
import { Counter, Icon } from '../ui'; import { Counter, Icon } from '../ui';
export interface MenuItem { export interface MenuItem {
action?: React.EventHandler<React.KeyboardEvent | React.MouseEvent> action?: React.EventHandler<React.KeyboardEvent | React.MouseEvent>;
active?: boolean active?: boolean;
count?: number count?: number;
destructive?: boolean destructive?: boolean;
href?: string href?: string;
icon?: string icon?: string;
meta?: string meta?: string;
middleClick?(event: React.MouseEvent): void middleClick?(event: React.MouseEvent): void;
target?: React.HTMLAttributeAnchorTarget target?: React.HTMLAttributeAnchorTarget;
text: string text: string;
to?: string to?: string;
} }
interface IDropdownMenuItem { interface IDropdownMenuItem {
index: number index: number;
item: MenuItem | null item: MenuItem | null;
onClick?(): void onClick?(): void;
} }
const DropdownMenuItem = ({ index, item, onClick }: IDropdownMenuItem) => { const DropdownMenuItem = ({ index, item, onClick }: IDropdownMenuItem) => {

Wyświetl plik

@ -18,16 +18,16 @@ import type { Status } from 'soapbox/types/entities';
export type Menu = Array<MenuItem | null>; export type Menu = Array<MenuItem | null>;
interface IDropdownMenu { interface IDropdownMenu {
children?: React.ReactElement children?: React.ReactElement;
disabled?: boolean disabled?: boolean;
items: Menu items: Menu;
onClose?: () => void onClose?: () => void;
onOpen?: () => void onOpen?: () => void;
onShiftClick?: React.EventHandler<React.MouseEvent | React.KeyboardEvent> onShiftClick?: React.EventHandler<React.MouseEvent | React.KeyboardEvent>;
placement?: Placement placement?: Placement;
src?: string src?: string;
status?: Status status?: Status;
title?: string title?: string;
} }
const listenerOptions = supportsPassiveEvents ? { passive: true } : false; const listenerOptions = supportsPassiveEvents ? { passive: true } : false;

Wyświetl plik

@ -27,14 +27,14 @@ const mapStateToProps = (state: RootState) => {
}; };
interface Props extends ReturnType<typeof mapStateToProps> { interface Props extends ReturnType<typeof mapStateToProps> {
children: React.ReactNode children: React.ReactNode;
} }
type State = { type State = {
hasError: boolean hasError: boolean;
error: any error: any;
componentStack: any componentStack: any;
browser?: Bowser.Parser.Parser browser?: Bowser.Parser.Parser;
} }
class ErrorBoundary extends React.PureComponent<Props, State> { class ErrorBoundary extends React.PureComponent<Props, State> {

Wyświetl plik

@ -19,10 +19,10 @@ const messages = defineMessages({
}); });
interface IEventPreview { interface IEventPreview {
status: StatusEntity status: StatusEntity;
className?: string className?: string;
hideAction?: boolean hideAction?: boolean;
floatingAction?: boolean floatingAction?: boolean;
} }
const EventPreview: React.FC<IEventPreview> = ({ status, className, hideAction, floatingAction = true }) => { const EventPreview: React.FC<IEventPreview> = ({ status, className, hideAction, floatingAction = true }) => {

Wyświetl plik

@ -3,14 +3,14 @@ import React, { useEffect, useRef } from 'react';
import { isIOS } from 'soapbox/is-mobile'; import { isIOS } from 'soapbox/is-mobile';
interface IExtendedVideoPlayer { interface IExtendedVideoPlayer {
src: string src: string;
alt?: string alt?: string;
width?: number width?: number;
height?: number height?: number;
time?: number time?: number;
controls?: boolean controls?: boolean;
muted?: boolean muted?: boolean;
onClick?: () => void onClick?: () => void;
} }
const ExtendedVideoPlayer: React.FC<IExtendedVideoPlayer> = ({ src, alt, time, controls, muted, onClick }) => { const ExtendedVideoPlayer: React.FC<IExtendedVideoPlayer> = ({ src, alt, time, controls, muted, onClick }) => {

Wyświetl plik

@ -9,9 +9,9 @@ import clsx from 'clsx';
import React from 'react'; import React from 'react';
export interface IForkAwesomeIcon extends React.HTMLAttributes<HTMLLIElement> { export interface IForkAwesomeIcon extends React.HTMLAttributes<HTMLLIElement> {
id: string id: string;
className?: string className?: string;
fixedWidth?: boolean fixedWidth?: boolean;
} }
const ForkAwesomeIcon: React.FC<IForkAwesomeIcon> = ({ id, className, fixedWidth, ...rest }) => { const ForkAwesomeIcon: React.FC<IForkAwesomeIcon> = ({ id, className, fixedWidth, ...rest }) => {

Wyświetl plik

@ -11,7 +11,7 @@ import { HStack, Stack, Text } from './ui';
import type { Group as GroupEntity } from 'soapbox/types/entities'; import type { Group as GroupEntity } from 'soapbox/types/entities';
interface IGroupCard { interface IGroupCard {
group: GroupEntity group: GroupEntity;
} }
const GroupCard: React.FC<IGroupCard> = ({ group }) => { const GroupCard: React.FC<IGroupCard> = ({ group }) => {

Wyświetl plik

@ -8,9 +8,9 @@ import { Avatar } from '../ui';
import type { Group } from 'soapbox/schemas'; import type { Group } from 'soapbox/schemas';
interface IGroupAvatar { interface IGroupAvatar {
group: Group group: Group;
size: number size: number;
withRing?: boolean withRing?: boolean;
} }
const GroupAvatar = (props: IGroupAvatar) => { const GroupAvatar = (props: IGroupAvatar) => {

Wyświetl plik

@ -11,9 +11,9 @@ import GroupAvatar from '../group-avatar';
import type { Group } from 'soapbox/schemas'; import type { Group } from 'soapbox/schemas';
interface IGroupPopoverContainer { interface IGroupPopoverContainer {
children: React.ReactElement<any, string | React.JSXElementConstructor<any>> children: React.ReactElement<any, string | React.JSXElementConstructor<any>>;
isEnabled: boolean isEnabled: boolean;
group: Group group: Group;
} }
const messages = defineMessages({ const messages = defineMessages({

Wyświetl plik

@ -10,7 +10,7 @@ import { HStack, Stack, Text } from './ui';
import type { Tag } from 'soapbox/types/entities'; import type { Tag } from 'soapbox/types/entities';
interface IHashtag { interface IHashtag {
hashtag: Tag hashtag: Tag;
} }
const Hashtag: React.FC<IHashtag> = ({ hashtag }) => { const Hashtag: React.FC<IHashtag> = ({ hashtag }) => {

Wyświetl plik

@ -16,7 +16,7 @@ const getNotifTotals = (state: RootState): number => {
}; };
interface IHelmet { interface IHelmet {
children: React.ReactNode children: React.ReactNode;
} }
const Helmet: React.FC<IHelmet> = ({ children }) => { const Helmet: React.FC<IHelmet> = ({ children }) => {

Wyświetl plik

@ -7,15 +7,15 @@ import { Layout } from '../ui';
interface IGroupLookup { interface IGroupLookup {
params: { params: {
groupSlug: string groupSlug: string;
} };
} }
interface IMaybeGroupLookup { interface IMaybeGroupLookup {
params?: { params?: {
groupSlug?: string groupSlug?: string;
groupId?: string groupId?: string;
} };
} }
function GroupLookupHoc(Component: React.ComponentType<{ params: { groupId: string } }>) { function GroupLookupHoc(Component: React.ComponentType<{ params: { groupId: string } }>) {

Wyświetl plik

@ -15,10 +15,10 @@ const showProfileHoverCard = debounce((dispatch, ref, accountId) => {
}, 600); }, 600);
interface IHoverRefWrapper { interface IHoverRefWrapper {
accountId: string accountId: string;
inline?: boolean inline?: boolean;
className?: string className?: string;
children: React.ReactNode children: React.ReactNode;
} }
/** Makes a profile hover card appear when the wrapped element is hovered. */ /** Makes a profile hover card appear when the wrapped element is hovered. */

Wyświetl plik

@ -14,10 +14,10 @@ const showStatusHoverCard = debounce((dispatch, ref, statusId) => {
}, 300); }, 300);
interface IHoverStatusWrapper { interface IHoverStatusWrapper {
statusId: any statusId: any;
inline: boolean inline: boolean;
className?: string className?: string;
children: React.ReactNode children: React.ReactNode;
} }
/** Makes a status hover card appear when the wrapped element is hovered. */ /** Makes a status hover card appear when the wrapped element is hovered. */

Wyświetl plik

@ -4,13 +4,13 @@ import React from 'react';
import Icon from 'soapbox/components/icon'; import Icon from 'soapbox/components/icon';
interface IIconButton extends Pick<React.ButtonHTMLAttributes<HTMLButtonElement>, 'className' | 'disabled' | 'onClick' | 'onKeyDown' | 'onKeyPress' | 'onKeyUp' | 'onMouseDown' | 'onMouseEnter' | 'onMouseLeave' | 'tabIndex' | 'title'> { interface IIconButton extends Pick<React.ButtonHTMLAttributes<HTMLButtonElement>, 'className' | 'disabled' | 'onClick' | 'onKeyDown' | 'onKeyPress' | 'onKeyUp' | 'onMouseDown' | 'onMouseEnter' | 'onMouseLeave' | 'tabIndex' | 'title'> {
active?: boolean active?: boolean;
expanded?: boolean expanded?: boolean;
iconClassName?: string iconClassName?: string;
pressed?: boolean pressed?: boolean;
size?: number size?: number;
src: string src: string;
text?: React.ReactNode text?: React.ReactNode;
} }
const IconButton: React.FC<IIconButton> = ({ const IconButton: React.FC<IIconButton> = ({

Wyświetl plik

@ -4,10 +4,10 @@ import Icon, { IIcon } from 'soapbox/components/icon';
import { Counter } from 'soapbox/components/ui'; import { Counter } from 'soapbox/components/ui';
interface IIconWithCounter extends React.HTMLAttributes<HTMLDivElement> { interface IIconWithCounter extends React.HTMLAttributes<HTMLDivElement> {
count: number count: number;
countMax?: number countMax?: number;
icon?: string icon?: string;
src?: string src?: string;
} }
const IconWithCounter: React.FC<IIconWithCounter> = ({ icon, count, countMax, ...rest }) => { const IconWithCounter: React.FC<IIconWithCounter> = ({ icon, count, countMax, ...rest }) => {

Wyświetl plik

@ -8,10 +8,10 @@ import React from 'react';
import InlineSVG from 'react-inlinesvg'; // eslint-disable-line no-restricted-imports import InlineSVG from 'react-inlinesvg'; // eslint-disable-line no-restricted-imports
export interface IIcon extends React.HTMLAttributes<HTMLDivElement> { export interface IIcon extends React.HTMLAttributes<HTMLDivElement> {
src: string src: string;
id?: string id?: string;
alt?: string alt?: string;
className?: string className?: string;
} }
/** /**

Wyświetl plik

@ -8,7 +8,7 @@ import { SelectDropdown } from '../features/forms';
import { Icon, HStack, Select } from './ui'; import { Icon, HStack, Select } from './ui';
interface IList { interface IList {
children: React.ReactNode children: React.ReactNode;
} }
const List: React.FC<IList> = ({ children }) => ( const List: React.FC<IList> = ({ children }) => (
@ -16,13 +16,13 @@ const List: React.FC<IList> = ({ children }) => (
); );
interface IListItem { interface IListItem {
label: React.ReactNode label: React.ReactNode;
hint?: React.ReactNode hint?: React.ReactNode;
to?: string to?: string;
onClick?(): void onClick?(): void;
onSelect?(): void onSelect?(): void;
isSelected?: boolean isSelected?: boolean;
children?: React.ReactNode children?: React.ReactNode;
} }
const ListItem: React.FC<IListItem> = ({ label, hint, children, to, onClick, onSelect, isSelected }) => { const ListItem: React.FC<IListItem> = ({ label, hint, children, to, onClick, onSelect, isSelected }) => {

Wyświetl plik

@ -8,9 +8,9 @@ const messages = defineMessages({
}); });
interface ILoadGap { interface ILoadGap {
disabled?: boolean disabled?: boolean;
maxId: string maxId: string;
onClick: (id: string) => void onClick: (id: string) => void;
} }
const LoadGap: React.FC<ILoadGap> = ({ disabled, maxId, onClick }) => { const LoadGap: React.FC<ILoadGap> = ({ disabled, maxId, onClick }) => {

Wyświetl plik

@ -4,10 +4,10 @@ import { FormattedMessage } from 'react-intl';
import { Button } from 'soapbox/components/ui'; import { Button } from 'soapbox/components/ui';
interface ILoadMore { interface ILoadMore {
onClick: React.MouseEventHandler onClick: React.MouseEventHandler;
disabled?: boolean disabled?: boolean;
visible?: boolean visible?: boolean;
className?: string className?: string;
} }
const LoadMore: React.FC<ILoadMore> = ({ onClick, disabled, visible = true, className }) => { const LoadMore: React.FC<ILoadMore> = ({ onClick, disabled, visible = true, className }) => {

Wyświetl plik

@ -18,7 +18,7 @@ const messages = defineMessages({
}); });
interface ILocationSearch { interface ILocationSearch {
onSelected: (locationId: string) => void onSelected: (locationId: string) => void;
} }
const LocationSearch: React.FC<ILocationSearch> = ({ onSelected }) => { const LocationSearch: React.FC<ILocationSearch> = ({ onSelected }) => {

Wyświetl plik

@ -19,21 +19,21 @@ const ATTACHMENT_LIMIT = 4;
const MAX_FILENAME_LENGTH = 45; const MAX_FILENAME_LENGTH = 45;
interface Dimensions { interface Dimensions {
w: Property.Width | number w: Property.Width | number;
h: Property.Height | number h: Property.Height | number;
t?: Property.Top t?: Property.Top;
r?: Property.Right r?: Property.Right;
b?: Property.Bottom b?: Property.Bottom;
l?: Property.Left l?: Property.Left;
float?: Property.Float float?: Property.Float;
pos?: Property.Position pos?: Property.Position;
} }
interface SizeData { interface SizeData {
style: React.CSSProperties style: React.CSSProperties;
itemsDimensions: Dimensions[] itemsDimensions: Dimensions[];
size: number size: number;
width: number width: number;
} }
const withinLimits = (aspectRatio: number) => { const withinLimits = (aspectRatio: number) => {
@ -48,16 +48,16 @@ const shouldLetterbox = (attachment: Attachment): boolean => {
}; };
interface IItem { interface IItem {
attachment: Attachment attachment: Attachment;
standalone?: boolean standalone?: boolean;
index: number index: number;
size: number size: number;
onClick: (index: number) => void onClick: (index: number) => void;
displayWidth?: number displayWidth?: number;
visible: boolean visible: boolean;
dimensions: Dimensions dimensions: Dimensions;
last?: boolean last?: boolean;
total: number total: number;
} }
const Item: React.FC<IItem> = ({ const Item: React.FC<IItem> = ({
@ -275,17 +275,17 @@ const Item: React.FC<IItem> = ({
}; };
export interface IMediaGallery { export interface IMediaGallery {
sensitive?: boolean sensitive?: boolean;
media: ImmutableList<Attachment> media: ImmutableList<Attachment>;
height?: number height?: number;
onOpenMedia: (media: ImmutableList<Attachment>, index: number) => void onOpenMedia: (media: ImmutableList<Attachment>, index: number) => void;
defaultWidth?: number defaultWidth?: number;
cacheWidth?: (width: number) => void cacheWidth?: (width: number) => void;
visible?: boolean visible?: boolean;
onToggleVisibility?: () => void onToggleVisibility?: () => void;
displayMedia?: string displayMedia?: string;
compact?: boolean compact?: boolean;
className?: string className?: string;
} }
const MediaGallery: React.FC<IMediaGallery> = (props) => { const MediaGallery: React.FC<IMediaGallery> = (props) => {

Wyświetl plik

@ -4,7 +4,7 @@ import { FormattedMessage } from 'react-intl';
import { Card, CardBody, Stack, Text } from './ui'; import { Card, CardBody, Stack, Text } from './ui';
interface MissingIndicatorProps { interface MissingIndicatorProps {
nested?: boolean nested?: boolean;
} }
const MissingIndicator = ({ nested = false }: MissingIndicatorProps): JSX.Element => ( const MissingIndicator = ({ nested = false }: MissingIndicatorProps): JSX.Element => (

Wyświetl plik

@ -37,10 +37,10 @@ export const checkEventComposeContent = (compose?: ReturnType<typeof ReducerComp
}; };
interface IModalRoot { interface IModalRoot {
onCancel?: () => void onCancel?: () => void;
onClose: (type?: ModalType) => void onClose: (type?: ModalType) => void;
type: ModalType type: ModalType;
children: React.ReactNode children: React.ReactNode;
} }
const ModalRoot: React.FC<IModalRoot> = ({ children, onCancel, onClose, type }) => { const ModalRoot: React.FC<IModalRoot> = ({ children, onCancel, onClose, type }) => {

Wyświetl plik

@ -5,7 +5,7 @@ import { Text } from 'soapbox/components/ui';
import { useSettings, useSoapboxConfig } from 'soapbox/hooks'; import { useSettings, useSoapboxConfig } from 'soapbox/hooks';
interface INavlinks { interface INavlinks {
type: string type: string;
} }
const Navlinks: React.FC<INavlinks> = ({ type }) => { const Navlinks: React.FC<INavlinks> = ({ type }) => {

Wyświetl plik

@ -2,8 +2,8 @@ import clsx from 'clsx';
import React from 'react'; import React from 'react';
interface IOutlineBox extends React.HTMLAttributes<HTMLDivElement> { interface IOutlineBox extends React.HTMLAttributes<HTMLDivElement> {
children: React.ReactNode children: React.ReactNode;
className?: string className?: string;
} }
/** Wraps children in a container with an outline. */ /** Wraps children in a container with an outline. */

Wyświetl plik

@ -7,11 +7,11 @@ import { HStack, Icon, Text } from 'soapbox/components/ui';
interface IPendingItemsRow { interface IPendingItemsRow {
/** Path to navigate the user when clicked. */ /** Path to navigate the user when clicked. */
to: string to: string;
/** Number of pending items. */ /** Number of pending items. */
count: number count: number;
/** Size of the icon. */ /** Size of the icon. */
size?: 'md' | 'lg' size?: 'md' | 'lg';
} }
const PendingItemsRow: React.FC<IPendingItemsRow> = ({ to, count, size = 'md' }) => { const PendingItemsRow: React.FC<IPendingItemsRow> = ({ to, count, size = 'md' }) => {

Wyświetl plik

@ -16,9 +16,9 @@ const messages = defineMessages({
}); });
interface IPollFooter { interface IPollFooter {
poll: PollEntity poll: PollEntity;
showResults: boolean showResults: boolean;
selected: Selected selected: Selected;
} }
const PollFooter: React.FC<IPollFooter> = ({ poll, showResults, selected }): JSX.Element => { const PollFooter: React.FC<IPollFooter> = ({ poll, showResults, selected }): JSX.Element => {

Wyświetl plik

@ -15,7 +15,7 @@ const messages = defineMessages({
votes: { id: 'poll.votes', defaultMessage: '{votes, plural, one {# vote} other {# votes}}' }, votes: { id: 'poll.votes', defaultMessage: '{votes, plural, one {# vote} other {# votes}}' },
}); });
const PollPercentageBar: React.FC<{ percent: number, leading: boolean }> = ({ percent, leading }): JSX.Element => { const PollPercentageBar: React.FC<{ percent: number; leading: boolean }> = ({ percent, leading }): JSX.Element => {
return ( return (
<Motion defaultStyle={{ width: 0 }} style={{ width: spring(percent, { ...presets.gentle, precision: 0.1 }) }}> <Motion defaultStyle={{ width: 0 }} style={{ width: spring(percent, { ...presets.gentle, precision: 0.1 }) }}>
{({ width }) => ( {({ width }) => (
@ -29,7 +29,7 @@ const PollPercentageBar: React.FC<{ percent: number, leading: boolean }> = ({ pe
}; };
interface IPollOptionText extends IPollOption { interface IPollOptionText extends IPollOption {
percent: number percent: number;
} }
const PollOptionText: React.FC<IPollOptionText> = ({ poll, option, index, active, onToggle }) => { const PollOptionText: React.FC<IPollOptionText> = ({ poll, option, index, active, onToggle }) => {
@ -95,12 +95,12 @@ const PollOptionText: React.FC<IPollOptionText> = ({ poll, option, index, active
}; };
interface IPollOption { interface IPollOption {
poll: PollEntity poll: PollEntity;
option: PollOptionEntity option: PollOptionEntity;
index: number index: number;
showResults?: boolean showResults?: boolean;
active: boolean active: boolean;
onToggle: (value: number) => void onToggle: (value: number) => void;
} }
const PollOption: React.FC<IPollOption> = (props): JSX.Element | null => { const PollOption: React.FC<IPollOption> = (props): JSX.Element | null => {

Wyświetl plik

@ -13,8 +13,8 @@ import PollOption from './poll-option';
export type Selected = Record<number, boolean>; export type Selected = Record<number, boolean>;
interface IPoll { interface IPoll {
id: string id: string;
status?: string status?: string;
} }
const messages = defineMessages({ const messages = defineMessages({

Wyświetl plik

@ -56,7 +56,7 @@ const handleMouseLeave = (dispatch: AppDispatch): React.MouseEventHandler => {
}; };
interface IProfileHoverCard { interface IProfileHoverCard {
visible: boolean visible: boolean;
} }
/** Popup profile preview that appears when hovering avatars and display names. */ /** Popup profile preview that appears when hovering avatars and display names. */

Wyświetl plik

@ -2,10 +2,10 @@ import clsx from 'clsx';
import React from 'react'; import React from 'react';
interface IProgressCircle { interface IProgressCircle {
progress: number progress: number;
radius?: number radius?: number;
stroke?: number stroke?: number;
title?: string title?: string;
} }
const ProgressCircle: React.FC<IProgressCircle> = ({ progress, radius = 12, stroke = 4, title }) => { const ProgressCircle: React.FC<IProgressCircle> = ({ progress, radius = 12, stroke = 4, title }) => {

Wyświetl plik

@ -4,10 +4,10 @@ import PTRComponent from 'react-simple-pull-to-refresh';
import { Spinner } from 'soapbox/components/ui'; import { Spinner } from 'soapbox/components/ui';
interface IPullToRefresh { interface IPullToRefresh {
onRefresh?: () => Promise<any> onRefresh?: () => Promise<any>;
refreshingContent?: JSX.Element | string refreshingContent?: JSX.Element | string;
pullingContent?: JSX.Element | string pullingContent?: JSX.Element | string;
children: React.ReactNode children: React.ReactNode;
} }
/** /**

Wyświetl plik

@ -3,7 +3,7 @@ import React from 'react';
import PullToRefresh from './pull-to-refresh'; import PullToRefresh from './pull-to-refresh';
interface IPullable { interface IPullable {
children: React.ReactNode children: React.ReactNode;
} }
/** /**

Wyświetl plik

@ -23,11 +23,11 @@ const messages = defineMessages({
interface IQuotedStatus { interface IQuotedStatus {
/** The quoted status entity. */ /** The quoted status entity. */
status?: StatusEntity status?: StatusEntity;
/** Callback when cancelled (during compose). */ /** Callback when cancelled (during compose). */
onCancel?: Function onCancel?: Function;
/** Whether the status is shown in the post composer. */ /** Whether the status is shown in the post composer. */
compose?: boolean compose?: boolean;
} }
/** Status embedded in a quote post. */ /** Status embedded in a quote post. */

Wyświetl plik

@ -3,8 +3,8 @@ import React from 'react';
import List, { ListItem } from './list'; import List, { ListItem } from './list';
interface IRadioGroup { interface IRadioGroup {
onChange: React.ChangeEventHandler onChange: React.ChangeEventHandler;
children: React.ReactElement<{ onChange: React.ChangeEventHandler }>[] children: React.ReactElement<{ onChange: React.ChangeEventHandler }>[];
} }
const RadioGroup = ({ onChange, children }: IRadioGroup) => { const RadioGroup = ({ onChange, children }: IRadioGroup) => {
@ -16,11 +16,11 @@ const RadioGroup = ({ onChange, children }: IRadioGroup) => {
}; };
interface IRadioItem { interface IRadioItem {
label: React.ReactNode label: React.ReactNode;
hint?: React.ReactNode hint?: React.ReactNode;
value: string value: string;
checked: boolean checked: boolean;
onChange?: React.ChangeEventHandler onChange?: React.ChangeEventHandler;
} }
const RadioItem: React.FC<IRadioItem> = ({ label, hint, checked = false, onChange, value }) => { const RadioItem: React.FC<IRadioItem> = ({ label, hint, checked = false, onChange, value }) => {

Wyświetl plik

@ -113,14 +113,14 @@ const timeRemainingString = (intl: IntlShape, date: Date, now: number) => {
}; };
interface RelativeTimestampProps extends IText { interface RelativeTimestampProps extends IText {
intl: IntlShape intl: IntlShape;
timestamp: string timestamp: string;
year?: number year?: number;
futureDate?: boolean futureDate?: boolean;
} }
interface RelativeTimestampState { interface RelativeTimestampState {
now: number now: number;
} }
/** Displays a timestamp compared to the current time, eg "1m" for one minute ago. */ /** Displays a timestamp compared to the current time, eg "1m" for one minute ago. */

Wyświetl plik

@ -2,13 +2,13 @@ import React, { useCallback, useEffect, useRef, useState } from 'react';
interface ISafeEmbed { interface ISafeEmbed {
/** Styles for the outer frame element. */ /** Styles for the outer frame element. */
className?: string className?: string;
/** Space-separate list of restrictions to ALLOW for the iframe. */ /** Space-separate list of restrictions to ALLOW for the iframe. */
sandbox?: string sandbox?: string;
/** Unique title for the iframe. */ /** Unique title for the iframe. */
title: string title: string;
/** HTML body to embed. */ /** HTML body to embed. */
html?: string html?: string;
} }
/** Safely embeds arbitrary HTML content on the page (by putting it in an iframe). */ /** Safely embeds arbitrary HTML content on the page (by putting it in an iframe). */

Wyświetl plik

@ -7,15 +7,15 @@ import { useSettings } from 'soapbox/hooks';
interface IScrollTopButton { interface IScrollTopButton {
/** Callback when clicked, and also when scrolled to the top. */ /** Callback when clicked, and also when scrolled to the top. */
onClick: () => void onClick: () => void;
/** Number of unread items. */ /** Number of unread items. */
count: number count: number;
/** Message to display in the button (should contain a `{count}` value). */ /** Message to display in the button (should contain a `{count}` value). */
message: MessageDescriptor message: MessageDescriptor;
/** Distance from the top of the screen (scrolling down) before the button appears. */ /** Distance from the top of the screen (scrolling down) before the button appears. */
threshold?: number threshold?: number;
/** Distance from the top of the screen (scrolling up) before the action is triggered. */ /** Distance from the top of the screen (scrolling up) before the action is triggered. */
autoloadThreshold?: number autoloadThreshold?: number;
} }
/** Floating new post counter above timelines, clicked to scroll to top. */ /** Floating new post counter above timelines, clicked to scroll to top. */

Wyświetl plik

@ -10,14 +10,14 @@ import { Card, Spinner } from './ui';
/** Custom Viruoso component context. */ /** Custom Viruoso component context. */
type Context = { type Context = {
itemClassName?: string itemClassName?: string;
listClassName?: string listClassName?: string;
} }
/** Scroll position saved in sessionStorage. */ /** Scroll position saved in sessionStorage. */
type SavedScrollPosition = { type SavedScrollPosition = {
index: number index: number;
offset: number offset: number;
} }
/** Custom Virtuoso Item component representing a single scrollable item. */ /** Custom Virtuoso Item component representing a single scrollable item. */
@ -37,48 +37,48 @@ const List: Components<JSX.Element, Context>['List'] = React.forwardRef((props,
interface IScrollableList extends VirtuosoProps<any, any> { interface IScrollableList extends VirtuosoProps<any, any> {
/** Unique key to preserve the scroll position when navigating back. */ /** Unique key to preserve the scroll position when navigating back. */
scrollKey?: string scrollKey?: string;
/** Pagination callback when the end of the list is reached. */ /** Pagination callback when the end of the list is reached. */
onLoadMore?: () => void onLoadMore?: () => void;
/** Whether the data is currently being fetched. */ /** Whether the data is currently being fetched. */
isLoading?: boolean isLoading?: boolean;
/** Whether to actually display the loading state. */ /** Whether to actually display the loading state. */
showLoading?: boolean showLoading?: boolean;
/** Whether we expect an additional page of data. */ /** Whether we expect an additional page of data. */
hasMore?: boolean hasMore?: boolean;
/** Additional element to display at the top of the list. */ /** Additional element to display at the top of the list. */
prepend?: React.ReactNode prepend?: React.ReactNode;
/** Whether to display the prepended element. */ /** Whether to display the prepended element. */
alwaysPrepend?: boolean alwaysPrepend?: boolean;
/** Message to display when the list is loaded but empty. */ /** Message to display when the list is loaded but empty. */
emptyMessage?: React.ReactNode emptyMessage?: React.ReactNode;
/** Should the empty message be displayed in a Card */ /** Should the empty message be displayed in a Card */
emptyMessageCard?: boolean emptyMessageCard?: boolean;
/** Scrollable content. */ /** Scrollable content. */
children: Iterable<React.ReactNode> children: Iterable<React.ReactNode>;
/** Callback when the list is scrolled to the top. */ /** Callback when the list is scrolled to the top. */
onScrollToTop?: () => void onScrollToTop?: () => void;
/** Callback when the list is scrolled. */ /** Callback when the list is scrolled. */
onScroll?: () => void onScroll?: () => void;
/** Placeholder component to render while loading. */ /** Placeholder component to render while loading. */
placeholderComponent?: React.ComponentType | React.NamedExoticComponent placeholderComponent?: React.ComponentType | React.NamedExoticComponent;
/** Number of placeholders to render while loading. */ /** Number of placeholders to render while loading. */
placeholderCount?: number placeholderCount?: number;
/** /**
* Pull to refresh callback. * Pull to refresh callback.
* @deprecated Put a PTR around the component instead. * @deprecated Put a PTR around the component instead.
*/ */
onRefresh?: () => Promise<any> onRefresh?: () => Promise<any>;
/** Extra class names on the Virtuoso element. */ /** Extra class names on the Virtuoso element. */
className?: string className?: string;
/** Class names on each item container. */ /** Class names on each item container. */
itemClassName?: string itemClassName?: string;
/** `id` attribute on the Virtuoso element. */ /** `id` attribute on the Virtuoso element. */
id?: string id?: string;
/** CSS styles on the Virtuoso element. */ /** CSS styles on the Virtuoso element. */
style?: React.CSSProperties style?: React.CSSProperties;
/** Whether to use the window to scroll the content instead of Virtuoso's container. */ /** Whether to use the window to scroll the content instead of Virtuoso's container. */
useWindowScroll?: boolean useWindowScroll?: boolean;
} }
/** Legacy ScrollableList with Virtuoso for backwards-compatibility. */ /** Legacy ScrollableList with Virtuoso for backwards-compatibility. */

Wyświetl plik

@ -43,11 +43,11 @@ const messages = defineMessages({
}); });
interface ISidebarLink { interface ISidebarLink {
href?: string href?: string;
to?: string to?: string;
icon: string icon: string;
text: string | JSX.Element text: string | JSX.Element;
onClick: React.EventHandler<React.MouseEvent> onClick: React.EventHandler<React.MouseEvent>;
} }
const SidebarLink: React.FC<ISidebarLink> = ({ href, to, icon, text, onClick }) => { const SidebarLink: React.FC<ISidebarLink> = ({ href, to, icon, text, onClick }) => {

Wyświetl plik

@ -6,17 +6,17 @@ import { Icon, Text } from './ui';
interface ISidebarNavigationLink { interface ISidebarNavigationLink {
/** Notification count, if any. */ /** Notification count, if any. */
count?: number count?: number;
/** Optional max to cap count (ie: N+) */ /** Optional max to cap count (ie: N+) */
countMax?: number countMax?: number;
/** URL to an SVG icon. */ /** URL to an SVG icon. */
icon: string icon: string;
/** Link label. */ /** Link label. */
text: React.ReactNode text: React.ReactNode;
/** Route to an internal page. */ /** Route to an internal page. */
to?: string to?: string;
/** Callback when the link is clicked. */ /** Callback when the link is clicked. */
onClick?: React.EventHandler<React.MouseEvent> onClick?: React.EventHandler<React.MouseEvent>;
} }
/** Desktop sidebar navigation link. */ /** Desktop sidebar navigation link. */

Wyświetl plik

@ -5,9 +5,9 @@ import { useSoapboxConfig, useSettings, useTheme } from 'soapbox/hooks';
interface ISiteLogo extends React.ComponentProps<'img'> { interface ISiteLogo extends React.ComponentProps<'img'> {
/** Extra class names for the <img> element. */ /** Extra class names for the <img> element. */
className?: string className?: string;
/** Override theme setting for <SitePreview /> */ /** Override theme setting for <SitePreview /> */
theme?: 'dark' | 'light' theme?: 'dark' | 'light';
} }
/** Display the most appropriate site logo based on the theme and configuration. */ /** Display the most appropriate site logo based on the theme and configuration. */

Wyświetl plik

@ -108,11 +108,11 @@ const messages = defineMessages({
}); });
interface IStatusActionBar { interface IStatusActionBar {
status: Status status: Status;
withLabels?: boolean withLabels?: boolean;
expandable?: boolean expandable?: boolean;
space?: 'sm' | 'md' | 'lg' space?: 'sm' | 'md' | 'lg';
statusActionButtonTheme?: 'default' | 'inverse' statusActionButtonTheme?: 'default' | 'inverse';
} }
const StatusActionBar: React.FC<IStatusActionBar> = ({ const StatusActionBar: React.FC<IStatusActionBar> = ({
@ -698,7 +698,7 @@ const StatusActionBar: React.FC<IStatusActionBar> = ({
const canShare = ('share' in navigator) && (status.visibility === 'public' || status.visibility === 'group'); const canShare = ('share' in navigator) && (status.visibility === 'public' || status.visibility === 'group');
const spacing: { const spacing: {
[key: string]: React.ComponentProps<typeof HStack>['space'] [key: string]: React.ComponentProps<typeof HStack>['space'];
} = { } = {
'sm': 2, 'sm': 2,
'md': 8, 'md': 8,

Wyświetl plik

@ -14,7 +14,7 @@ const COLORS = {
type Color = keyof typeof COLORS; type Color = keyof typeof COLORS;
interface IStatusActionCounter { interface IStatusActionCounter {
count: number count: number;
} }
/** Action button numerical counter, eg "5" likes. */ /** Action button numerical counter, eg "5" likes. */
@ -27,15 +27,15 @@ const StatusActionCounter: React.FC<IStatusActionCounter> = ({ count = 0 }): JSX
}; };
interface IStatusActionButton extends React.ButtonHTMLAttributes<HTMLButtonElement> { interface IStatusActionButton extends React.ButtonHTMLAttributes<HTMLButtonElement> {
iconClassName?: string iconClassName?: string;
icon: string icon: string;
count?: number count?: number;
active?: boolean active?: boolean;
color?: Color color?: Color;
filled?: boolean filled?: boolean;
emoji?: ImmutableMap<string, any> emoji?: ImmutableMap<string, any>;
text?: React.ReactNode text?: React.ReactNode;
theme?: 'default' | 'inverse' theme?: 'default' | 'inverse';
} }
const StatusActionButton = React.forwardRef<HTMLButtonElement, IStatusActionButton>((props, ref): JSX.Element => { const StatusActionButton = React.forwardRef<HTMLButtonElement, IStatusActionButton>((props, ref): JSX.Element => {

Wyświetl plik

@ -18,7 +18,7 @@ const MAX_HEIGHT = 642; // 20px * 32 (+ 2px padding at the top)
const BIG_EMOJI_LIMIT = 10; const BIG_EMOJI_LIMIT = 10;
interface IReadMoreButton { interface IReadMoreButton {
onClick: React.MouseEventHandler onClick: React.MouseEventHandler;
} }
/** Button to expand a truncated status (due to too much content) */ /** Button to expand a truncated status (due to too much content) */
@ -30,11 +30,11 @@ const ReadMoreButton: React.FC<IReadMoreButton> = ({ onClick }) => (
); );
interface IStatusContent { interface IStatusContent {
status: Status status: Status;
onClick?: () => void onClick?: () => void;
collapsable?: boolean collapsable?: boolean;
translatable?: boolean translatable?: boolean;
textSize?: Sizes textSize?: Sizes;
} }
/** Renders the text content of a status */ /** Renders the text content of a status */

Wyświetl plik

@ -15,7 +15,7 @@ import { showStatusHoverCard } from './hover-status-wrapper';
import { Card, CardBody } from './ui'; import { Card, CardBody } from './ui';
interface IStatusHoverCard { interface IStatusHoverCard {
visible: boolean visible: boolean;
} }
/** Popup status preview that appears when hovering reply to */ /** Popup status preview that appears when hovering reply to */

Wyświetl plik

@ -17,31 +17,31 @@ import type { IScrollableList } from 'soapbox/components/scrollable-list';
interface IStatusList extends Omit<IScrollableList, 'onLoadMore' | 'children'> { interface IStatusList extends Omit<IScrollableList, 'onLoadMore' | 'children'> {
/** Unique key to preserve the scroll position when navigating back. */ /** Unique key to preserve the scroll position when navigating back. */
scrollKey: string scrollKey: string;
/** List of status IDs to display. */ /** List of status IDs to display. */
statusIds: ImmutableOrderedSet<string> statusIds: ImmutableOrderedSet<string>;
/** Last _unfiltered_ status ID (maxId) for pagination. */ /** Last _unfiltered_ status ID (maxId) for pagination. */
lastStatusId?: string lastStatusId?: string;
/** Pinned statuses to show at the top of the feed. */ /** Pinned statuses to show at the top of the feed. */
featuredStatusIds?: ImmutableOrderedSet<string> featuredStatusIds?: ImmutableOrderedSet<string>;
/** Pagination callback when the end of the list is reached. */ /** Pagination callback when the end of the list is reached. */
onLoadMore?: (lastStatusId: string) => void onLoadMore?: (lastStatusId: string) => void;
/** Whether the data is currently being fetched. */ /** Whether the data is currently being fetched. */
isLoading: boolean isLoading: boolean;
/** Whether the server did not return a complete page. */ /** Whether the server did not return a complete page. */
isPartial?: boolean isPartial?: boolean;
/** Whether we expect an additional page of data. */ /** Whether we expect an additional page of data. */
hasMore: boolean hasMore: boolean;
/** Message to display when the list is loaded but empty. */ /** Message to display when the list is loaded but empty. */
emptyMessage: React.ReactNode emptyMessage: React.ReactNode;
/** ID of the timeline in Redux. */ /** ID of the timeline in Redux. */
timelineId?: string timelineId?: string;
/** Whether to display a gap or border between statuses in the list. */ /** Whether to display a gap or border between statuses in the list. */
divideType?: 'space' | 'border' divideType?: 'space' | 'border';
/** Whether to display ads. */ /** Whether to display ads. */
showAds?: boolean showAds?: boolean;
/** Whether to show group information. */ /** Whether to show group information. */
showGroup?: boolean showGroup?: boolean;
} }
/** Feed of statuses, built atop ScrollableList. */ /** Feed of statuses, built atop ScrollableList. */

Some files were not shown because too many files have changed in this diff Show More