-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat(BetterRoleContext, ViewRaw, PermissionsViewer): improvments #3696
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
feat(BetterRoleContext, ViewRaw, PermissionsViewer): improvments #3696
Conversation
…s prop to context menus; assign modalKey to permissions modal
…display sorting; support for PermissionsViewer plugin; make patch appliable for list of guild roles
const contextItems = copyableRoleProperties.reduce((acc, propertyInfo) => { | ||
const propertyValue = propertyInfo.value(role); | ||
|
||
if (propertyValue) | ||
acc.push( | ||
<Menu.MenuItem | ||
id={propertyInfo.id} | ||
label={propertyInfo.name} | ||
icon={propertyInfo.icon} | ||
action={() => copyToClipboard(propertyValue)} | ||
/> | ||
); | ||
|
||
return acc; | ||
}, [] as React.ReactElement[]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use .map() and just return null to render nothing
contextMenus: { | ||
"guild-context": MakeContextCallback("Guild"), | ||
"guild-settings-role-context": MakeContextCallback("Role"), | ||
"vc-permviewer-role-context-menu": MakeContextCallback("Role"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't do this. just make the plugin export a function like buildContextMenuEntries()
and import that
|
||
children = p.children; | ||
} else { | ||
if (!Vencord.Plugins.isPluginEnabled("BetterRoleContext")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's this for
const GuildSettingsActions = findByPropsLazy("open", "selectRole", "updateGuild"); | ||
|
||
const DeveloperMode = getUserSettingLazy("appearance", "developerMode")!; | ||
const DeveloperMode = getUserSettingLazy("appearance", "developerMode"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
undo this change
const DeveloperMode = getUserSettingLazy("appearance", "developerMode"); | |
const DeveloperMode = getUserSettingLazy("appearance", "developerMode")!; |
PermissionsViewer:
Copy User/Role ID
andView Server As Role
contextMenuAPIArguments
prop to context menus to use in ViewRaw & BetterRoleContext pluginsmodalKey
toViewPermissions
modal to close it onEdit Role
button clickViewRaw:
PermissionsViewer
plugin to open role/user rawBetterRoleContext:
#000 #000
format) / role icon urlCopy User/Role ID
button > copy buttons from plugin >View Raw
PermissionsViewer
plugin to copy some properties