Hotfix et Modèle (backend) complet d'une fonction
This commit is contained in:
@ -5,18 +5,18 @@ import { API_URL } from '../../config/config';
|
||||
|
||||
const FunctionComponent = () => {
|
||||
|
||||
const router = useRouter();
|
||||
const { slug } = useRouter().query;
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
<HeadTag
|
||||
title={router.query.slug}
|
||||
description={router.query.slug}
|
||||
image={`${API_URL}/images/functions/${router.query.slug}.png`}
|
||||
title={slug}
|
||||
description={slug}
|
||||
image={`${API_URL}/images/functions/${slug}.png`}
|
||||
/>
|
||||
<div className="container text-center">
|
||||
<div className="row justify-content-center">
|
||||
<h1>{router.query.slug}</h1>
|
||||
<h1>{slug}</h1>
|
||||
</div>
|
||||
</div>
|
||||
</Fragment>
|
||||
|
@ -3,7 +3,6 @@ import HeadTag from '../../components/HeadTag';
|
||||
import FunctionCard from '../../components/FunctionCard/FunctionCard';
|
||||
import Loader from '../../components/Loader';
|
||||
import '../../public/css/pages/functions.css';
|
||||
import { API_URL } from '../../config/config';
|
||||
import api from '../../config/api';
|
||||
import useAPI from '../../hooks/useAPI';
|
||||
|
||||
@ -86,9 +85,9 @@ const Functions = () => {
|
||||
{functionsData.rows.map((f, index) => {
|
||||
// Si c'est le dernier élément
|
||||
if (functionsData.rows.length === index + 1) {
|
||||
return <FunctionCard ref={lastFunctionCardRef} key={f.id} slug={f.slug} image={API_URL + f.image} title={f.title} description={f.description} category={f.categorie} publicationDate={new Date(f.createdAt).toLocaleDateString('fr-FR')} />;
|
||||
return <FunctionCard ref={lastFunctionCardRef} key={f.id} slug={f.slug} image={f.image} title={f.title} description={f.description} category={f.categorie} publicationDate={new Date(f.createdAt).toLocaleDateString('fr-FR')} type={f.type} />;
|
||||
}
|
||||
return <FunctionCard key={f.id} slug={f.slug} image={API_URL + f.image} title={f.title} description={f.description} category={f.categorie} publicationDate={new Date(f.createdAt).toLocaleDateString('fr-FR')} />;
|
||||
return <FunctionCard key={f.id} slug={f.slug} image={f.image} title={f.title} description={f.description} category={f.categorie} publicationDate={new Date(f.createdAt).toLocaleDateString('fr-FR')} type={f.type} />;
|
||||
})}
|
||||
</div>
|
||||
{isLoadingFunctions && <Loader />}
|
||||
|
@ -19,21 +19,17 @@ const Home = () => {
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
<HeadTag
|
||||
title="FunctionProject"
|
||||
description="FunctionProject est un projet créé par Divlo qui a pour but de rassembler plein de mini-programme permettant de faire plusieurs choses comme savoir la météo, générer un nombre aléatoire, etc."
|
||||
image="/images/FunctionProject_icon_small.png"
|
||||
/>
|
||||
<HeadTag />
|
||||
<div className="Home__container container-fluid text-center">
|
||||
|
||||
<AutoPlaySwipeableViews enableMouseEvents interval={30000}>
|
||||
<AutoPlaySwipeableViews enableMouseEvents interval={15000}>
|
||||
|
||||
{/* Slide 1 */}
|
||||
<div className="row align-items-center justify-content-center">
|
||||
<div className="col-24">
|
||||
<h1 className="Home__title-important important">FunctionProject</h1>
|
||||
<p className="Home__description">
|
||||
Apprenez la programmation grâce à l'apprentissage par projet.<br/>
|
||||
Apprenez la programmation grâce à l'apprentissage par projet alias fonction.<br/>
|
||||
Découvrez la liste des fonctions disponibles :
|
||||
</p>
|
||||
</div>
|
||||
@ -49,8 +45,9 @@ const Home = () => {
|
||||
<div className="col-24">
|
||||
<h1 className="Home__title-important important">Code Source</h1>
|
||||
<p className="Home__description">
|
||||
Le partage est essentiel afin de progresser tous ensemble. <br/>
|
||||
Par conséquent le code source du projet est disponible sur mon profil GitHub :
|
||||
Le partage est essentiel afin de progresser. <br/>
|
||||
Par conséquent chaque fonction a un article expliquant comment elle fonctionne et <br/>
|
||||
le code source du projet est disponible sur mon profil GitHub :
|
||||
</p>
|
||||
</div>
|
||||
<div className="col-24">
|
||||
|
Reference in New Issue
Block a user