|
|
@@ -53,29 +53,44 @@ const UserWorkspacePage: React.FC<Props> = ({ assignedProjects }) => { |
|
|
|
flexWrap="wrap" |
|
|
|
spacing={2} |
|
|
|
> |
|
|
|
<ButtonGroup variant="contained"> |
|
|
|
<Button startIcon={<Add />} onClick={handleAddTimesheetButtonClick}> |
|
|
|
{t("Enter Time")} |
|
|
|
</Button> |
|
|
|
<Button startIcon={<Add />} onClick={handleAddLeaveButtonClick}> |
|
|
|
{t("Record Leave")} |
|
|
|
</Button> |
|
|
|
</ButtonGroup> |
|
|
|
{Boolean(assignedProjects.length) && ( |
|
|
|
<ButtonGroup variant="contained"> |
|
|
|
<Button |
|
|
|
startIcon={<Add />} |
|
|
|
onClick={handleAddTimesheetButtonClick} |
|
|
|
> |
|
|
|
{t("Enter Time")} |
|
|
|
</Button> |
|
|
|
<Button startIcon={<Add />} onClick={handleAddLeaveButtonClick}> |
|
|
|
{t("Record Leave")} |
|
|
|
</Button> |
|
|
|
</ButtonGroup> |
|
|
|
)} |
|
|
|
</Stack> |
|
|
|
</Stack> |
|
|
|
<TimesheetModal |
|
|
|
timesheetType="time" |
|
|
|
isOpen={isTimeheetModalVisible} |
|
|
|
onClose={handleCloseTimesheetModal} |
|
|
|
assignedProjects={assignedProjects} |
|
|
|
/> |
|
|
|
<TimesheetModal |
|
|
|
timesheetType="leave" |
|
|
|
isOpen={isLeaveModalVisible} |
|
|
|
onClose={handleCloseLeaveModal} |
|
|
|
assignedProjects={assignedProjects} |
|
|
|
/> |
|
|
|
<AssignedProjects assignedProjects={assignedProjects} /> |
|
|
|
{assignedProjects.length > 0 ? ( |
|
|
|
<> |
|
|
|
<TimesheetModal |
|
|
|
timesheetType="time" |
|
|
|
isOpen={isTimeheetModalVisible} |
|
|
|
onClose={handleCloseTimesheetModal} |
|
|
|
assignedProjects={assignedProjects} |
|
|
|
/> |
|
|
|
<TimesheetModal |
|
|
|
timesheetType="leave" |
|
|
|
isOpen={isLeaveModalVisible} |
|
|
|
onClose={handleCloseLeaveModal} |
|
|
|
assignedProjects={assignedProjects} |
|
|
|
/> |
|
|
|
<AssignedProjects assignedProjects={assignedProjects} /> |
|
|
|
</> |
|
|
|
) : ( |
|
|
|
<> |
|
|
|
<Typography variant="subtitle1"> |
|
|
|
{t("You have no assigned projects!")} |
|
|
|
</Typography> |
|
|
|
</> |
|
|
|
)} |
|
|
|
</> |
|
|
|
); |
|
|
|
}; |
|
|
|