guild_front/src/components/Outstaffing/OutstaffingBlock.js

42 lines
1.1 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;
2021-06-09 13:12:01 +03:00
let classes;
2021-06-07 17:48:07 +03:00
if (name === 'Backend') {
2021-06-09 13:12:01 +03:00
classes = style.back;
2021-06-07 17:48:07 +03:00
} else if (name === 'Design') {
2021-06-09 13:12:01 +03:00
classes = style.des;
2021-06-07 17:48:07 +03:00
} else if (name === 'Frontend') {
2021-06-09 13:12:01 +03:00
classes = style.front;
2021-06-07 17:48:07 +03:00
}
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>
2021-06-09 13:12:01 +03:00
<img className={classes} src={img} alt="img" />
2021-06-07 17:48:07 +03:00
</div>
2021-06-09 13:12:01 +03:00
<div className={`${selected ? style.mobile__block : style.mobile__none}`}>
2021-06-07 17:48:07 +03:00
<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;