mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-07 08:07:18 +02:00
Add option to hide "News" section
This commit is contained in:
parent
938dfa6aaa
commit
345d0f78dc
@ -8,24 +8,21 @@ export function addCss() {
|
|||||||
const STYLUS_CSS = renderStylus();
|
const STYLUS_CSS = renderStylus();
|
||||||
let css = STYLUS_CSS;
|
let css = STYLUS_CSS;
|
||||||
|
|
||||||
// Hide "Play with Friends" section
|
const PREF_HIDE_SECTIONS = getPref(PrefKey.UI_HIDE_SECTIONS);
|
||||||
if (getPref(PrefKey.UI_HIDE_SECTIONS).includes(UiSection.FRIENDS)) {
|
const selectorToHide = [];
|
||||||
css += `
|
|
||||||
div[class^=HomePage-module__bottomSpacing]:has(button[class*=SocialEmptyCard]),
|
// Hide "News" section
|
||||||
button[class*=SocialEmptyCard] {
|
if (PREF_HIDE_SECTIONS.includes(UiSection.NEWS)) {
|
||||||
display: none;
|
selectorToHide.push('#BodyContent > div[class*=CarouselRow-module]');
|
||||||
}
|
|
||||||
`;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Hide "Start a party" button in the Guide menu
|
||||||
if (getPref(PrefKey.BLOCK_SOCIAL_FEATURES)) {
|
if (getPref(PrefKey.BLOCK_SOCIAL_FEATURES)) {
|
||||||
css += `
|
selectorToHide.push('#gamepass-dialog-root div[class^=AchievementsPreview-module__container] + button[class*=HomeLandingPage-module__button]');
|
||||||
/* Hide "Start a party" button in the Guide menu */
|
}
|
||||||
#gamepass-dialog-root div[class^=AchievementsPreview-module__container] + button[class*=HomeLandingPage-module__button]
|
|
||||||
{
|
if (selectorToHide) {
|
||||||
display: none;
|
css += selectorToHide.join(',') + '{ display: none; }';
|
||||||
}
|
|
||||||
`;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reduce animations
|
// Reduce animations
|
||||||
|
Loading…
x
Reference in New Issue
Block a user