mirror of
https://github.com/SomboChea/ui
synced 2024-11-04 21:54:30 +07:00
d1ce82854a
* refactor: replaced class by func.comp * refactor: replacing jest test by react-testing-library * refactor: added test todos * feat: added more unit tests * fix: fixed tooltip import * fix: fixed test * fix: fixed typo * fix: fixed imports
33 lines
649 B
TypeScript
33 lines
649 B
TypeScript
import React from 'react';
|
|
import { css } from 'emotion';
|
|
import { Link } from 'react-router-dom';
|
|
|
|
import Search from '../Search/';
|
|
|
|
import HeaderLogo from './HeaderLogo';
|
|
import { LeftSide, SearchWrapper } from './styles';
|
|
|
|
interface Props {
|
|
withoutSearch?: boolean;
|
|
logo?: string;
|
|
}
|
|
|
|
const HeaderLeft: React.FC<Props> = ({ withoutSearch = false, logo }) => (
|
|
<LeftSide>
|
|
<Link
|
|
className={css`
|
|
margin-right: 1em;
|
|
`}
|
|
to={'/'}>
|
|
<HeaderLogo logo={logo} />
|
|
</Link>
|
|
{!withoutSearch && (
|
|
<SearchWrapper>
|
|
<Search />
|
|
</SearchWrapper>
|
|
)}
|
|
</LeftSide>
|
|
);
|
|
|
|
export default HeaderLeft;
|