mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
Eliminate direct @plebbit/plebbit-js (8.7MB) imports from all UI components by replacing Plebbit.getShortAddress() with a local get-short-address utility. Add Vite manual chunks for plebbit-js, plebbit-react-hooks, and react-spring/use-gesture. Fix catalog CLS by matching skeleton to wrapper dimensions. Lazy-load ChallengeModal and ReplyModal. Add failed-URL cache to useFetchGifFirstFrame, optimize useHide selector, and memoize useFeed options in mod-queue.
9 lines
232 B
TypeScript
9 lines
232 B
TypeScript
const getShortAddress = (address: string): string => {
|
|
if (!address) return '';
|
|
if (address.includes('.')) return address;
|
|
if (address.length < 20) return '';
|
|
return address.slice(8, 20);
|
|
};
|
|
|
|
export default getShortAddress;
|