Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: header logo #168

Merged
merged 10 commits into from
Mar 7, 2024
Merged

feat: header logo #168

merged 10 commits into from
Mar 7, 2024

Conversation

Meolocious
Copy link
Collaborator

Short description

This PR will introduce the logo image (not the small avatar) in the Header component. Also the style is updated with the latest requirements.

List of changes proposed in this pull request

  • removed "box" in the DialogBubble.tsx
  • changed bg colour in the DialogBubble.tsx
  • added "logo" as optional in the Title.tsx

Screenshot

Before changes:
Send Header Before

After changes:
Send Header After

Product

How to test

Tested on the Storybook. Then builded and tested on B2BP. Due to the logo should be loaded from B2BP, here it could be visible only changing locally this file here:

src\components\Header\components\Title.tsx

import {
  Stack,
  Avatar,
  Typography,
  Chip,
  type AvatarProps,
  useTheme,
  Link,
  useMediaQuery,
} from '@mui/material';
import { type CommonProps } from '../../../types/components';
import logoImage from '../../../assets/images/logoSend.svg';

export interface TitleProps extends CommonProps {
  product: {
    name: string;
    href?: string;
  };
  avatar?: AvatarProps;
  beta?: boolean;
}

export const Content = ({
  avatar,
  beta,
  product: { name: productName, href: productHref },
  theme,
}: TitleProps) => {
  const { palette, spacing } = useTheme();
  const textColor =
    theme === 'dark' ? palette.primary.contrastText : palette.text.primary;
  const label = 'beta';

  const isBelow900px = useMediaQuery('(max-width:900px)');

  const productContent = logoImage ? (
    <img src={logoImage} alt="Logo" style={{ height: '70px' }} />
  ) : (
    <Typography
      color={textColor}
      fontSize={{ xs: spacing(3), sm: spacing(3.5) }}
      noWrap
      variant="h5"
    >
      <b>{productName}</b>
    </Typography>
  );

  return (
    <Stack direction="row" gap={1} alignItems="center">
      {avatar && <Avatar {...avatar} />}
      {productHref && (
        <Link
          href={productHref}
          underline="none"
          sx={{
            margin: isBelow900px ? '22px 24px 16px 0' : '22px 24px 16px 24px',
          }}
        >
          {productContent}
        </Link>
      )}
      {beta && (
        <Chip
          label={label}
          color="primary"
          sx={{ height: 20, width: 45 }}
          size="small"
        />
      )}
    </Stack>
  );
};

and putting this .svg inside the src\assets\images:

logoSend

@Meolocious Meolocious requested review from datalek and kin0992 March 7, 2024 16:47
@Meolocious Meolocious self-assigned this Mar 7, 2024
# [3.1.0](v3.0.0...v3.1.0) (2024-03-07)

### Bug Fixes

* colour palette ([785b6ea](785b6ea))
* dropdown bubble fix ([0889f56](0889f56))
* palette fix ([d054a4c](d054a4c))
* remove commented line ([7e6c85f](7e6c85f))
* remove logo image example ([2a4f91d](2a4f91d))
* remove shadow to implement them directly inside B2BP ([2736690](2736690))
* remove width from logo ([4eab572](4eab572))

### Features

* adding logo to header ([f71b441](f71b441))
* logo component integration ([8f442a3](8f442a3))
@kin0992 kin0992 merged commit 99533cc into main Mar 7, 2024
1 check passed
@kin0992 kin0992 deleted the release/header-logo-feature branch March 7, 2024 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants