Skip to content

Commit b7d24c8

Browse files
committed
add Popout Dates
1 parent 96e3d4f commit b7d24c8

File tree

3 files changed

+52
-0
lines changed

3 files changed

+52
-0
lines changed

src/popoutDates/index.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { Patch, ExtensionWebpackModule } from "@moonlight-mod/types";
2+
3+
export const patches: Patch[] = [
4+
{
5+
find: 'location:"UserProfilePopoutBody"',
6+
replace: {
7+
match: /:(\(0,\i\.jsx\))\(\i\.\i,{user:\i,bio:null==\i\?void 0:\i\.bio,hidePersonalInformation:\i,onClose:\i}\),/,
8+
replacement: (orig, createElement) =>
9+
`${orig}${createElement}(require("popoutDates_component").default,{userId:arguments[0].user.id,guildId:arguments[0].guild?.id}),`
10+
}
11+
}
12+
];
13+
14+
export const webpackModules: Record<string, ExtensionWebpackModule> = {
15+
component: {
16+
dependencies: [
17+
{ ext: "spacepack", id: "spacepack" },
18+
{ id: "react" },
19+
{ ext: "common", id: "ErrorBoundary" },
20+
".memberSince,",
21+
'location:"UserProfilePopoutBody"'
22+
]
23+
}
24+
};

src/popoutDates/manifest.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"$schema": "https://moonlight-mod.github.io/manifest.schema.json",
3+
"id": "popoutDates",
4+
"version": "1.0.0",
5+
"meta": {
6+
"name": "Popout Dates",
7+
"tagline": "Restore join dates to the profile popout",
8+
"authors": ["Cynosphere"],
9+
"tags": ["fixes", "profiles"],
10+
"source": "https://github.com/Cynosphere/moonlight-extensions",
11+
"donate": "https://ko-fi.com/Cynosphere"
12+
},
13+
"dependencies": ["spacepack", "common"],
14+
"apiLevel": 2
15+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import React from "@moonlight-mod/wp/react";
2+
import spacepack from "@moonlight-mod/wp/spacepack_spacepack";
3+
import ErrorBoundary from "@moonlight-mod/wp/common_ErrorBoundary";
4+
5+
const MemberSince = spacepack.findByCode(".memberSince,")[0]?.exports?.Z;
6+
7+
export default function PopoutDates({ userId, guildId }: { userId: string; guildId?: string }) {
8+
return (
9+
<ErrorBoundary noop={true}>
10+
<MemberSince userId={userId} guildId={guildId} />
11+
</ErrorBoundary>
12+
);
13+
}

0 commit comments

Comments
 (0)