Skip to content

Commit

Permalink
Remove unused typings (#2274)
Browse files Browse the repository at this point in the history
* chore(): remove unused typings

* chore(): cleanup react query gen hook usage

* chore(): remove textile message related code from sdk

* chore()

* chore()
  • Loading branch information
quininez committed May 15, 2024
1 parent 2405f1c commit da8eafa
Show file tree
Hide file tree
Showing 40 changed files with 109 additions and 2,468 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { useState, useRef } from 'react';
import { useTranslation } from 'react-i18next';
import {
useMarkAsRead,
useRootComponentProps,
useGetSettings,
transformSource,
Expand Down Expand Up @@ -120,8 +119,6 @@ const NotificationsPage: React.FC = () => {
const unreadNotifications = allNotifications?.filter(notif => notif.read === undefined);
const readNotifications = allNotifications?.filter(notif => notif.read === true);

const { markAsRead } = useMarkAsRead();

const handleAvatarClick = (id: string) => {
navigateTo?.({
appName: '@akashaorg/app-profile',
Expand Down Expand Up @@ -156,11 +153,8 @@ const NotificationsPage: React.FC = () => {
};

const markAllAsRead = () => {
// do something
unreadNotifications.map(notif => {
if (notif.read === undefined) {
markAsRead(notif.id);
}
unreadNotifications.map(() => {
// @TODO to be implemented
});
setShowMenu(!showMenu);

Expand Down Expand Up @@ -253,7 +247,9 @@ const NotificationsPage: React.FC = () => {
moderatedAccountLabel={'suspended your account'}
markAsReadLabel={'Mark as read'}
emptyTitle={'Looks like you don’t have any new notifications yet!'}
handleMessageRead={markAsRead}
handleMessageRead={() => {
return;
}} //@TODO to be implemented
handleEntryClick={handleEntryClick}
handleProfileClick={handleAvatarClick}
transformSource={transformSource}
Expand Down
55 changes: 28 additions & 27 deletions extensions/apps/notifications/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,35 +27,36 @@ export const initialize = (options: IntegrationRegistrationOptions & { logger: L
data.event === AUTH_EVENTS.NEW_NOTIFICATIONS,
),
);
// @TODO reimplement this logic with new notification system
// get notifications for the 1st time
from(sdk.api.auth.getMessages({})).subscribe({
next: msg => {
notification.notify(
'@akashaorg/app-notifications',
msg.data.filter(m => !m.read),
);
},
error: err => {
options.logger.error(`Error fetching notifications: ${err}`);
},
});
// from(sdk.api.auth.getMessages({})).subscribe({
// next: msg => {
// notification.notify(
// '@akashaorg/app-notifications',
// msg.data.filter(m => !m.read),
// );
// },
// error: err => {
// options.logger.error(`Error fetching notifications: ${err}`);
// },
// });
// listen for new notifications and for mark as read
markAsRead$
.pipe(
mergeMap(() => {
return from(sdk.api.auth.getMessages({})).pipe(
map(newMsg => newMsg.data.filter(m => !m.read)),
);
}),
)
.subscribe({
next: messages => {
notification.notify('@akashaorg/app-notifications', messages);
},
error: err => {
options.logger.error(`There was an error when trying to refetch notifications: ${err}`);
},
});
// markAsRead$
// .pipe(
// mergeMap(() => {
// return from(sdk.api.auth.getMessages({})).pipe(
// map(newMsg => newMsg.data.filter(m => !m.read)),
// );
// }),
// )
// .subscribe({
// next: messages => {
// notification.notify('@akashaorg/app-notifications', messages);
// },
// error: err => {
// options.logger.error(`There was an error when trying to refetch notifications: ${err}`);
// },
// });
});
}
};
Expand Down
8 changes: 4 additions & 4 deletions extensions/apps/search/src/components/pages/search-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
transformSource,
useAkashaStore,
} from '@akashaorg/ui-awf-hooks';
import { SearchTagsResult } from '@akashaorg/typings/lib/sdk/graphql-types';
import EntryCardRenderer from './entry-renderer';
import Card from '@akashaorg/design-system-core/lib/components/Card';
import Stack from '@akashaorg/design-system-core/lib/components/Stack';
Expand Down Expand Up @@ -42,7 +41,8 @@ export type SearchPageProps = {
searchKeyword?: string;
};

type DataResponse = SearchTagsResult;
// @TODO to be implemented
type DataResponse = unknown;

const initSearchState = {
[ButtonValues.CONTENT]: { page: 1, results: [], done: false, isLoading: false },
Expand Down Expand Up @@ -237,10 +237,10 @@ const SearchPage: React.FC<SearchPageProps> = props => {
});
};

const handleMentionClick = (profileEthAddress: string) => {
const handleMentionClick = (profileDID: string) => {
navigateTo?.({
appName: '@akashaorg/app-profile',
getNavigationUrl: navRoutes => `${navRoutes.rootRoute}/${profileEthAddress}`,
getNavigationUrl: navRoutes => `${navRoutes.rootRoute}/${profileDID}`,
});
};

Expand Down
6 changes: 3 additions & 3 deletions libs/app-loader/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import {
UIEventData,
WidgetEvents,
WorldConfig,
ManifestConfig,
} from '@akashaorg/typings/lib/ui';
import { Subject, Subscription } from 'rxjs';
import { hidePageSplash, showPageSplash } from './splash-screen';
import * as singleSpa from 'single-spa';
import { IntegrationReleaseInfoFragmentFragment } from '@akashaorg/typings/lib/sdk/graphql-operation-types';
import {
getExtensionsData,
getUserInstalledExtensions,
Expand Down Expand Up @@ -53,7 +53,7 @@ export default class AppLoader {
uiEvents: Subject<UIEventData>;
extensionConfigs: Map<string, IAppConfig & { name: string }>;
extensionModules: Map<string, SystemModuleType>;
manifests: IntegrationReleaseInfoFragmentFragment[];
manifests: ManifestConfig[];
layoutConfig: IAppConfig;
logger: ILogger;
parentLogger: Logging;
Expand Down Expand Up @@ -135,7 +135,7 @@ export default class AppLoader {
}
}
};
importModules = async (manifests: IntegrationReleaseInfoFragmentFragment[]) => {
importModules = async (manifests: ManifestConfig[]) => {
if (!this.manifests.length) return;
const modules = new Map();
for (const manifest of manifests) {
Expand Down
10 changes: 7 additions & 3 deletions libs/app-loader/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import { IAppConfig, ModalNavigationOptions, QueryStringType } from '@akashaorg/typings/lib/ui';
import {
IAppConfig,
ModalNavigationOptions,
QueryStringType,
ManifestConfig,
} from '@akashaorg/typings/lib/ui';
import * as singleSpa from 'single-spa';
import qs from 'qs';
import { Logger } from '@akashaorg/awf-sdk';
import { IntegrationReleaseInfoFragmentFragment } from '@akashaorg/typings/lib/sdk/graphql-operation-types';

export const encodeName = (appName: string) => {
return appName;
Expand All @@ -15,7 +19,7 @@ export const decodeName = (appName: string) => {
export interface CheckActivityOptions {
config: IAppConfig;
encodedAppName: string;
manifest?: IntegrationReleaseInfoFragmentFragment;
manifest?: ManifestConfig;
location?: Location;
}

Expand Down

This file was deleted.

80 changes: 0 additions & 80 deletions libs/design-system-components/src/components/BubbleCard/index.tsx

This file was deleted.

This file was deleted.

0 comments on commit da8eafa

Please sign in to comment.