-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
227 additions
and
234 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,22 @@ | ||
import { common, webpack } from "replugged"; | ||
import { AnyFunction, ObjectExports } from "replugged/dist/types"; | ||
import { userActivity } from "."; | ||
import { UserActivity } from "."; | ||
import { Store } from "replugged/dist/renderer/modules/common/flux"; | ||
import { User } from "discord-types/general"; | ||
|
||
const ActivityStore = webpack.getByStoreName< | ||
Store & { | ||
getActivities: (...args: any[]) => unknown[]; | ||
getLocalPresence: AnyFunction; | ||
} | ||
>("SelfPresenceStore"); | ||
const user = webpack.getByProps<{ getCurrentUser: AnyFunction }>("getCurrentUser"); | ||
const UserStore = webpack.getByStoreName<Store & { getCurrentUser: () => User }>("UserStore"); | ||
// const user = webpack.getByProps<{ getCurrentUser: AnyFunction }>("getCurrentUser"); | ||
|
||
const classes = webpack.getByProps<Record<string, string>>("profileColors"); | ||
|
||
export default () => { | ||
if (!ActivityStore || !userActivity) return null; | ||
if (!UserActivity) return null; | ||
|
||
const activities = common.flux.useStateFromStores([ActivityStore], () => | ||
ActivityStore.getActivities(), | ||
); | ||
|
||
// just for types using "userActivity.default" component says "userActivity" may be null | ||
const UserActivity = userActivity.default; | ||
const user = UserStore!.getCurrentUser(); | ||
|
||
return ( | ||
<div className={`${classes?.profileColors} rprpc-activities`}> | ||
{activities?.map((a) => ( | ||
<UserActivity | ||
activity={a} | ||
className="rprpc-activity" | ||
source="Profile Modal" | ||
type="ProfileV2" | ||
useStoreStream={false} | ||
user={user?.getCurrentUser()} | ||
/> | ||
))} | ||
<div> | ||
<UserActivity user={user} type="ProfileV2" /> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.