-
Notifications
You must be signed in to change notification settings - Fork 16
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 = { | ||
|
@@ -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"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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:
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>
);
}
<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> | ||
); | ||
} |
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} />; | ||
} |
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); |
There was a problem hiding this comment.
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.