mirror of
https://github.com/Lightcord/Lightcord.git
synced 2025-04-12 00:55:40 +02:00
public server fix
This commit is contained in:
parent
3e9c34ef97
commit
adc98c7a2a
@ -11,7 +11,7 @@ import DOM from "./domtools";
|
|||||||
|
|
||||||
import BDLogo from "../ui/bdLogo";
|
import BDLogo from "../ui/bdLogo";
|
||||||
import TooltipWrap from "../ui/tooltipWrap";
|
import TooltipWrap from "../ui/tooltipWrap";
|
||||||
import LightcordLogo from "../svg/lightcord";
|
import LightcordLogo from "../svg/Lightcord";
|
||||||
import PluginCertifier from "./pluginCertifier";
|
import PluginCertifier from "./pluginCertifier";
|
||||||
import distant, { uuidv4 } from "./distant";
|
import distant, { uuidv4 } from "./distant";
|
||||||
import EmojiModule from "./emojiModule"
|
import EmojiModule from "./emojiModule"
|
||||||
@ -195,6 +195,7 @@ Core.prototype.patchAttributes = async function() {
|
|||||||
|
|
||||||
return div
|
return div
|
||||||
}
|
}
|
||||||
|
DiscordTag.default.displayName = DiscordTagComp.displayName
|
||||||
})
|
})
|
||||||
|
|
||||||
attribsPatchs.push(Utils.monkeyPatch(v2.MessageComponent, "default", {after: (data) => {
|
attribsPatchs.push(Utils.monkeyPatch(v2.MessageComponent, "default", {after: (data) => {
|
||||||
@ -273,6 +274,7 @@ Core.prototype.initSettings = function () {
|
|||||||
result.push(poped.pop())
|
result.push(poped.pop())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
console.log(result)
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
7
BetterDiscordApp/src/modules/hooks.js
Normal file
7
BetterDiscordApp/src/modules/hooks.js
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
import BDV2 from "./v2"
|
||||||
|
const {useState} = BDV2.react
|
||||||
|
|
||||||
|
|
||||||
|
export function useForceUpdate(){
|
||||||
|
return useState()[1];
|
||||||
|
}
|
@ -1,14 +1,12 @@
|
|||||||
import BDV2 from "../../modules/v2";
|
import BDV2 from "../../modules/v2";
|
||||||
|
|
||||||
import Tools from "../tools";
|
|
||||||
import SettingsTitle from "../settingsTitle";
|
import SettingsTitle from "../settingsTitle";
|
||||||
import TabBarSeparator from "../tabBarSeparator";
|
import TabBarSeparator from "../tabBarSeparator";
|
||||||
import TabBarHeader from "../tabBarHeader";
|
|
||||||
import TabBarItem from "../tabBarItem";
|
|
||||||
|
|
||||||
import ServerCard from "./serverCard";
|
import ServerCard from "./serverCard";
|
||||||
import SidebarView from "./sidebarView";
|
import { useForceUpdate } from "../../modules/hooks";
|
||||||
|
|
||||||
|
let SettingsView
|
||||||
export default class V2C_PublicServers extends BDV2.reactComponent {
|
export default class V2C_PublicServers extends BDV2.reactComponent {
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
@ -26,6 +24,8 @@ export default class V2C_PublicServers extends BDV2.reactComponent {
|
|||||||
this.AvatarDefaults = BDV2.WebpackModules.findByUniqueProperties(["getUserAvatarURL", "DEFAULT_AVATARS"]);
|
this.AvatarDefaults = BDV2.WebpackModules.findByUniqueProperties(["getUserAvatarURL", "DEFAULT_AVATARS"]);
|
||||||
this.InviteActions = BDV2.WebpackModules.findByUniqueProperties(["acceptInvite"]);
|
this.InviteActions = BDV2.WebpackModules.findByUniqueProperties(["acceptInvite"]);
|
||||||
this.SortedGuildStore = BDV2.WebpackModules.findByUniqueProperties(["getSortedGuilds"]);
|
this.SortedGuildStore = BDV2.WebpackModules.findByUniqueProperties(["getSortedGuilds"]);
|
||||||
|
|
||||||
|
this.hooks = []
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
@ -42,7 +42,9 @@ export default class V2C_PublicServers extends BDV2.reactComponent {
|
|||||||
connection: {
|
connection: {
|
||||||
state: 0,
|
state: 0,
|
||||||
user: null
|
user: null
|
||||||
}
|
},
|
||||||
|
section: this.categorySlugs[0],
|
||||||
|
theme: "dark"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,7 +54,7 @@ export default class V2C_PublicServers extends BDV2.reactComponent {
|
|||||||
|
|
||||||
search(query, clear) {
|
search(query, clear) {
|
||||||
const self = this;
|
const self = this;
|
||||||
fetch(`${self.endPoint}${query}${query ? "&schema=new" : "?schema=new"}`, {
|
fetch(`${self.searchEndPoint}${query}${query ? "&schema=new" : "?schema=new"}`, {
|
||||||
method: "get"
|
method: "get"
|
||||||
}).then(async res => {
|
}).then(async res => {
|
||||||
if(res.status !== 200)throw await res.text()
|
if(res.status !== 200)throw await res.text()
|
||||||
@ -90,11 +92,6 @@ export default class V2C_PublicServers extends BDV2.reactComponent {
|
|||||||
servers: servers,
|
servers: servers,
|
||||||
next: data.next
|
next: data.next
|
||||||
});
|
});
|
||||||
|
|
||||||
if (clear) {
|
|
||||||
//console.log(self);
|
|
||||||
self.refs.sbv.refs.contentScroller.scrollTop = 0;
|
|
||||||
}
|
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
console.error(err)
|
console.error(err)
|
||||||
return self.setState({
|
return self.setState({
|
||||||
@ -126,14 +123,15 @@ export default class V2C_PublicServers extends BDV2.reactComponent {
|
|||||||
options.x = Math.round(window.screenX + window.innerWidth / 2 - options.width / 2);
|
options.x = Math.round(window.screenX + window.innerWidth / 2 - options.width / 2);
|
||||||
options.y = Math.round(window.screenY + window.innerHeight / 2 - options.height / 2);
|
options.y = Math.round(window.screenY + window.innerHeight / 2 - options.height / 2);
|
||||||
|
|
||||||
self.joinWindow = new (window.require("electron").remote.BrowserWindow)(options);
|
const win = self.joinWindow = new (window.require("electron").remote.BrowserWindow)(options);
|
||||||
const url = "https://auth.discordservers.com/connect?scopes=guilds.join&previousUrl=https://auth.discordservers.com/info";
|
const url = "https://auth.discordservers.com/connect?scopes=guilds.join&previousUrl=https://auth.discordservers.com/info";
|
||||||
self.joinWindow.webContents.on("did-navigate", (event, url) => {
|
win.webContents.on("did-navigate", (event, url) => {
|
||||||
if (url != "https://auth.discordservers.com/info") return;
|
if (url != "https://auth.discordservers.com/info") return;
|
||||||
self.joinWindow.close();
|
win.close();
|
||||||
self.checkConnection();
|
self.checkConnection();
|
||||||
});
|
});
|
||||||
self.joinWindow.loadURL(url);
|
win.loadURL(url);
|
||||||
|
win.setMenuBarVisibility(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
get windowOptions() {
|
get windowOptions() {
|
||||||
@ -146,7 +144,7 @@ export default class V2C_PublicServers extends BDV2.reactComponent {
|
|||||||
maximizable: false,
|
maximizable: false,
|
||||||
minimizable: false,
|
minimizable: false,
|
||||||
alwaysOnTop: true,
|
alwaysOnTop: true,
|
||||||
frame: false,
|
frame: true,
|
||||||
center: false,
|
center: false,
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
nodeIntegration: false
|
nodeIntegration: false
|
||||||
@ -187,7 +185,7 @@ export default class V2C_PublicServers extends BDV2.reactComponent {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
get endPoint() {
|
get searchEndPoint() {
|
||||||
return "https://search.discordservers.com";
|
return "https://search.discordservers.com";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -249,59 +247,73 @@ export default class V2C_PublicServers extends BDV2.reactComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
this.hooks.forEach((e) => e())
|
||||||
|
SettingsView = SettingsView || BDV2.WebpackModules.findByDisplayName("SettingsView")
|
||||||
return BDV2.react.createElement("div", {id: "pubslayerroot"},
|
return BDV2.react.createElement("div", {id: "pubslayerroot"},
|
||||||
BDV2.react.createElement("div", {id: "pubslayer"}, BDV2.react.createElement(SidebarView, {ref: "sbv"}, this.component))
|
BDV2.react.createElement("div", {id: "pubslayer"}, BDV2.react.createElement(SettingsView, {
|
||||||
|
onSetSection: (section) => {
|
||||||
|
this.changeCategory(this.categorySlugs.indexOf(section))
|
||||||
|
},
|
||||||
|
sections: this.sections,
|
||||||
|
onClose: this.close,
|
||||||
|
section: this.state.section
|
||||||
|
}))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
get component() {
|
get sections(){
|
||||||
|
let sections = []
|
||||||
|
sections.push({
|
||||||
|
section: "HEADER",
|
||||||
|
label: "Public Servers"
|
||||||
|
}, {
|
||||||
|
section: "DIVIDER"
|
||||||
|
}, {
|
||||||
|
section: "CUSTOM",
|
||||||
|
element: this.searchInput.bind(null, () => this, this.searchKeyDown)
|
||||||
|
}, {
|
||||||
|
section: "DIVIDER"
|
||||||
|
}, {
|
||||||
|
section: "HEADER",
|
||||||
|
label: "Categories"
|
||||||
|
}, ...this.categoryButtons.map((value, index) => {
|
||||||
return {
|
return {
|
||||||
sidebar: {
|
section: this.categorySlugs[index],
|
||||||
component: this.sidebar
|
label: value,
|
||||||
},
|
element: this.content.bind(null, () => this)
|
||||||
content: {
|
|
||||||
component: this.content
|
|
||||||
},
|
|
||||||
tools: {
|
|
||||||
component: BDV2.react.createElement(Tools, {key: "pt", ref: "tools", onClick: this.close})
|
|
||||||
}
|
}
|
||||||
};
|
}), {
|
||||||
|
section: "DIVIDER"
|
||||||
|
}, {
|
||||||
|
section: "CUSTOM",
|
||||||
|
element: this.footer
|
||||||
|
}, {
|
||||||
|
section: "CUSTOM",
|
||||||
|
element: this.connection.bind(null, () => this)
|
||||||
|
})
|
||||||
|
return sections
|
||||||
}
|
}
|
||||||
|
|
||||||
get sidebar() {
|
searchInput(getThis, searchKeyDown) {
|
||||||
return BDV2.react.createElement(
|
const [value, setValue] = BDV2.react.useState("")
|
||||||
"div",
|
|
||||||
{className: "sidebar", key: "ps"},
|
|
||||||
BDV2.react.createElement(
|
|
||||||
"div",
|
|
||||||
{className: "ui-tab-bar SIDE"},
|
|
||||||
BDV2.react.createElement(
|
|
||||||
"div",
|
|
||||||
{className: "ui-tab-bar-header", style: {fontSize: "16px"}},
|
|
||||||
"Public Servers"
|
|
||||||
),
|
|
||||||
BDV2.react.createElement(TabBarSeparator, null),
|
|
||||||
this.searchInput,
|
|
||||||
BDV2.react.createElement(TabBarSeparator, null),
|
|
||||||
BDV2.react.createElement(TabBarHeader, {text: "Categories"}),
|
|
||||||
this.categoryButtons.map((value, index) => {
|
|
||||||
return BDV2.react.createElement(TabBarItem, {id: index, onClick: this.changeCategory, key: index, text: value, selected: this.state.selectedCategory === index});
|
|
||||||
}),
|
|
||||||
BDV2.react.createElement(TabBarSeparator, null),
|
|
||||||
this.footer,
|
|
||||||
this.connection
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
get searchInput() {
|
|
||||||
return BDV2.react.createElement(
|
return BDV2.react.createElement(
|
||||||
"div",
|
"div",
|
||||||
{className: "ui-form-item"},
|
{className: "ui-form-item"},
|
||||||
BDV2.react.createElement(
|
BDV2.react.createElement(
|
||||||
"div",
|
"div",
|
||||||
{className: "ui-text-input flex-vertical", style: {width: "172px", marginLeft: "10px"}},
|
{className: "ui-text-input flex-vertical", style: {width: "172px", marginLeft: "10px"}},
|
||||||
BDV2.react.createElement("input", {ref: "searchinput", onKeyDown: this.searchKeyDown, onChange: () => {}, type: "text", className: "input default", placeholder: "Search...", maxLength: "50"})
|
BDV2.react.createElement("input", {
|
||||||
|
ref: (serchinput) => (getThis().refs.searchinput = serchinput),
|
||||||
|
onKeyDown: searchKeyDown,
|
||||||
|
onChange: (e) => {
|
||||||
|
setValue(e.target.value)
|
||||||
|
},
|
||||||
|
type: "text",
|
||||||
|
className: "input default",
|
||||||
|
placeholder: "Search...",
|
||||||
|
maxLength: "50",
|
||||||
|
value: value
|
||||||
|
})
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -321,6 +333,10 @@ export default class V2C_PublicServers extends BDV2.reactComponent {
|
|||||||
self.search(query, true);
|
self.search(query, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get categorySlugs(){
|
||||||
|
return this.categoryButtons.map(e => e.toLowerCase().replace(/[^\w\d]+/g, "_"))
|
||||||
|
}
|
||||||
|
|
||||||
get categoryButtons() {
|
get categoryButtons() {
|
||||||
return ["All", "FPS Games", "MMO Games", "Strategy Games", "MOBA Games", "RPG Games", "Tabletop Games", "Sandbox Games", "Simulation Games", "Music", "Community", "Language", "Programming", "Other"];
|
return ["All", "FPS Games", "MMO Games", "Strategy Games", "MOBA Games", "RPG Games", "Tabletop Games", "Sandbox Games", "Simulation Games", "Music", "Community", "Language", "Programming", "Other"];
|
||||||
}
|
}
|
||||||
@ -328,12 +344,12 @@ export default class V2C_PublicServers extends BDV2.reactComponent {
|
|||||||
changeCategory(id) {
|
changeCategory(id) {
|
||||||
const self = this;
|
const self = this;
|
||||||
if (self.state.loading) return;
|
if (self.state.loading) return;
|
||||||
self.refs.searchinput.value = "";
|
|
||||||
self.setState({
|
self.setState({
|
||||||
loading: true,
|
loading: true,
|
||||||
selectedCategory: id,
|
selectedCategory: id,
|
||||||
title: "Loading...",
|
title: "Loading...",
|
||||||
term: null
|
term: null,
|
||||||
|
section: self.categorySlugs[id]
|
||||||
});
|
});
|
||||||
if (id === 0) {
|
if (id === 0) {
|
||||||
self.search("", true);
|
self.search("", true);
|
||||||
@ -342,15 +358,18 @@ export default class V2C_PublicServers extends BDV2.reactComponent {
|
|||||||
self.search(`?category=${self.categoryButtons[id]}`, true);
|
self.search(`?category=${self.categoryButtons[id]}`, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
get content() {
|
content(getThis) {
|
||||||
const self = this;
|
const self = getThis();
|
||||||
const guildList = this.SortedGuildStore.getFlattenedGuildIds();
|
self.useState()
|
||||||
const defaultList = this.AvatarDefaults.DEFAULT_AVATARS;
|
const guildList = self.SortedGuildStore.getFlattenedGuildIds();
|
||||||
if (self.state.connection.state === 1) return self.notConnected;
|
const defaultList = self.AvatarDefaults.DEFAULT_AVATARS;
|
||||||
|
if (self.state.connection.state === 1) return BDV2.react.createElement(self.notConnected.bind(null, getThis));
|
||||||
let columnModule = BDModules.get(e => e.contentColumnDefault)[0]
|
let columnModule = BDModules.get(e => e.contentColumnDefault)[0]
|
||||||
return [BDV2.react.createElement(
|
return [BDV2.react.createElement(
|
||||||
"div",
|
"div",
|
||||||
{ref: "content", key: "pc", className: columnModule.contentColumn+" "+columnModule.contentColumn+" content-column default"},
|
{ref: (ref) => {
|
||||||
|
(self.refs.content = ref)
|
||||||
|
}, key: "pc", className: columnModule.contentColumn+" "+columnModule.contentColumn+" content-column default"},
|
||||||
BDV2.react.createElement(SettingsTitle, {text: self.state.title}),
|
BDV2.react.createElement(SettingsTitle, {text: self.state.title}),
|
||||||
self.bdServer,
|
self.bdServer,
|
||||||
self.state.servers.map((server) => {
|
self.state.servers.map((server) => {
|
||||||
@ -371,13 +390,13 @@ export default class V2C_PublicServers extends BDV2.reactComponent {
|
|||||||
)];
|
)];
|
||||||
}
|
}
|
||||||
|
|
||||||
get notConnected() {
|
notConnected(getThis) {
|
||||||
const self = this;
|
const self = getThis();
|
||||||
//return BDV2.react.createElement(SettingsTitle, { text: self.state.title });
|
//return BDV2.react.createElement(SettingsTitle, { text: self.state.title });
|
||||||
let columnModule = BDModules.get(e => e.contentColumnDefault)[0]
|
let columnModule = BDModules.get(e => e.contentColumnDefault)[0]
|
||||||
return [BDV2.react.createElement(
|
return [BDV2.react.createElement(
|
||||||
"div",
|
"div",
|
||||||
{key: "ncc", ref: "content", className: columnModule.contentColumn+" "+columnModule.contentColumn+" content-column default"},
|
{key: "ncc", ref: (ref) => (self.refs.content = ref), className: columnModule.contentColumn+" "+columnModule.contentColumn+" content-column default"},
|
||||||
BDV2.react.createElement(
|
BDV2.react.createElement(
|
||||||
"h2",
|
"h2",
|
||||||
{className: "ui-form-title h2 margin-reset margin-bottom-20"},
|
{className: "ui-form-title h2 margin-reset margin-bottom-20"},
|
||||||
@ -405,7 +424,7 @@ export default class V2C_PublicServers extends BDV2.reactComponent {
|
|||||||
)];
|
)];
|
||||||
}
|
}
|
||||||
|
|
||||||
get footer() {
|
footer() {
|
||||||
return BDV2.react.createElement(
|
return BDV2.react.createElement(
|
||||||
"div",
|
"div",
|
||||||
{className: "ui-tab-bar-header"},
|
{className: "ui-tab-bar-header"},
|
||||||
@ -417,8 +436,24 @@ export default class V2C_PublicServers extends BDV2.reactComponent {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
get connection() {
|
useState(){
|
||||||
const self = this;
|
const forceUpdate = useForceUpdate()
|
||||||
|
BDV2.React.useEffect(() => {
|
||||||
|
const listener = () => {
|
||||||
|
forceUpdate()
|
||||||
|
}
|
||||||
|
this.hooks.push(listener)
|
||||||
|
return () => {
|
||||||
|
const index = this.hooks.findIndex(e => e===listener)
|
||||||
|
if(index < 0)return
|
||||||
|
this.hooks.splice(index, 1)
|
||||||
|
}
|
||||||
|
}, [])
|
||||||
|
}
|
||||||
|
|
||||||
|
connection(getThis) {
|
||||||
|
const self = getThis();
|
||||||
|
self.useState()
|
||||||
const {connection} = self.state;
|
const {connection} = self.state;
|
||||||
if (connection.state !== 2) return BDV2.react.createElement("span", null);
|
if (connection.state !== 2) return BDV2.react.createElement("span", null);
|
||||||
|
|
||||||
@ -446,5 +481,5 @@ export default class V2C_PublicServers extends BDV2.reactComponent {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,33 +0,0 @@
|
|||||||
import BDV2 from "../../modules/v2";
|
|
||||||
|
|
||||||
import Scroller from "../scroller";
|
|
||||||
|
|
||||||
export default class V2C_SidebarView extends BDV2.reactComponent {
|
|
||||||
|
|
||||||
constructor(props) {
|
|
||||||
super(props);
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const {sidebar, content, tools} = this.props.children;
|
|
||||||
return BDV2.react.createElement(
|
|
||||||
"div",
|
|
||||||
{className: "standardSidebarView-3F1I7i ui-standard-sidebar-view"},
|
|
||||||
BDV2.react.createElement(
|
|
||||||
"div",
|
|
||||||
{className: "sidebarRegion-VFTUkN sidebar-region"},
|
|
||||||
BDV2.react.createElement(Scroller, {key: "sidebarScroller", ref: "sidebarScroller", sidebar: true, fade: sidebar.fade || true, dark: sidebar.dark || true}, sidebar.component)
|
|
||||||
),
|
|
||||||
BDV2.react.createElement("div", {className: "contentRegion-3nDuYy content-region"},
|
|
||||||
BDV2.react.createElement("div", {className: "contentTransitionWrap-3hqOEW content-transition-wrap"},
|
|
||||||
BDV2.react.createElement("div", {className: "scrollerWrap-2lJEkd firefoxFixScrollFlex-cnI2ix contentRegionScrollerWrap-3YZXdm content-region-scroller-wrap scrollerThemed-2oenus themeGhost-28MSn0 scrollerTrack-1ZIpsv"},
|
|
||||||
BDV2.react.createElement("div", {className: "scroller-2FKFPG firefoxFixScrollFlex-cnI2ix contentRegionScroller-26nc1e content-region-scroller scroller", ref: "contentScroller"},
|
|
||||||
BDV2.react.createElement("div", {className: "contentColumn-2hrIYH contentColumnDefault-1VQkGM content-column default"}, content.component),
|
|
||||||
tools.component
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
@ -8,16 +8,24 @@ export default class V2C_Scroller extends BDV2.reactComponent {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
//scrollerWrap-2lJEkd scrollerThemed-2oenus themeGhostHairline-DBD-2d scrollerFade-1Ijw5y
|
//scrollerWrap-2lJEkd scrollerThemed-2oenus themeGhostHairline-DBD-2d scrollerFade-1Ijw5y
|
||||||
let scrollerModule1 = BDModules.get(e => e.scrollerWrap)[0]
|
const scrollerModule1 = BDModules.get(e => e.scrollerWrap)[0]
|
||||||
let scrollerModule2 = BDModules.get(e => e.sidebarRegionScroller)[0]
|
const scrollerModule2 = BDModules.get(e => e.sidebarRegionScroller)[0]
|
||||||
|
const scrollerTypes = BDModules.get(e => e.thin)[0]
|
||||||
let wrapperClass = `${scrollerModule1.scrollerWrap} ${scrollerModule1.scrollerThemed} ${scrollerModule1.themeGhostHairline}${this.props.fade ? " "+scrollerModule1.scrollerFade : ""}`;
|
let wrapperClass = `${scrollerModule1.scrollerWrap} ${scrollerModule1.scrollerThemed} ${scrollerModule1.themeGhostHairline}${this.props.fade ? " "+scrollerModule1.scrollerFade : ""}`;
|
||||||
let scrollerClass = scrollerModule1.scroller+" scroller"; /* fuck */
|
let scrollerClass = scrollerModule1.scroller+" scroller"; /* fuck */
|
||||||
if (this.props.sidebar) scrollerClass += ` ${scrollerModule2.sidebarRegionScroller} sidebar-region-scroller`
|
if (this.props.sidebar) scrollerClass += ` ${scrollerModule2.sidebarRegionScroller} ${scrollerTypes.thin} ${scrollerTypes.scrollerBase} ${scrollerTypes.fade}`
|
||||||
if (this.props.contentColumn) {
|
if (this.props.contentColumn) {
|
||||||
scrollerClass += " "+scrollerModule2.contentRegionScroller+" content-region-scroller"; /* fuck */
|
scrollerClass += `${scrollerModule2.contentRegionScroller} ${scrollerTypes.auto} content-region-scroller scroller`
|
||||||
wrapperClass = `${scrollerModule1.scrollerWrap} ${scrollerModule2.contentRegionScrollerWrap} content-region-scroller-wrap ${scrollerModule1.scrollerThemed} ${scrollerModule1.themeGhost} ${scrollerModule1.scrollerTrack}`;
|
wrapperClass = `${scrollerModule2.contentTransitionWrap}`;
|
||||||
}
|
}
|
||||||
const {children} = this.props;
|
const {children} = this.props;
|
||||||
|
if (this.props.sidebar) {
|
||||||
|
return BDV2.react.createElement(
|
||||||
|
"div",
|
||||||
|
{key: "scroller", ref: "scroller", className: scrollerClass},
|
||||||
|
children
|
||||||
|
);
|
||||||
|
}
|
||||||
return BDV2.react.createElement(
|
return BDV2.react.createElement(
|
||||||
"div",
|
"div",
|
||||||
{key: "scrollerwrap", className: wrapperClass},
|
{key: "scrollerwrap", className: wrapperClass},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user