-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.tsx
59 lines (56 loc) · 1.87 KB
/
index.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import React from 'react';
import { ReactComponent as NimbleLogoWhite } from 'assets/images/icons/nimble-logo-white.svg';
import Shimmer from 'components/Shimmer';
interface DashboardHeaderProps {
dateTime: string;
daysAgo: string;
profileUrl: string;
shouldShowShimmer?: boolean;
children: React.ReactNode;
'data-test-id'?: string;
}
const DashboardHeader = ({
dateTime,
daysAgo,
profileUrl,
shouldShowShimmer = true,
children,
...rest
}: DashboardHeaderProps): JSX.Element => {
return (
<header className="flex flex-col min-h-screen" {...rest}>
<div className="flex justify-between pt-8">
{shouldShowShimmer ? <Shimmer classAttributes="w-[117px] h-[18px] rounded-[14px]" /> : <NimbleLogoWhite />}
{shouldShowShimmer ? (
<Shimmer classAttributes="w-[36px] h-[36px] rounded-full" />
) : (
<img className="w-[36px] h-[36px] rounded-full" src={profileUrl} alt="user avatar" />
)}
</div>
<div className="flex justify-between">
<div className="w-1/5"></div>
<div className="flex flex-col text-white mt-10 flex-1">
{shouldShowShimmer ? (
<Shimmer classAttributes="w-[117px] h-[18px] rounded-[14px]" />
) : (
<p className="text-x-small font-extrabold">{dateTime}</p>
)}
{shouldShowShimmer ? (
<div className="mt-[14px]">
<Shimmer classAttributes="w-[100px] h-[18px] rounded-[14px]" />
</div>
) : (
<p className="text-x-large font-extrabold mt-1">{daysAgo}</p>
)}
</div>
<div className="w-1/5"></div>
</div>
<div className="flex justify-between mt-8">
<div className="w-1/5"></div>
<div className="flex-1">{children}</div>
<div className="w-1/5"></div>
</div>
</header>
);
};
export default DashboardHeader;