mirror of
https://gitlab.com/MrFry/qmining-page
synced 2025-04-01 20:23:44 +02:00
api url change, todo-s page remove
This commit is contained in:
parent
88dd1f0cc6
commit
76f96ba8aa
4 changed files with 1 additions and 123 deletions
|
@ -7,7 +7,6 @@ import TodoSidebar from './todoSidebar.js'
|
|||
import Modal from '../modal.js'
|
||||
|
||||
import styles from './todo.module.css'
|
||||
// import styles from './todos.module.css'
|
||||
import constants from '../../constants.json'
|
||||
|
||||
const byVotes = (a, b) => {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"siteUrl": "https://qmining.frylabs.net/",
|
||||
"apiUrl": "https://qmining.frylabs.net/",
|
||||
"apiUrl": "https://api.frylabs.net/",
|
||||
"mobileWindowWidth": 700,
|
||||
"maxQuestionsToRender": 250
|
||||
}
|
||||
|
|
|
@ -1,80 +0,0 @@
|
|||
import React, { useState } from 'react'
|
||||
import Head from 'next/head'
|
||||
|
||||
import Sleep from '../components/sleep'
|
||||
import Todos from '../components/todoStuff/todos'
|
||||
|
||||
import constants from '../constants.json'
|
||||
import styles from './todos.module.css'
|
||||
|
||||
export default function contribute() {
|
||||
const [newTask, setNewTask] = useState('')
|
||||
|
||||
const submitNewTask = async () => {
|
||||
if (!newTask) {
|
||||
return
|
||||
}
|
||||
|
||||
fetch(constants.apiUrl + 'postfeedback', {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
headers: {
|
||||
Accept: 'application/json',
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({
|
||||
newTask: newTask,
|
||||
from: 'contribute',
|
||||
}),
|
||||
})
|
||||
.then((resp) => {
|
||||
return resp.json()
|
||||
})
|
||||
.then((resp) => {
|
||||
if (resp.success) {
|
||||
alert('Elküldve')
|
||||
setNewTask('')
|
||||
} else {
|
||||
alert('Hiba küldés közben')
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
alert('Hiba küldés közben')
|
||||
console.error(err)
|
||||
})
|
||||
}
|
||||
|
||||
const renderNewTaskArea = () => {
|
||||
return (
|
||||
<div className={styles.inputArea}>
|
||||
<textarea
|
||||
onChange={(event) => setNewTask(event.target.value)}
|
||||
value={newTask || ''}
|
||||
className={styles.feedback}
|
||||
/>
|
||||
<button className={styles.button} onClick={submitNewTask}>
|
||||
Küldés
|
||||
</button>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div className={styles.description}>
|
||||
Itt írhatsz új todo-ra ötleteket, vagy jelezhetsz hogy egyikben
|
||||
segítenél
|
||||
</div>
|
||||
<div className={styles.description}>
|
||||
Egy kártyára kattintva nézheted meg a részleteket, vagy szavazhatsz.
|
||||
Minél több szavazat érkezik egy kártyára, annál magasabb lesz a
|
||||
pioritása. Jobb alsó szám minél több, annál nehezebb a feladat. A Done
|
||||
oszlopban lévő feladatok kész vannak, de különböző okok miat még nem
|
||||
lettek kiadva frissítésként. Ami az In Prod táblázatban van az van kint.
|
||||
</div>
|
||||
<Todos />
|
||||
{renderNewTaskArea()}
|
||||
<Sleep />
|
||||
</div>
|
||||
)
|
||||
}
|
|
@ -1,41 +0,0 @@
|
|||
.description {
|
||||
font-size: 15px;
|
||||
color: white;
|
||||
text-align: center;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.warning {
|
||||
color: white;
|
||||
padding: 10px;
|
||||
font-size: 26px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.feedback {
|
||||
color: var(--text-color);
|
||||
background-color: var(--background-color);
|
||||
font-size: 14px;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
height: 60px;
|
||||
}
|
||||
|
||||
.button {
|
||||
background-color: var(--text-color);
|
||||
border: none;
|
||||
padding: 5px 15px;
|
||||
margin: 5px;
|
||||
color: white;
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.inputArea {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.title {
|
||||
color: #9999ff;
|
||||
font-size: 30px;
|
||||
text-align: center;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue