Skip to content
Snippets Groups Projects
Commit 418f90fb authored by Tojo's avatar Tojo
Browse files

change place map of list reseaux socieaux

parent 71c4bff5
No related branches found
No related tags found
No related merge requests found
...@@ -81,12 +81,12 @@ interface SearchProps {} ...@@ -81,12 +81,12 @@ interface SearchProps {}
export function Search(props: SearchProps): JSX.Element; export function Search(props: SearchProps): JSX.Element;
interface ISocialMediaList { interface ISocialMediaList {
// logo?: any, logo?: any,
// name?: string, name?: string,
// url?: string, url?: string,
// className?: string, // className?: string,
layout?:string layout?:string
dataList: any // dataList: any
} }
export function SocialMediaList(props: ISocialMediaList): JSX.Element; export function SocialMediaList(props: ISocialMediaList): JSX.Element;
......
import React from 'react' import React from "react";
import Logo from './core/Logo' import Logo from "./core/Logo";
import facebook from '../images/facebook.svg';
import google from '../images/google.svg';
import linkedin from '../images/linkedin.svg';
import twitter from '../images/twitter.svg';
import instagram from '../images/instagram.svg';
interface ISocialMediaList { interface ISocialMediaList {
layout?:string, layout?: string;
dataList: any name: string;
logo: any;
url: string;
} }
const SocialMediaList = (props:ISocialMediaList) => { const SocialMediaList = (props: ISocialMediaList) => {
const classRow = "flex gap-x-1" const { layout, name, logo, url } = props;
const classCol = "flex flex-col gap-y-1"
const {layout, dataList} = props;
return ( return (
<div className='flex flex-col'> <div
<div> className={`tooltip ${
<h3 className='font-bold pb-3'>Réseaux sociaux</h3> layout == "row" ? "tooltip-bottom" : "tooltip-right"
</div> } `}
<div className={`${layout == "row" ? classRow : classCol}`}> data-tip={name}
{ >
dataList.map((item:any, key:number) => { <Logo
return ( image={logo}
<div className={`pb-0`} key={key}> to={url}
<div className={`tooltip ${layout == "row" ? 'tooltip-bottom' : 'tooltip-right'} `} data-tip={item.name}> className={"w-10 h-10"}
<Logo image={`${process.env.DIRECTUS_URL}assets/${item.logo.id}`} to={item.url} className={"w-10 h-10"} classImg={"my-2 h-10 w-10"}/> classImg={" h-10 w-10"}
</div> />
</div> </div>
) );
}) };
}
</div>
</div>
)
}
export default SocialMediaList export default SocialMediaList;
...@@ -23,7 +23,7 @@ const Logo = (props: Props) => { ...@@ -23,7 +23,7 @@ const Logo = (props: Props) => {
<img <img
src={image} src={image}
alt="Logo" alt="Logo"
height={40} // height={40}
className={classImg} className={classImg}
/> />
</Link> </Link>
......
...@@ -28,16 +28,12 @@ const socialmedialist = ({ data }: PageProps<Data>): ReactElement => { ...@@ -28,16 +28,12 @@ const socialmedialist = ({ data }: PageProps<Data>): ReactElement => {
<code> <code>
{` {`
interface ISocialMediaList { interface ISocialMediaList {
dataList?: any logo?: any,
name?: string,
url?: string,
layout?:string layout?:string
} }
dataList = {
name,
url,
logo,
type
}
query { query {
directus { directus {
...@@ -59,12 +55,40 @@ const socialmedialist = ({ data }: PageProps<Data>): ReactElement => { ...@@ -59,12 +55,40 @@ const socialmedialist = ({ data }: PageProps<Data>): ReactElement => {
<h2>Example</h2> <h2>Example</h2>
</div> </div>
<div className="flex gap-6 m-4"> <h2>reseaux sociaux</h2>
<SocialMediaList dataList={dataList} layout="row" /> <div className="flex gap-2 m-4">
{dataList.map((item: any) => {
return (
<div key={item.id}>
<SocialMediaList
name={item.name}
url={item.url}
logo={`${process.env.DIRECTUS_URL}assets/${item.logo.id}`}
layout="row"
/>
</div>
);
})}
</div> </div>
<div className="flex gap-6 m-4">
<SocialMediaList dataList={dataList} layout="col" /> <h2>reseaux sociaux</h2>
<div className="flex flex-col gap-2 m-4">
{dataList.map((item: any) => {
return (
<div key={item.id}>
<SocialMediaList
name={item.name}
url={item.url}
logo={`${process.env.DIRECTUS_URL}assets/${item.logo.id}`}
layout="col"
/>
</div>
);
})}
</div> </div>
{/* <div className="flex gap-6 m-4">
<SocialMediaList dataList={dataList} layout="col" />
</div> */}
</Content> </Content>
); );
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment