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

shelter: show icon in header and footer (DEV-1177) #801

Merged
merged 2 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion apps/shelter-web/src/app/layout/footer.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { BaShelterLogoIcon } from '@monorepo/react/icons';
import { ReactElement } from 'react';

type IParams = {
Expand All @@ -19,7 +20,14 @@ export function Footer(props: IParams): ReactElement {

return (
<footer className={parentCss}>
<div className="border-t-[0.5px] border-white pt-6 flex justify-end">
<div className="flex items-center">
<BaShelterLogoIcon className="h-8" />
<div className="text-white flex ml-3 text-2xl">
<div className="font-normal">Shelters</div>
<div className="font-semibold">LA</div>
</div>
</div>
<div className="mt-6 border-t-[0.5px] border-white pt-6 flex justify-end">
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Consider using a standard border width instead of 0.5px for better cross-browser consistency

Sub-pixel values can render inconsistently across different browsers. Consider using 1px or a standard Tailwind border width class.

Suggested change
<div className="mt-6 border-t-[0.5px] border-white pt-6 flex justify-end">
<div className="mt-6 border-t border-white pt-6 flex justify-end">

<div className="text-xs">
© 2024 Better Angels Inc. All rights reserved.
</div>
Expand Down
13 changes: 12 additions & 1 deletion apps/shelter-web/src/app/layout/header.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { BaShelterLogoIcon } from '@monorepo/react/icons';
import { ReactElement } from 'react';

type IParams = {
Expand All @@ -16,5 +17,15 @@ export function Header(props: IParams): ReactElement {
'text-white',
].join(' ');

return <header className={parentCss}>hello shelter-app</header>;
return (
<header className={parentCss}>
<div className="flex items-center">
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Consider extracting the logo and text into a shared component to avoid duplication with the footer

This would make the codebase more maintainable and ensure consistent branding across components.

Suggested implementation:

import { ReactElement } from 'react';
import { BrandLogo } from '../components/BrandLogo';
      <BrandLogo size="small" />

You'll need to:

  1. Create a new file apps/shelter-web/src/app/components/BrandLogo.tsx with this content:
import { BetterangelsLogoIcon } from '@monorepo/react/icons';

type BrandLogoProps = {
  size?: 'small' | 'large';
};

export function BrandLogo({ size = 'small' }: BrandLogoProps): ReactElement {
  const logoHeight = size === 'small' ? 'h-4' : 'h-8';

  return (
    <div className="flex items-center">
      <BetterangelsLogoIcon className={`${logoHeight} text-brand-yellow`} />
      <div className="text-white flex ml-2 text-sm">
        <div className="font-normal">Shelters</div>
        <div className="font-semibold">LA</div>
      </div>
    </div>
  );
}
  1. Update the footer component to use:
<BrandLogo size="large" />

This creates a reusable component that maintains consistency while allowing for different sizes in different contexts.

<BaShelterLogoIcon className="h-4" />
<div className="text-white flex ml-2 text-sm">
<div className="font-normal">Shelters</div>
<div className="font-semibold">LA</div>
</div>
</div>
</header>
);
}
1 change: 1 addition & 0 deletions apps/shelter-web/src/assets/styles/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

:root {
--font-primary: 'Poppins', 'sans-serif';
--color-brand-yellow: #fff82e;
--color-primary-20: #052b73;
--color-primary-60: #216af8;
--color-primary-95: #dae7ff;
Expand Down
1 change: 1 addition & 0 deletions apps/shelter-web/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ module.exports = {
primary: ['Poppins', 'sans-serif'],
},
colors: {
'brand-yellow': 'var(--color-brand-yellow)',
'primary-20': 'var(--color-primary-20)',
'primary-60': 'var(--color-primary-60)',
'primary-95': 'var(--color-primary-95)',
Expand Down
7 changes: 7 additions & 0 deletions libs/assets/src/icons/svg/better_angels/betterAngelsLogo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions libs/react/icons/src/lib/components/baShelterLogoIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { SVGProps } from 'react';
import BetterAngelsLogoIcon from './betterAngelsLogoIcon';

interface IProps extends SVGProps<SVGSVGElement> {
className?: string;
}

export default function BaShelterLogo(props?: IProps) {
return <BetterAngelsLogoIcon fill="#fff82e" {...props} />;
}
4 changes: 4 additions & 0 deletions libs/react/icons/src/lib/components/betterAngelsLogoIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import svg from '../../../../../assets/src/icons/svg/better_angels/betterAngelsLogo.svg';
import { createSvgComponent } from '../../toComponent';

export default createSvgComponent(svg);
2 changes: 2 additions & 0 deletions libs/react/icons/src/lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export { default as BaShelterLogoIcon } from './components/baShelterLogoIcon';
export { default as BetterAngelsLogoIcon } from './components/betterAngelsLogoIcon';
export { default as CheckIcon } from './components/checkIcon';
export { default as ChevronLeftIcon } from './components/chevronLeftIcon';
export { default as CloseIcon } from './components/closeIcon';
Expand Down
Loading