-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feat]: Timesheet Calendar View UI (#3369)
* feat:timesheet calendar view ui init * feat:timesheet calendar view ui daily * fix:cspell * fix:cspell * fix:coderabbitai --------- Co-authored-by: Ruslan Konviser <evereq@gmail.com>
- Loading branch information
1 parent
897ad04
commit aab335d
Showing
7 changed files
with
202 additions
and
12 deletions.
There are no files selected for viewing
140 changes: 138 additions & 2 deletions
140
apps/web/app/[locale]/timesheet/[memberId]/components/CalendarView.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
apps/web/app/[locale]/timesheet/[memberId]/components/CompactTimesheetComponent.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import React from "react"; | ||
|
||
export const EmployeeAvatar = ({ imageUrl }: { imageUrl: string }) => { | ||
const [isLoading, setIsLoading] = React.useState(true); | ||
|
||
return ( | ||
<div className="relative w-6 h-6"> | ||
{isLoading && ( | ||
<div className="absolute inset-0 flex items-center justify-center bg-gray-200 rounded-full"> | ||
<LoadingSpinner className="w-4 h-4" /> | ||
</div> | ||
)} | ||
<img | ||
className="w-6 h-6 rounded-full" | ||
src={imageUrl} | ||
alt="Employee" | ||
onLoad={() => setIsLoading(false)} | ||
onError={() => setIsLoading(false)} | ||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
|
||
const LoadingSpinner = ({ className }: { className?: string }) => ( | ||
<svg | ||
className={`animate-spin text-gray-500 ${className}`} | ||
xmlns="http://www.w3.org/2000/svg" | ||
fill="none" | ||
viewBox="0 0 24 24" | ||
> | ||
<circle | ||
className="opacity-25" | ||
cx="12" | ||
cy="12" | ||
r="10" | ||
stroke="currentColor" | ||
strokeWidth="4" | ||
></circle> | ||
<path | ||
className="opacity-75" | ||
fill="currentColor" | ||
d="M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z" | ||
></path> | ||
</svg> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters