From 7402dbcdd0a085003a102a44fceb4edbd93f8f07 Mon Sep 17 00:00:00 2001 From: AngelRionCervi Date: Tue, 18 Jun 2019 23:31:16 +0200 Subject: [PATCH] replaced all teamspeak with all discord --- app/javascripts/components/discord.js | 71 ++++++++++++++++++++++ app/javascripts/components/main.js | 4 +- app/javascripts/components/teamspeak.js | 81 ------------------------- app/stylesheets/app.css | 6 ++ 4 files changed, 79 insertions(+), 83 deletions(-) create mode 100644 app/javascripts/components/discord.js delete mode 100644 app/javascripts/components/teamspeak.js diff --git a/app/javascripts/components/discord.js b/app/javascripts/components/discord.js new file mode 100644 index 0000000..d857ff5 --- /dev/null +++ b/app/javascripts/components/discord.js @@ -0,0 +1,71 @@ +const React = require("react"); + +const discordDefaults = { + url: "https://discord.gg/Bvs3KjX", + alien: { + channel: "https://discord.gg/UcN724q", + }, + marine: { + channel: "https://discord.gg/eGwfHXz", + } +}; + +const DiscordButton = exports.DiscordButton = React.createClass({ + getInitialState() { + return { + open: false + }; + }, + + toggleOpen(e) { + e.preventDefault(); + this.setState({ open: !this.state.open }); + }, + getDefaultProps() { + return discordDefaults + }, + + marineUrl() { + return discordDefaults.marine.channel; + }, + + alienUrl() { + return discordDefaults.alien.channel; + }, + + chevron() { + if (this.state.open) { + return ; + } else { + return ; + } + }, + + render() { + const open = this.state.open; + let componentClass = ["treeview"]; + let dropdown; + if (open) { + componentClass.push("active"); + dropdown = ( + + ); + } + + return ( +
  • + + Discord + {this.chevron()} + + {dropdown} +
  • + ); + } +}); + diff --git a/app/javascripts/components/main.js b/app/javascripts/components/main.js index eaaf65e..4e0ad7e 100644 --- a/app/javascripts/components/main.js +++ b/app/javascripts/components/main.js @@ -8,7 +8,7 @@ import {SoundPanel} from "javascripts/components/sound"; import {SettingsPanel} from "javascripts/components/settings"; import {ArchivedGathers} from "javascripts/components/gatherArchive"; import {CurrentUser, ProfileModal, UserMenu} from "javascripts/components/user"; -import {TeamSpeakButton, TeamSpeakModal} from "javascripts/components/teamspeak"; +import {DiscordButton, DiscordModal} from "javascripts/components/discord"; const React = require("react"); @@ -485,7 +485,7 @@ const GatherPage = React.createClass({ gatherSelectedCallback={this.onGatherSelected} />