mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
Improve React Doctor score and badge (#1127)
* fix(react doctor): improve quality score and badge * fix(react doctor): address review feedback * fix(review): address final bot feedback
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
* Board preview count is fixed at 3 entries to preserve compact block height.
|
||||
*/
|
||||
|
||||
export type BlotterEntryKind = 'release' | 'manual';
|
||||
type BlotterEntryKind = 'release' | 'manual';
|
||||
|
||||
export interface BlotterEntry {
|
||||
id: string;
|
||||
|
||||
@@ -69,7 +69,7 @@ const COMMENT_TOO_LONG_NOTICE = 'Comment too long. Click here to view the full t
|
||||
const DEFAULT_REPLY_VIRTUALIZATION_MODE: ReplyVirtualizationMode = 'item-size';
|
||||
const REPLY_VIRTUALIZATION_MODES: ReplyVirtualizationMode[] = ['off', 'estimates', 'item-size'];
|
||||
|
||||
export const REPLY_HEIGHT_DATA_ATTRIBUTE = 'data-pretext-height';
|
||||
const REPLY_HEIGHT_DATA_ATTRIBUTE = 'data-pretext-height';
|
||||
|
||||
type PreparedText = ReturnType<typeof prepare>;
|
||||
type PreparedTextWithSegments = ReturnType<typeof prepareWithSegments>;
|
||||
@@ -744,7 +744,7 @@ export const getFeedPostHeightEstimate = ({
|
||||
return desktopResult;
|
||||
};
|
||||
|
||||
export const getCatalogPostHeightEstimate = ({ imageSize, metrics, post, showOPComment }: CatalogPostHeightEstimateOptions): number => {
|
||||
const getCatalogPostHeightEstimate = ({ imageSize, metrics, post, showOPComment }: CatalogPostHeightEstimateOptions): number => {
|
||||
if (!canUsePretext() || !post) {
|
||||
return DEFAULT_CATALOG_ROW_HEIGHT - CATALOG_ROW_PADDING_TOP;
|
||||
}
|
||||
@@ -778,7 +778,7 @@ export const getCatalogPostHeightEstimate = ({ imageSize, metrics, post, showOPC
|
||||
return estimatedHeight;
|
||||
};
|
||||
|
||||
export const getCatalogRowHeightEstimate = ({ imageSize, metrics, row, showOPComment }: CatalogSingleRowHeightEstimateOptions): number => {
|
||||
const getCatalogRowHeightEstimate = ({ imageSize, metrics, row, showOPComment }: CatalogSingleRowHeightEstimateOptions): number => {
|
||||
const cacheKey =
|
||||
row.length > 0 ? `${getCatalogEstimateCachePrefix(imageSize, metrics, showOPComment)}\u0000row\u0000${row.map((post) => post?.cid || '').join(',')}` : undefined;
|
||||
const cachedHeight = cacheKey ? catalogRowHeightEstimateCache.get(cacheKey) : undefined;
|
||||
|
||||
@@ -124,7 +124,7 @@ export const isDirectoryBoard = (identifier: string, communities: DirectoryCommu
|
||||
|
||||
export const isArchiveRoute = (pathname: string): boolean => {
|
||||
const normalizedPath = pathname.replace(/\/settings$/, '').replace(/\/$/, '');
|
||||
return /\/archive$/.test(normalizedPath);
|
||||
return normalizedPath.endsWith('/archive');
|
||||
};
|
||||
|
||||
export const isFeedRoute = (pathname: string): boolean => {
|
||||
|
||||
@@ -78,7 +78,7 @@ export const isSettingsView = (pathname: string, params: ParamsType): boolean =>
|
||||
);
|
||||
};
|
||||
|
||||
export const isSubscriptionsView = (pathname: string, params: ParamsType): boolean => {
|
||||
export const isSubscriptionsView = (pathname: string, _params: ParamsType): boolean => {
|
||||
return pathname === '/subs' || pathname === '/subs/settings' || pathname === '/subs/catalog' || pathname === '/subs/catalog/settings';
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user