diff --git a/.env b/.env
index 2b3936e..6406497 100644
--- a/.env
+++ b/.env
@@ -1 +1,2 @@
-PUBLIC_URL=/tools
\ No newline at end of file
+PUBLIC_URL=/tools
+workbench.editor.limit.enabled = false
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 4d5e345..1e7e313 100644
--- a/.gitignore
+++ b/.gitignore
@@ -23,4 +23,5 @@ yarn-debug.log*
yarn-error.log*
#perso
-FireBase.tsx
\ No newline at end of file
+FireBase.tsx
+/key
diff --git a/public/index.html b/public/index.html
index 4a18e36..818a5a8 100644
--- a/public/index.html
+++ b/public/index.html
@@ -30,7 +30,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
-
Melvyn App
+ VonQey
You need to enable JavaScript to run this app.
diff --git a/src/auth/Admin/AdminTools.tsx b/src/auth/Admin/AdminTools.tsx
new file mode 100644
index 0000000..39546ed
--- /dev/null
+++ b/src/auth/Admin/AdminTools.tsx
@@ -0,0 +1,19 @@
+import React from "react";
+import { DialogTitle } from "@material-ui/core";
+import { TypeAuthDoc } from "../../utils/constante";
+
+
+type TypeAdminTools = {
+ auth: any;
+ authDoc: TypeAuthDoc;
+ onClose: Function;
+ onAdmin: Function;
+};
+
+export default function AdminTools({auth, authDoc, onClose, onAdmin}: TypeAdminTools) {
+ return (
+ <>
+ Admin tools
+ >
+ );
+}
diff --git a/src/auth/Create/ContentCreateUser.tsx b/src/auth/Create/ContentCreateUser.tsx
index 960f78c..e55f985 100644
--- a/src/auth/Create/ContentCreateUser.tsx
+++ b/src/auth/Create/ContentCreateUser.tsx
@@ -30,9 +30,7 @@ export default function ContentCreateUser({
const [helperEmail, setHelperEmail] = useState("");
const [helperUsername, setHelperUsername] = useState("");
const [helperPassword, setHelperPassword] = useState("");
- const [helperConfirmedPassword, setHelperConfirmedPassword] = useState<
- string
- >("");
+ const [helperConfirmedPassword, setHelperConfirmedPassword] = useState("");
const submit = () => {
const validationEmail = checkEmail(email);
diff --git a/src/auth/User/ContentUserAccount.tsx b/src/auth/User/ContentUserAccount.tsx
index 9ae96a8..37b1440 100644
--- a/src/auth/User/ContentUserAccount.tsx
+++ b/src/auth/User/ContentUserAccount.tsx
@@ -1,5 +1,10 @@
import React from "react";
-import { DialogTitle, DialogContent, DialogActions, Button } from "@material-ui/core";
+import {
+ DialogTitle,
+ DialogContent,
+ DialogActions,
+ Button
+} from "@material-ui/core";
import { TypeAuthDoc } from "../../utils/constante";
import Uservalue from "../utils/Uservalue";
@@ -8,9 +13,16 @@ type TypeUserAccount = {
authDoc: TypeAuthDoc;
onClose: Function;
onLogout: Function;
+ onAdmin: Function;
};
-export default function UserAccount({ auth, onClose, authDoc, onLogout }: TypeUserAccount) {
+export default function UserAccount({
+ auth,
+ onClose,
+ authDoc,
+ onLogout,
+ onAdmin
+}: TypeUserAccount) {
return (
<>
Hi {auth.displayName}
@@ -22,6 +34,11 @@ export default function UserAccount({ auth, onClose, authDoc, onLogout }: TypeUs
+ {authDoc.group === "admin" && (
+ onAdmin()}>
+ Admins tools
+
+ )}
onLogout()}>
Logout
diff --git a/src/auth/User/User.tsx b/src/auth/User/User.tsx
index 12f09a9..68d7a5e 100644
--- a/src/auth/User/User.tsx
+++ b/src/auth/User/User.tsx
@@ -5,6 +5,7 @@ import ContentUserAccount from "./ContentUserAccount";
import ContentLoginUser from "../Login/ContentLoginUser";
import ContentCreateUser from "../Create/ContentCreateUser";
import { TypeAuthDoc } from "../../utils/constante";
+import AdminTools from "../Admin/AdminTools";
type TypeCreateUser = {
open: boolean;
@@ -14,6 +15,7 @@ type TypeCreateUser = {
export default function User({ open, onClose }: TypeCreateUser) {
const [isLogin, setLogin] = useState(false);
const [isCreate, setCreate] = useState(false);
+ const [adminTools, setAdminTools] = useState(false);
const [auth, setAuth] = useState();
const [authDoc, setAuthDoc] = useState({
group: "",
@@ -59,7 +61,22 @@ export default function User({ open, onClose }: TypeCreateUser) {
return (
onClose()} fullWidth>
{isLogin ? (
-
+ adminTools ? (
+ setAdminTools(false)}
+ onClose={onClose}
+ auth={auth}
+ authDoc={authDoc}
+ />
+ ) : (
+ setAdminTools(true)}
+ />
+ )
) : isCreate ? (
toggleCreate(false)} />
) : (
diff --git a/src/components/github/CommitBox.tsx b/src/components/github/CommitBox.tsx
index 8f90fe7..2f23b56 100644
--- a/src/components/github/CommitBox.tsx
+++ b/src/components/github/CommitBox.tsx
@@ -19,6 +19,9 @@ const useStyles = makeStyles((theme: Theme) => ({
"&:hover": {
backgroundColor: theme.palette.divider
}
+ },
+ link: {
+ color: theme.palette.primary.main
}
}));
@@ -55,13 +58,25 @@ export default function CommitBox({ value, index }: TypeCommitBox) {
return (
-
+ {htmlUrl.length < 1 ? (
-
+
{value.commit.message}
-
+ ) : (
+
+
+
+ {value.commit.message}
+
+
+
+ )}
);
}
diff --git a/src/page/RandomSentence.tsx b/src/page/RandomSentence.tsx
index 427ca35..29c6455 100644
--- a/src/page/RandomSentence.tsx
+++ b/src/page/RandomSentence.tsx
@@ -30,7 +30,7 @@ export default function RandomSentence() {
const [settings, setSettings] = useState({
isCountDown: false,
isOneSentence: false,
- timerTime: 10
+ timerTime: 3
});
const [openSettings, setOpenSettings] = useState(false);
diff --git a/src/utils/adminHelper.ts b/src/utils/adminHelper.ts
new file mode 100644
index 0000000..ba75a17
--- /dev/null
+++ b/src/utils/adminHelper.ts
@@ -0,0 +1,3 @@
+export function salut() {
+ console.log("salut");
+}
diff --git a/src/utils/authHelper.ts b/src/utils/authHelper.ts
index ab99dde..2672143 100644
--- a/src/utils/authHelper.ts
+++ b/src/utils/authHelper.ts
@@ -10,7 +10,7 @@ export function authHelper() {
email: string,
password: string,
user: string,
- callback: Function,
+ callback: Function
) {
if (email && password) {
auth
@@ -46,6 +46,10 @@ export function authHelper() {
}
function getCollection(uid: string, callback: Function) {
+ db.collection("users")
+ .get()
+ .then((doc: any) => console.log("eoc", doc));
+
return db
.collection("users")
.doc(uid)
diff --git a/src/utils/constante.ts b/src/utils/constante.ts
index f6c1cd7..9a7c60c 100644
--- a/src/utils/constante.ts
+++ b/src/utils/constante.ts
@@ -9,7 +9,7 @@ enum EnumRootDataBase {
ninja = "chat_ninja"
}
-export const ROOT_DATABASE: EnumRootDataBase = EnumRootDataBase.prod;
+export const ROOT_DATABASE: EnumRootDataBase = EnumRootDataBase.ninja;
export type TypeTopic = {
title: string;