Added: layout.module.css, donate modal, contribute feedback modal, contacts

This commit is contained in:
mrfry 2021-03-26 16:57:17 +01:00
parent 6fd9beb464
commit 47a2227f87
9 changed files with 204 additions and 93 deletions

View file

@ -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>
)