mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
chore(marketplace): clean up references of 'sellout'
This commit is contained in:
1 parent
7cf1e20e8f
commit
bdc79aeff9
9 files changed
+30
-32
No files matched your search
@@ -14,7 +14,7 @@ export const MarketplaceApp = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<MarketplaceThemeProvider>
|
<MarketplaceThemeProvider>
|
||||||
<AppWrapper id="sellout-app">
|
<AppWrapper id="marketplace-app">
|
||||||
<AppTitle app={marketplaceApp} />
|
<AppTitle app={marketplaceApp} />
|
||||||
<AppContent>
|
<AppContent>
|
||||||
<Switch>
|
<Switch>
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
import { common, red } from '@material-ui/core/colors';
|
import { common, red } from '@material-ui/core/colors';
|
||||||
|
|
||||||
export const SELLOUT_APP_PRIMARY_COLOR = red[500];
|
export const MARKETPLACE_APP_PRIMARY_COLOR = red[500];
|
||||||
export const SELLOUT_APP_ICON_COLOR = common.white;
|
export const MARKETPLACE_APP_ICON_COLOR = common.white;
|
||||||
export const SELLOUT_APP_TEXT_COLOR = common.black;
|
export const MARKETPLACE_APP_TEXT_COLOR = common.black;
|
||||||
|
|
||||||
const theme = {
|
const theme = {
|
||||||
palette: {
|
palette: {
|
||||||
primary: {
|
primary: {
|
||||||
main: SELLOUT_APP_PRIMARY_COLOR,
|
main: MARKETPLACE_APP_PRIMARY_COLOR,
|
||||||
dark: red[700],
|
dark: red[700],
|
||||||
light: red[200],
|
light: red[200],
|
||||||
contrastText: SELLOUT_APP_TEXT_COLOR,
|
contrastText: MARKETPLACE_APP_TEXT_COLOR,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { createAppThemeProvider } from '../../../os/apps/utils/createAppThemeProvider';
|
import { createAppThemeProvider } from '../../../os/apps/utils/createAppThemeProvider';
|
||||||
|
|
||||||
import selloutTheme from '../marketplace.theme';
|
import marketplaceTheme from '../marketplace.theme';
|
||||||
|
|
||||||
export const MarketplaceThemeProvider = createAppThemeProvider(selloutTheme);
|
export const MarketplaceThemeProvider = createAppThemeProvider(marketplaceTheme);
|
||||||
@@ -22,8 +22,8 @@ import {
|
|||||||
CONTACTS_APP_TEXT_COLOR,
|
CONTACTS_APP_TEXT_COLOR,
|
||||||
} from '../../../apps/contacts/contacts.theme';
|
} from '../../../apps/contacts/contacts.theme';
|
||||||
import {
|
import {
|
||||||
SELLOUT_APP_PRIMARY_COLOR,
|
MARKETPLACE_APP_PRIMARY_COLOR,
|
||||||
SELLOUT_APP_ICON_COLOR,
|
MARKETPLACE_APP_ICON_COLOR,
|
||||||
} from '../../../apps/marketplace/marketplace.theme';
|
} from '../../../apps/marketplace/marketplace.theme';
|
||||||
import { NOTES_APP_ICON_COLOR, NOTES_APP_PRIMARY_COLOR } from '../../../apps/notes/notes.theme';
|
import { NOTES_APP_ICON_COLOR, NOTES_APP_PRIMARY_COLOR } from '../../../apps/notes/notes.theme';
|
||||||
import { DIALER_APP_PRIMARY_COLOR, DIALER_APP_TEXT_COLOR } from '../../../apps/dialer/dialer.theme';
|
import { DIALER_APP_PRIMARY_COLOR, DIALER_APP_TEXT_COLOR } from '../../../apps/dialer/dialer.theme';
|
||||||
@@ -140,8 +140,8 @@ export const APPS: IAppConfig[] = [
|
|||||||
{
|
{
|
||||||
id: 'MARKETPLACE',
|
id: 'MARKETPLACE',
|
||||||
nameLocale: 'APPS_MARKETPLACE',
|
nameLocale: 'APPS_MARKETPLACE',
|
||||||
backgroundColor: SELLOUT_APP_PRIMARY_COLOR,
|
backgroundColor: MARKETPLACE_APP_PRIMARY_COLOR,
|
||||||
color: SELLOUT_APP_ICON_COLOR,
|
color: MARKETPLACE_APP_ICON_COLOR,
|
||||||
path: '/marketplace',
|
path: '/marketplace',
|
||||||
Route: () => (
|
Route: () => (
|
||||||
<AppRoute
|
<AppRoute
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon';
|
import SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon';
|
||||||
|
|
||||||
const SelloutAppIcon = (props: SvgIconProps) => {
|
const MarketplaceAppIcon = (props: SvgIconProps) => {
|
||||||
return (
|
return (
|
||||||
<SvgIcon {...props}>
|
<SvgIcon {...props}>
|
||||||
<svg
|
<svg
|
||||||
@@ -43,4 +43,4 @@ const SelloutAppIcon = (props: SvgIconProps) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default SelloutAppIcon;
|
export default MarketplaceAppIcon;
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon';
|
import SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon';
|
||||||
|
|
||||||
const SelloutAppIcon = (props: SvgIconProps) => {
|
const MarketplaceAppIcon = (props: SvgIconProps) => {
|
||||||
return (
|
return (
|
||||||
<SvgIcon {...props}>
|
<SvgIcon {...props}>
|
||||||
<svg
|
<svg
|
||||||
@@ -26,6 +26,4 @@ import SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon';
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default MarketplaceAppIcon;
|
||||||
|
|
||||||
export default SelloutAppIcon;
|
|
||||||
@@ -4,14 +4,14 @@ import {
|
|||||||
MarketplaceListingBase,
|
MarketplaceListingBase,
|
||||||
MarketplaceReportDTO,
|
MarketplaceReportDTO,
|
||||||
} from '../../../typings/marketplace';
|
} from '../../../typings/marketplace';
|
||||||
import { selloutLogger } from './marketplace.utils';
|
import { marketplaceLogger } from './marketplace.utils';
|
||||||
import MarketplaceService from './marketplace.service';
|
import MarketplaceService from './marketplace.service';
|
||||||
import { onNetPromise } from '../utils/PromiseNetEvents/onNetPromise';
|
import { onNetPromise } from '../utils/PromiseNetEvents/onNetPromise';
|
||||||
import { MarketplaceDeleteDTO } from '../../../typings/marketplace';
|
import { MarketplaceDeleteDTO } from '../../../typings/marketplace';
|
||||||
|
|
||||||
onNetPromise<void, MarketplaceListing[]>(MarketplaceEvents.FETCH_LISTING, async (reqObj, resp) => {
|
onNetPromise<void, MarketplaceListing[]>(MarketplaceEvents.FETCH_LISTING, async (reqObj, resp) => {
|
||||||
MarketplaceService.handleFetchListings(reqObj, resp).catch((e) => {
|
MarketplaceService.handleFetchListings(reqObj, resp).catch((e) => {
|
||||||
selloutLogger.error(
|
marketplaceLogger.error(
|
||||||
`Error occurred in fetch listing event (${reqObj.source}), Error: ${e.message}`,
|
`Error occurred in fetch listing event (${reqObj.source}), Error: ${e.message}`,
|
||||||
);
|
);
|
||||||
resp({ status: 'error', errorMsg: 'INTERNAL_ERROR' });
|
resp({ status: 'error', errorMsg: 'INTERNAL_ERROR' });
|
||||||
@@ -20,7 +20,7 @@ onNetPromise<void, MarketplaceListing[]>(MarketplaceEvents.FETCH_LISTING, async
|
|||||||
|
|
||||||
onNetPromise<MarketplaceListingBase, void>(MarketplaceEvents.ADD_LISTING, async (reqObj, resp) => {
|
onNetPromise<MarketplaceListingBase, void>(MarketplaceEvents.ADD_LISTING, async (reqObj, resp) => {
|
||||||
MarketplaceService.handleAddListing(reqObj, resp).catch((e) => {
|
MarketplaceService.handleAddListing(reqObj, resp).catch((e) => {
|
||||||
selloutLogger.error(
|
marketplaceLogger.error(
|
||||||
`Error occurred in add listing event (${reqObj.source}), Error: ${e.message}`,
|
`Error occurred in add listing event (${reqObj.source}), Error: ${e.message}`,
|
||||||
);
|
);
|
||||||
resp({ status: 'error', errorMsg: 'INTERNAL_ERROR' });
|
resp({ status: 'error', errorMsg: 'INTERNAL_ERROR' });
|
||||||
@@ -30,7 +30,7 @@ onNetPromise<MarketplaceListingBase, void>(MarketplaceEvents.ADD_LISTING, async
|
|||||||
onNetPromise<MarketplaceDeleteDTO>(MarketplaceEvents.DELETE_LISTING, async (reqObj, resp) => {
|
onNetPromise<MarketplaceDeleteDTO>(MarketplaceEvents.DELETE_LISTING, async (reqObj, resp) => {
|
||||||
// TODO: Needs a permission check of some sort here eventually
|
// TODO: Needs a permission check of some sort here eventually
|
||||||
MarketplaceService.handleDeleteListing(reqObj, resp).catch((e) => {
|
MarketplaceService.handleDeleteListing(reqObj, resp).catch((e) => {
|
||||||
selloutLogger.error(
|
marketplaceLogger.error(
|
||||||
`Error occurred in delete listing event (${reqObj.source}), Error: ${e.message}`,
|
`Error occurred in delete listing event (${reqObj.source}), Error: ${e.message}`,
|
||||||
);
|
);
|
||||||
resp({ status: 'error', errorMsg: 'INTERNAL_ERROR' });
|
resp({ status: 'error', errorMsg: 'INTERNAL_ERROR' });
|
||||||
@@ -40,7 +40,7 @@ onNetPromise<MarketplaceDeleteDTO>(MarketplaceEvents.DELETE_LISTING, async (reqO
|
|||||||
onNetPromise<MarketplaceReportDTO>(MarketplaceEvents.REPORT_LISTING, async (reqObj, resp) => {
|
onNetPromise<MarketplaceReportDTO>(MarketplaceEvents.REPORT_LISTING, async (reqObj, resp) => {
|
||||||
// TODO: Needs a permission check of some sort here eventually
|
// TODO: Needs a permission check of some sort here eventually
|
||||||
MarketplaceService.handleReportListing(reqObj, resp).catch((e) => {
|
MarketplaceService.handleReportListing(reqObj, resp).catch((e) => {
|
||||||
selloutLogger.error(
|
marketplaceLogger.error(
|
||||||
`Error occurred in report listing event (${reqObj.source}), Error: ${e.message}`,
|
`Error occurred in report listing event (${reqObj.source}), Error: ${e.message}`,
|
||||||
);
|
);
|
||||||
resp({ status: 'error', errorMsg: 'INTERNAL_ERROR' });
|
resp({ status: 'error', errorMsg: 'INTERNAL_ERROR' });
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import PlayerService from '../players/player.service';
|
import PlayerService from '../players/player.service';
|
||||||
import { selloutLogger } from './marketplace.utils';
|
import { marketplaceLogger } from './marketplace.utils';
|
||||||
import MarketplaceDB, { _MarketplaceDB } from './marketplace.db';
|
import MarketplaceDB, { _MarketplaceDB } from './marketplace.db';
|
||||||
import {
|
import {
|
||||||
MarketplaceDeleteDTO,
|
MarketplaceDeleteDTO,
|
||||||
@@ -17,15 +17,15 @@ class _MarketplaceService {
|
|||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.marketplaceDB = MarketplaceDB;
|
this.marketplaceDB = MarketplaceDB;
|
||||||
selloutLogger.debug('Marketplace service started');
|
marketplaceLogger.debug('Marketplace service started');
|
||||||
}
|
}
|
||||||
|
|
||||||
async handleAddListing(
|
async handleAddListing(
|
||||||
reqObj: PromiseRequest<MarketplaceListingBase>,
|
reqObj: PromiseRequest<MarketplaceListingBase>,
|
||||||
resp: PromiseEventResp<void>,
|
resp: PromiseEventResp<void>,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
selloutLogger.debug('Handling add listing, listing:');
|
marketplaceLogger.debug('Handling add listing, listing:');
|
||||||
selloutLogger.debug(reqObj.data);
|
marketplaceLogger.debug(reqObj.data);
|
||||||
|
|
||||||
const player = PlayerService.getPlayer(reqObj.source);
|
const player = PlayerService.getPlayer(reqObj.source);
|
||||||
|
|
||||||
@@ -53,7 +53,7 @@ class _MarketplaceService {
|
|||||||
// Broadcast to everyone we are adding a listing
|
// Broadcast to everyone we are adding a listing
|
||||||
emitNet(MarketplaceEvents.BROADCAST_ADD, -1, { type: 'ADD', listing: returnObj });
|
emitNet(MarketplaceEvents.BROADCAST_ADD, -1, { type: 'ADD', listing: returnObj });
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
selloutLogger.error(`Failed to add listing ${e.message}`, {
|
marketplaceLogger.error(`Failed to add listing ${e.message}`, {
|
||||||
source: reqObj.source,
|
source: reqObj.source,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -70,7 +70,7 @@ class _MarketplaceService {
|
|||||||
|
|
||||||
resp({ data: listings, status: 'ok' });
|
resp({ data: listings, status: 'ok' });
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
selloutLogger.error(`Failed to fetch listings, ${e.message}`, {
|
marketplaceLogger.error(`Failed to fetch listings, ${e.message}`, {
|
||||||
source: req.source,
|
source: req.source,
|
||||||
});
|
});
|
||||||
resp({ status: 'error', errorMsg: 'DB_ERROR' });
|
resp({ status: 'error', errorMsg: 'DB_ERROR' });
|
||||||
@@ -113,14 +113,14 @@ class _MarketplaceService {
|
|||||||
const reportingPlayer = GetPlayerName(reqObj.source.toString());
|
const reportingPlayer = GetPlayerName(reqObj.source.toString());
|
||||||
|
|
||||||
if (reportExists) {
|
if (reportExists) {
|
||||||
selloutLogger.error(`This listing has already been reported`);
|
marketplaceLogger.error(`This listing has already been reported`);
|
||||||
resp({ status: 'error', errorMsg: 'REPORT_EXISTS' });
|
resp({ status: 'error', errorMsg: 'REPORT_EXISTS' });
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.marketplaceDB.reportListing(rListing.id, rListing.name);
|
await this.marketplaceDB.reportListing(rListing.id, rListing.name);
|
||||||
await reportListingToDiscord(rListing, reportingPlayer);
|
await reportListingToDiscord(rListing, reportingPlayer);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
selloutLogger.error(`Failed to report listing ${e.message}`, {
|
marketplaceLogger.error(`Failed to report listing ${e.message}`, {
|
||||||
source: reqObj.source,
|
source: reqObj.source,
|
||||||
});
|
});
|
||||||
resp({ status: 'error', errorMsg: 'DB_ERROR' });
|
resp({ status: 'error', errorMsg: 'DB_ERROR' });
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
import { mainLogger } from '../sv_logger';
|
import { mainLogger } from '../sv_logger';
|
||||||
|
|
||||||
export const selloutLogger = mainLogger.child({ module: 'sellout' });
|
export const marketplaceLogger = mainLogger.child({ module: 'sellout' });
|
||||||
Reference in new issue
Block a user