Skip to content

Commit

Permalink
Footer containing logos
Browse files Browse the repository at this point in the history
  • Loading branch information
michalmasrna1 committed Nov 12, 2023
1 parent 40d136d commit 23ebb87
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions src/components/PageLayout/Footer/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,35 @@
import {useQuery} from '@tanstack/react-query'
import axios from 'axios'
import {FC} from 'react'

import {Loading} from '@/components/Loading/Loading'
import {ILogo, Logo} from '@/components/PageLayout/Footer/Logo'

import styles from './Footer.module.scss'
import logoStyles from './Logo.module.scss'

export const Footer: FC = () => {
const {
data: postsData,
isLoading: logosIsLoading,
error: postsError,
} = useQuery({
queryKey: ['cms', 'logo'],
queryFn: () => axios.get<ILogo[]>('/api/cms/logo'),
})
const logos = postsData?.data ?? []

return (
<div className={styles.footer}>
<div className={styles.grid}>
<div className={styles.content}>
<p>futo</p>
<p>futo</p>
<p>futo</p>
<p>futo</p>
<div className={logoStyles.logosRow}>
{logosIsLoading && <Loading />}
{logos.map((post) => (
<Logo key={post.id} {...post} />
))}
{postsError && <p>{postsError.message}</p>}
</div>
</div>
</div>
</div>
Expand Down

0 comments on commit 23ebb87

Please sign in to comment.