ConceptPortal-public/rsconcept/frontend/src/components/Navigation/Logo.tsx

35 lines
985 B
TypeScript
Raw Normal View History

2023-07-15 17:46:19 +03:00
import { Link } from 'react-router-dom';
2023-10-13 21:44:18 +03:00
import { useConceptTheme } from '../../context/ThemeContext';
2023-10-06 15:37:32 +03:00
import useWindowSize from '../../hooks/useWindowSize';
const HIDE_LOGO_TEXT_LIMIT = 700;
function Logo() {
2023-10-13 21:44:18 +03:00
const { darkMode } = useConceptTheme();
2023-10-06 15:37:32 +03:00
const windowSize = useWindowSize();
2023-07-15 17:46:19 +03:00
return (
<Link to='/' tabIndex={-1}
className='flex items-center h-full mr-2'
>
{(windowSize.width && windowSize.width >= HIDE_LOGO_TEXT_LIMIT && !darkMode) ?
<img alt=''
src='/logo_full.svg'
className='max-h-[1.6rem] min-w-[1.6rem]'
/> : null}
{(windowSize.width && windowSize.width >= HIDE_LOGO_TEXT_LIMIT && darkMode) ?
<img alt=''
src='/logo_full_dark.svg'
className='max-h-[1.6rem] min-w-[1.6rem]'
/> : null}
{(!windowSize.width || windowSize.width < HIDE_LOGO_TEXT_LIMIT) ?
<img alt=''
src='/logo_sign.svg'
className='max-h-[1.6rem] min-w-[2.2rem]'
/> : null}
</Link>);
2023-07-15 17:46:19 +03:00
}
2023-07-25 20:27:29 +03:00
export default Logo;