Skip to content
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

fix: patch for 1.2.8 #2214

Merged
merged 1 commit into from
Mar 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CustomApps/lyrics-plus/OptionsMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ const OptionsMenuItem = react.memo(({ onSelect, value, isSelected }) => {
Spicetify.ReactComponent.MenuItem,
{
onClick: onSelect,
icon: isSelected ? OptionsMenuItemIcon : null
icon: isSelected ? OptionsMenuItemIcon : null,
trailingIcon: isSelected ? OptionsMenuItemIcon : null
},
value
);
Expand Down
3 changes: 0 additions & 3 deletions CustomApps/lyrics-plus/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,13 @@
pointer-events: none;
}

.lyrics-lyricsContainer-LyricsUnavailableMessage,
.lyrics-lyricsContainer-LyricsLine,
.lyrics-versionSelector {
margin-left: 100px;
margin-right: 100px;
}

@media (min-width: 1024px) {
.lyrics-lyricsContainer-LyricsUnavailableMessage,
.lyrics-lyricsContainer-LyricsLine,
.lyrics-versionSelector {
margin-left: 150px;
Expand All @@ -194,7 +192,6 @@
}

@media (min-width: 1280px) {
.lyrics-lyricsContainer-LyricsUnavailableMessage,
.lyrics-lyricsContainer-LyricsLine,
.lyrics-versionSelector {
margin-left: 200px;
Expand Down
3 changes: 2 additions & 1 deletion CustomApps/reddit/OptionsMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ const OptionsMenuItem = react.memo(({ onSelect, value, isSelected }) => {
Spicetify.ReactComponent.MenuItem,
{
onClick: onSelect,
icon: isSelected ? OptionsMenuItemIcon : null
icon: isSelected ? OptionsMenuItemIcon : null,
trailingIcon: isSelected ? OptionsMenuItemIcon : null
},
value
);
Expand Down
11 changes: 11 additions & 0 deletions globals.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1301,8 +1301,19 @@ declare namespace Spicetify {
divider?: 'before' | 'after' | 'both';
/**
* React component icon that will be rendered at the end of the `MenuItem`
* @deprecated Since Spotify `1.2.8`. Use `leadingIcon` or `trailingIcon` instead
*/
icon?: React.ReactNode;
/**
* React component icon that will be rendered at the start of the `MenuItem`
* @since Spotify `1.2.8`
*/
leadingIcon?: React.ReactNode;
/**
* React component icon that will be rendered at the end of the `MenuItem`
* @since Spotify `1.2.8`
*/
trailingIcon?: React.ReactNode;
};
type TooltipProps = {
/**
Expand Down
4 changes: 2 additions & 2 deletions src/preprocess/preprocess.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,13 +339,13 @@ Spicetify.React.useEffect(() => {
// React Component: Context Menu - Menu
utils.Replace(
&input,
`=(?:function\(\w\)\{\w+ \w=\w.children,\w=\w.onClose,\w=\w.getInitialFocusElement|\(\{children:\w+,onClose:\w+,getInitialFocusElement:\w+\}\))`,
`=(?:function\(\w\)\{\w+ \w=\w.children,\w=\w.onClose,\w=\w.getInitialFocusElement|\(\{children:\w+,onClose:\w+,getInitialFocusElement:\w+)`,
`=Spicetify.ReactComponent.Menu${0}`)

// React Component: Context Menu - Menu Item
utils.Replace(
&input,
`=(?:function\(\w+\)|\(|[\w\=\>]*)?\{(?:\w+ ?[\w\{\}\(\)=,:]*)?(?:[\w=\.]*(?:children|icon|disabled)[:\w]*,){3,}`,
`=(?:function\(\w+\)|\(|[\w\=\>]*)?\{(?:\w+ ?[\w\{\}\(\)=,:]*)?(?:[\w=\.]*(?:children|icon|divider|disabled)[:\w]*,){3,}`,
`=Spicetify.ReactComponent.MenuItem${0}`)

// React Component: Album Context Menu items
Expand Down