import React, { forwardRef, HTMLAttributes } from 'react';
import { ColorToken, isColorToken } from '@gdsc-dju/styled-components-theme';
import styled, { css } from 'styled-components';
import GDSCLogo from '../assets/GDSCLogo';
interface NavigationLogoProps extends HTMLAttributes {
customLogo?: React.ReactNode;
title?: string;
pointColor?: ColorToken | string;
}
export const StyledLogoWrapper = styled.div`
display: flex;
align-items: center;
font-size: ${({ theme }) => theme.fontSizes.textXl};
flex-direction: row;
flex-wrap: wrap;
gap: 4px;
cursor: pointer;
@media (max-width: ${({ theme }) => theme.windowSizes.mobile}px) {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
`;
export const NavSubtitle = styled.div<{ color?: ColorToken | string }>`
display: flex;
align-items: center;
cursor: pointer;
color: ${({ theme }) => theme.colors.grey600};
font-size: ${({ theme }) => theme.fontSizes.textM};
font-weight: ${({ theme }) => theme.fontWeights.medium};
word-break: keep-all;
margin-top: 2px;
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Safari */
-ms-user-select: none; /* 인터넷익스플로러 */
user-select: none;
${({ color }) =>
color && isColorToken(color)
? css`
color: ${({ theme }) => theme.colors[color]};
`
: css`
color: ${color};
`}
`;
export const LogoTitle = styled.div`
margin-left: 4px;
font-weight: ${({ theme }) => theme.fontWeights.bold};
font-size: ${({ theme }) => theme.fontSizes.textXxl};
color: ${({ theme }) => theme.colors.grey800};
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Safari */
-ms-user-select: none; /* 인터넷익스플로러 */
user-select: none;
`;
export const LogoTextWrapper = styled.div`
display: flex;
align-items: center;
flex-direction: row;
gap: 4px;
@media (max-width: ${({ theme }) => theme.windowSizes.mobile}px) {
display: none;
}
`;
const NavigationLogo = forwardRef(
({ customLogo, title, pointColor, ...rest }, ref) => {
return (
<>
{customLogo ? (
<>{customLogo}>
) : (
GDSC
{title ? (
<>
DJU
{title}
>
) : (
<>
Daejin
Univ.
>
)}
)}
>
);
},
);
export default NavigationLogo;