import React from "react" import Layout from "../layouts/default"; import { Trans, useI18next } from "gatsby-plugin-react-i18next" import { graphql } from 'gatsby' import PropTypes from "prop-types" import styles from "./friends.module.scss"; export const query = graphql` query AllFriendsQuery { allFriendsJson { nodes { name profession url imageURL } } } ` const FriendsPage = ({data}) => { const {t} = useI18next(); function shuffle(a) { for (let i = a.length - 1; i > 0; i--) { const j = Math.floor(Math.random() * (i + 1)); [a[i], a[j]] = [a[j], a[i]]; } return a; } return (

social

friendsDescription

{ shuffle(data.allFriendsJson.nodes).map((friend) => { return (
{friend.name} {friend.profession}
{/**/}
); }) }
{/*
{JSON.stringify(data, null, 2)}
*/}
); } FriendsPage.propTypes = { data: PropTypes.object.isRequired }; export default FriendsPage;