guild_front/src/components/Outstaffing/OutstaffingBlock.js

42 lines
1.0 KiB
JavaScript
Raw Normal View History

2021-06-02 14:04:26 +03:00
import React from 'react';
2021-06-01 15:25:01 +03:00
import style from './Outstaffing.module.css';
2021-06-07 17:48:07 +03:00
const OutstaffingBlock = ({ data = {}, onClick, onTabBarClick, selected }) => {
const { img, text, tags, name, header } = data;
let clas;
if (name === 'Backend') {
clas = style.back;
} else if (name === 'Design') {
clas = style.des;
} else if (name === 'Frontend') {
clas = style.front;
}
2021-06-01 15:25:01 +03:00
return (
<div className={style.outstaffing__box}>
2021-06-07 17:48:07 +03:00
<div
className={`${style.outstaffing__box__img} ${selected ? style.border : null}`}
onClick={() => onTabBarClick(name)}
>
<h3>{header}</h3>
<img className={clas} src={img} alt="img" />
</div>
<div>
<p>{text}</p>
{tags && (
<ul className={style.items}>
{tags.map((item) => (
<li key={item} onClick={() => onClick(item)}>
{item}
</li>
))}
</ul>
)}
</div>
2021-06-01 15:25:01 +03:00
</div>
);
};
export default OutstaffingBlock;