mirror of
https://github.com/myfatemi04/wheelshare-frontend.git
synced 2025-04-21 11:20:17 -04:00
make primary title in header clickable
This commit is contained in:
parent
171a82086f
commit
c1f437cedd
|
@ -9,6 +9,7 @@ import UIPrimaryTitle from '../UI/UIPrimaryTitle';
|
|||
export default function Header() {
|
||||
const me = useMe();
|
||||
const notifications = useNotifications();
|
||||
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
|
@ -18,7 +19,12 @@ export default function Header() {
|
|||
alignItems: 'center',
|
||||
}}
|
||||
>
|
||||
<UIPrimaryTitle>WheelShare</UIPrimaryTitle>
|
||||
<UIPrimaryTitle
|
||||
style={{ cursor: 'pointer' }}
|
||||
onClick={() => (window.location.href = '/')}
|
||||
>
|
||||
WheelShare
|
||||
</UIPrimaryTitle>
|
||||
{me ? (
|
||||
<>
|
||||
{me.name}
|
||||
|
|
|
@ -1,11 +1,19 @@
|
|||
import { CSSProperties, ReactNode } from 'react';
|
||||
import { CSSProperties } from 'react';
|
||||
|
||||
const style: CSSProperties = {
|
||||
const baseStyle: CSSProperties = {
|
||||
fontSize: '3rem',
|
||||
marginTop: '0.25em',
|
||||
marginBottom: '0.25em',
|
||||
};
|
||||
|
||||
export default function UIPrimaryTitle({ children }: { children: ReactNode }) {
|
||||
return <h1 style={style}>{children}</h1>;
|
||||
export default function UIPrimaryTitle({
|
||||
children,
|
||||
style,
|
||||
...props
|
||||
}: JSX.IntrinsicElements['h1']) {
|
||||
return (
|
||||
<h1 style={style ? { ...baseStyle, ...style } : baseStyle} {...props}>
|
||||
{children}
|
||||
</h1>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user