mirror of
https://gitlab.com/MrFry/qmining-page
synced 2025-04-01 20:23:44 +02:00
Added: layout.module.css, donate modal, contribute feedback modal, contacts
This commit is contained in:
parent
6fd9beb464
commit
47a2227f87
9 changed files with 204 additions and 93 deletions
|
@ -1,28 +1,32 @@
|
|||
import React from 'react'
|
||||
import React, { useState, useEffect } from 'react'
|
||||
import Head from 'next/head'
|
||||
|
||||
import FeedbackArea from '../components/feedbackArea'
|
||||
import constants from '../constants.json'
|
||||
import LoadingIndicator from '../components/LoadingIndicator'
|
||||
|
||||
import styles from './contact.module.css'
|
||||
|
||||
const contactMethods = {
|
||||
irc: {
|
||||
title: 'IRC chat',
|
||||
description: 'irc real time chat',
|
||||
onClick: () => {
|
||||
console.log('IRC')
|
||||
},
|
||||
},
|
||||
email: {
|
||||
title: 'E-mail',
|
||||
description: 'email',
|
||||
onClick: () => {
|
||||
console.log('email')
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
export default function Contact() {
|
||||
const [contacts, setContacts] = useState()
|
||||
|
||||
useEffect(() => {
|
||||
fetch(constants.apiUrl + 'contacts.json', {
|
||||
method: 'GET',
|
||||
credentials: 'include',
|
||||
headers: {
|
||||
Accept: 'application/json',
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
return res.json()
|
||||
})
|
||||
.then((res) => {
|
||||
setContacts(res)
|
||||
})
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Head>
|
||||
|
@ -33,18 +37,40 @@ export default function Contact() {
|
|||
</div>
|
||||
<br />
|
||||
<br />
|
||||
<div className={styles.text}>
|
||||
<div>Üzenet küldése</div>
|
||||
<div>Weboldalon keresztül üzenet küldése adminnak</div>
|
||||
</div>
|
||||
<FeedbackArea from={'contact'} />
|
||||
<div className={styles.contactsContainer}>
|
||||
<div>Itt vannak hogy hogy lehet kontaktolni</div>
|
||||
{Object.keys(contactMethods).map((key) => {
|
||||
const { onClick, title, description } = contactMethods[key]
|
||||
return (
|
||||
<div key={key} onClick={onClick}>
|
||||
<div>{title}</div>
|
||||
<div>{description}</div>
|
||||
<div className={styles.container}>
|
||||
{contacts ? (
|
||||
<>
|
||||
<div className={styles.text}>
|
||||
<div>Alternatív módok</div>
|
||||
<div>Valami duma, hogy nem adom ki az adatokat</div>
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
<div className={styles.contactsContainer}>
|
||||
{Object.keys(contacts).map((key) => {
|
||||
const { description, value, href } = contacts[key]
|
||||
return (
|
||||
<div key={key}>
|
||||
<div>{description}</div>
|
||||
{href ? (
|
||||
<a target="blank" rel="noreferrer" href={href}>
|
||||
{' '}
|
||||
{value}{' '}
|
||||
</a>
|
||||
) : (
|
||||
<div>{value}</div>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
</>
|
||||
) : (
|
||||
<LoadingIndicator />
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue