This repository has been archived by the owner on Sep 1, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add discord sign in by default (#24)
* added all the files * working on account settings page * made account component modular * create base for new App plugin * remove app settings from main page * making it work with new dashboard guild id system * fixing bugs * add discord id to link * updated name for reaction manager plugin * minor changes * creating basic role management page * fixed issue with channels in app plugin * add more plugins * fix merge bug * adding discord sign in button * added discord sign in
- Loading branch information
1 parent
b9cf163
commit eecc356
Showing
14 changed files
with
174 additions
and
34 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import React, { useEffect, useState, useCallback, useContext } from "react"; | ||
import firebase from "../../../../firebase"; | ||
import { colorStyles } from "../../../Shared/userUtils"; | ||
import { DiscordContext } from "../../../../contexts/DiscordContext"; | ||
import Select from "react-select"; | ||
|
||
const Leveling = ({ location, guild: userConnectedGuildInfo }) => { | ||
const { setActivePlugins } = useContext(DiscordContext); | ||
const guildId = userConnectedGuildInfo?.id; | ||
|
||
useEffect(() => { | ||
(async () => { | ||
const guild = await firebase.db | ||
.collection("Leveling") | ||
.doc(guildId || " ") | ||
.get(); | ||
const data = guild.data(); | ||
if (data) { | ||
const id = data.notifications; | ||
if (id) { | ||
const apiUrl = `${process.env.REACT_APP_API_URL}/resolvechannel?guild=${guildId}&channel=${id}`; | ||
const response = await fetch(apiUrl); | ||
const channel = await response.json(); | ||
} | ||
} | ||
})(); | ||
}, [location, guildId]); | ||
|
||
return ( | ||
<div> | ||
<div className="plugin-item-header"> | ||
<span className="title"> | ||
<img src={`${process.env.PUBLIC_URL}/trophy.svg`} alt="" /> | ||
<h2>Role Management</h2> | ||
</span> | ||
<span className="toggle-button"> | ||
<button | ||
onClick={() => { | ||
setActivePlugins(prev => { | ||
const newPlugs = { ...prev, roles: false }; | ||
firebase.db | ||
.collection("DiscordSettings") | ||
.doc(guildId || " ") | ||
.update({ | ||
activePlugins: newPlugs, | ||
}); | ||
return newPlugs; | ||
}); | ||
}} | ||
> | ||
Disable | ||
</button> | ||
</span> | ||
</div> | ||
<hr /> | ||
<div className="plugin-item-subheader"> | ||
<h4>Different ways to have the bot manage user roles. Give a role on join, toggle roles with reactions, etc.</h4> | ||
</div> | ||
<div className="plugin-item-body"> | ||
<h4 className="plugin-section-title">Add an action</h4> | ||
<div className="plugin-section"></div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default React.memo(Leveling); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
eecc356
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.
Successfully deployed to the following URLs: