jornada-ui 0.4.14 → 0.4.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/common/icons-svg/constants/index.js +2 -1
- package/lib/commonjs/common/icons-svg/constants/index.js.map +1 -1
- package/lib/commonjs/common/icons-svg/download/index.js +53 -0
- package/lib/commonjs/common/icons-svg/download/index.js.map +1 -0
- package/lib/commonjs/common/icons-svg/index.js +7 -0
- package/lib/commonjs/common/icons-svg/index.js.map +1 -1
- package/lib/commonjs/components/activities-progress/index.js +10 -10
- package/lib/commonjs/components/activities-progress/index.js.map +1 -1
- package/lib/commonjs/components/card-work-session/index.js +50 -17
- package/lib/commonjs/components/card-work-session/index.js.map +1 -1
- package/lib/commonjs/components/inputs/input-date-time/index.js +11 -9
- package/lib/commonjs/components/inputs/input-date-time/index.js.map +1 -1
- package/lib/commonjs/components/inputs/input-date-time/styles.js +6 -3
- package/lib/commonjs/components/inputs/input-date-time/styles.js.map +1 -1
- package/lib/commonjs/components/modals/{modal-journey-rectification → modal-edite-journey-rectification}/index.js +71 -65
- package/lib/commonjs/components/modals/modal-edite-journey-rectification/index.js.map +1 -0
- package/lib/commonjs/components/modals/modal-edite-journey-rectification/interface.d.js.map +1 -0
- package/lib/commonjs/components/notification-card/index.js +142 -0
- package/lib/commonjs/components/notification-card/index.js.map +1 -0
- package/lib/commonjs/components/notification-card/interface.js +6 -0
- package/lib/commonjs/components/notification-card/interface.js.map +1 -0
- package/lib/commonjs/components/notification-details-card/index.js +181 -0
- package/lib/commonjs/components/notification-details-card/index.js.map +1 -0
- package/lib/commonjs/components/notification-details-card/interface.js +6 -0
- package/lib/commonjs/components/notification-details-card/interface.js.map +1 -0
- package/lib/commonjs/components/user-journey-work-card/index.js +44 -4
- package/lib/commonjs/components/user-journey-work-card/index.js.map +1 -1
- package/lib/commonjs/index.js +19 -5
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/stories/button/button.stories.js +0 -2
- package/lib/commonjs/stories/button/button.stories.js.map +1 -1
- package/lib/commonjs/stories/capture-photo/capture-photo.stories.js +0 -1
- package/lib/commonjs/stories/capture-photo/capture-photo.stories.js.map +1 -1
- package/lib/commonjs/stories/card-work-session/card-work-session.stories.js +62 -9
- package/lib/commonjs/stories/card-work-session/card-work-session.stories.js.map +1 -1
- package/lib/commonjs/stories/modal-journey-rectification/modal-journey-rectification.stories.js +3 -3
- package/lib/commonjs/stories/modal-journey-rectification/modal-journey-rectification.stories.js.map +1 -1
- package/lib/commonjs/stories/notification-card/notification-card.stories.js +100 -0
- package/lib/commonjs/stories/notification-card/notification-card.stories.js.map +1 -0
- package/lib/commonjs/stories/notification-details-card/notification-details-card.stories.js +112 -0
- package/lib/commonjs/stories/notification-details-card/notification-details-card.stories.js.map +1 -0
- package/lib/commonjs/stories/user-journey-work-card/user-journey-work-card.stories.js +12 -4
- package/lib/commonjs/stories/user-journey-work-card/user-journey-work-card.stories.js.map +1 -1
- package/lib/commonjs/styles/theme/theme.js +2 -1
- package/lib/commonjs/styles/theme/theme.js.map +1 -1
- package/lib/module/common/icons-svg/constants/index.js +2 -1
- package/lib/module/common/icons-svg/constants/index.js.map +1 -1
- package/lib/module/common/icons-svg/download/index.js +47 -0
- package/lib/module/common/icons-svg/download/index.js.map +1 -0
- package/lib/module/common/icons-svg/index.js +7 -0
- package/lib/module/common/icons-svg/index.js.map +1 -1
- package/lib/module/components/activities-progress/index.js +10 -10
- package/lib/module/components/activities-progress/index.js.map +1 -1
- package/lib/module/components/card-work-session/index.js +50 -17
- package/lib/module/components/card-work-session/index.js.map +1 -1
- package/lib/module/components/inputs/input-date-time/index.js +11 -9
- package/lib/module/components/inputs/input-date-time/index.js.map +1 -1
- package/lib/module/components/inputs/input-date-time/styles.js +6 -3
- package/lib/module/components/inputs/input-date-time/styles.js.map +1 -1
- package/lib/module/components/modals/{modal-journey-rectification → modal-edite-journey-rectification}/index.js +69 -63
- package/lib/module/components/modals/modal-edite-journey-rectification/index.js.map +1 -0
- package/lib/module/components/modals/modal-edite-journey-rectification/interface.d.js.map +1 -0
- package/lib/module/components/notification-card/index.js +135 -0
- package/lib/module/components/notification-card/index.js.map +1 -0
- package/lib/module/components/notification-card/interface.js +4 -0
- package/lib/module/components/notification-card/interface.js.map +1 -0
- package/lib/module/components/notification-details-card/index.js +183 -0
- package/lib/module/components/notification-details-card/index.js.map +1 -0
- package/lib/module/components/notification-details-card/interface.js +4 -0
- package/lib/module/components/notification-details-card/interface.js.map +1 -0
- package/lib/module/components/user-journey-work-card/index.js +44 -4
- package/lib/module/components/user-journey-work-card/index.js.map +1 -1
- package/lib/module/index.js +3 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/stories/button/button.stories.js +0 -1
- package/lib/module/stories/button/button.stories.js.map +1 -1
- package/lib/module/stories/capture-photo/capture-photo.stories.js +0 -1
- package/lib/module/stories/capture-photo/capture-photo.stories.js.map +1 -1
- package/lib/module/stories/card-work-session/card-work-session.stories.js +62 -9
- package/lib/module/stories/card-work-session/card-work-session.stories.js.map +1 -1
- package/lib/module/stories/modal-journey-rectification/modal-journey-rectification.stories.js +3 -3
- package/lib/module/stories/modal-journey-rectification/modal-journey-rectification.stories.js.map +1 -1
- package/lib/module/stories/notification-card/notification-card.stories.js +95 -0
- package/lib/module/stories/notification-card/notification-card.stories.js.map +1 -0
- package/lib/module/stories/notification-details-card/notification-details-card.stories.js +107 -0
- package/lib/module/stories/notification-details-card/notification-details-card.stories.js.map +1 -0
- package/lib/module/stories/user-journey-work-card/user-journey-work-card.stories.js +12 -4
- package/lib/module/stories/user-journey-work-card/user-journey-work-card.stories.js.map +1 -1
- package/lib/module/styles/theme/theme.js +2 -1
- package/lib/module/styles/theme/theme.js.map +1 -1
- package/lib/typescript/commonjs/src/common/icons-svg/constants/index.d.ts +1 -0
- package/lib/typescript/commonjs/src/common/icons-svg/constants/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/common/icons-svg/download/index.d.ts +11 -0
- package/lib/typescript/commonjs/src/common/icons-svg/download/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/common/icons-svg/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/card-report/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/card-scheduled-journey/index.d.ts +1 -1
- package/lib/typescript/commonjs/src/components/card-work-session/index.d.ts +2 -1
- package/lib/typescript/commonjs/src/components/card-work-session/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/inputs/input-date-time/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/inputs/input-date-time/styles.d.ts +2 -1
- package/lib/typescript/commonjs/src/components/inputs/input-date-time/styles.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/modals/{modal-journey-rectification → modal-edite-journey-rectification}/index.d.ts +3 -0
- package/lib/typescript/commonjs/src/components/modals/modal-edite-journey-rectification/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/notification-card/index.d.ts +11 -0
- package/lib/typescript/commonjs/src/components/notification-card/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/notification-card/interface.d.ts +17 -0
- package/lib/typescript/commonjs/src/components/notification-card/interface.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/notification-details-card/index.d.ts +11 -0
- package/lib/typescript/commonjs/src/components/notification-details-card/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/notification-details-card/interface.d.ts +15 -0
- package/lib/typescript/commonjs/src/components/notification-details-card/interface.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/selects/select-date-and-hours/index.d.ts +1 -1
- package/lib/typescript/commonjs/src/components/travel-history/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/user-journey-work-card/index.d.ts +2 -0
- package/lib/typescript/commonjs/src/components/user-journey-work-card/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts +3 -1
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/stories/card-work-session/card-work-session.stories.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/stories/modal-journey-rectification/modal-journey-rectification.stories.d.ts +1 -1
- package/lib/typescript/commonjs/src/stories/modal-journey-rectification/modal-journey-rectification.stories.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/stories/notification-card/notification-card.stories.d.ts +14 -0
- package/lib/typescript/commonjs/src/stories/notification-card/notification-card.stories.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/stories/notification-details-card/notification-details-card.stories.d.ts +16 -0
- package/lib/typescript/commonjs/src/stories/notification-details-card/notification-details-card.stories.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/stories/user-journey-work-card/user-journey-work-card.stories.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/styles/global/theme-provider.d.ts +1 -0
- package/lib/typescript/commonjs/src/styles/global/theme-provider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/styles/theme/theme.d.ts +1 -0
- package/lib/typescript/commonjs/src/styles/theme/theme.d.ts.map +1 -1
- package/lib/typescript/module/src/common/icons-svg/constants/index.d.ts +1 -0
- package/lib/typescript/module/src/common/icons-svg/constants/index.d.ts.map +1 -1
- package/lib/typescript/module/src/common/icons-svg/download/index.d.ts +11 -0
- package/lib/typescript/module/src/common/icons-svg/download/index.d.ts.map +1 -0
- package/lib/typescript/module/src/common/icons-svg/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/card-report/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/card-scheduled-journey/index.d.ts +1 -1
- package/lib/typescript/module/src/components/card-work-session/index.d.ts +2 -1
- package/lib/typescript/module/src/components/card-work-session/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/inputs/input-date-time/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/inputs/input-date-time/styles.d.ts +2 -1
- package/lib/typescript/module/src/components/inputs/input-date-time/styles.d.ts.map +1 -1
- package/lib/typescript/module/src/components/modals/{modal-journey-rectification → modal-edite-journey-rectification}/index.d.ts +3 -0
- package/lib/typescript/module/src/components/modals/modal-edite-journey-rectification/index.d.ts.map +1 -0
- package/lib/typescript/module/src/components/notification-card/index.d.ts +11 -0
- package/lib/typescript/module/src/components/notification-card/index.d.ts.map +1 -0
- package/lib/typescript/module/src/components/notification-card/interface.d.ts +17 -0
- package/lib/typescript/module/src/components/notification-card/interface.d.ts.map +1 -0
- package/lib/typescript/module/src/components/notification-details-card/index.d.ts +11 -0
- package/lib/typescript/module/src/components/notification-details-card/index.d.ts.map +1 -0
- package/lib/typescript/module/src/components/notification-details-card/interface.d.ts +15 -0
- package/lib/typescript/module/src/components/notification-details-card/interface.d.ts.map +1 -0
- package/lib/typescript/module/src/components/selects/select-date-and-hours/index.d.ts +1 -1
- package/lib/typescript/module/src/components/travel-history/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/user-journey-work-card/index.d.ts +2 -0
- package/lib/typescript/module/src/components/user-journey-work-card/index.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +3 -1
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/stories/card-work-session/card-work-session.stories.d.ts.map +1 -1
- package/lib/typescript/module/src/stories/modal-journey-rectification/modal-journey-rectification.stories.d.ts +1 -1
- package/lib/typescript/module/src/stories/modal-journey-rectification/modal-journey-rectification.stories.d.ts.map +1 -1
- package/lib/typescript/module/src/stories/notification-card/notification-card.stories.d.ts +14 -0
- package/lib/typescript/module/src/stories/notification-card/notification-card.stories.d.ts.map +1 -0
- package/lib/typescript/module/src/stories/notification-details-card/notification-details-card.stories.d.ts +16 -0
- package/lib/typescript/module/src/stories/notification-details-card/notification-details-card.stories.d.ts.map +1 -0
- package/lib/typescript/module/src/stories/user-journey-work-card/user-journey-work-card.stories.d.ts.map +1 -1
- package/lib/typescript/module/src/styles/global/theme-provider.d.ts +1 -0
- package/lib/typescript/module/src/styles/global/theme-provider.d.ts.map +1 -1
- package/lib/typescript/module/src/styles/theme/theme.d.ts +1 -0
- package/lib/typescript/module/src/styles/theme/theme.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/common/icons-svg/constants/index.ts +1 -0
- package/src/common/icons-svg/download/index.tsx +52 -0
- package/src/common/icons-svg/index.tsx +4 -0
- package/src/components/activities-progress/index.tsx +172 -172
- package/src/components/card-report/interface.d.ts +1 -1
- package/src/components/card-work-session/index.tsx +190 -172
- package/src/components/card-work-session/interface.d.ts +151 -150
- package/src/components/inputs/input-date-time/index.tsx +13 -12
- package/src/components/inputs/input-date-time/styles.ts +64 -63
- package/src/components/modals/{modal-journey-rectification → modal-edite-journey-rectification}/index.tsx +78 -67
- package/src/components/modals/{modal-journey-rectification → modal-edite-journey-rectification}/interface.d.ts +10 -10
- package/src/components/monthly-summary-table/interface.d.ts +1 -1
- package/src/components/notification-card/index.tsx +123 -0
- package/src/components/notification-card/interface.ts +18 -0
- package/src/components/notification-details-card/index.tsx +180 -0
- package/src/components/notification-details-card/interface.ts +16 -0
- package/src/components/travel-history/interface.d.ts +1 -1
- package/src/components/user-journey-work-card/index.tsx +28 -1
- package/src/components/user-journey-work-card/interface.d.ts +149 -145
- package/src/index.tsx +3 -1
- package/src/stories/button/button.stories.tsx +1 -1
- package/src/stories/capture-photo/capture-photo.stories.tsx +1 -1
- package/src/stories/card-work-session/card-work-session.stories.tsx +106 -53
- package/src/stories/modal-journey-rectification/modal-journey-rectification.stories.tsx +60 -60
- package/src/stories/notification-card/notification-card.stories.tsx +93 -0
- package/src/stories/notification-details-card/notification-details-card.stories.tsx +109 -0
- package/src/stories/user-journey-work-card/user-journey-work-card.stories.tsx +71 -63
- package/src/styles/theme/theme.ts +1 -0
- package/lib/commonjs/components/modals/modal-journey-rectification/index.js.map +0 -1
- package/lib/commonjs/components/modals/modal-journey-rectification/interface.d.js.map +0 -1
- package/lib/module/components/modals/modal-journey-rectification/index.js.map +0 -1
- package/lib/module/components/modals/modal-journey-rectification/interface.d.js.map +0 -1
- package/lib/typescript/commonjs/src/components/modals/modal-journey-rectification/index.d.ts.map +0 -1
- package/lib/typescript/module/src/components/modals/modal-journey-rectification/index.d.ts.map +0 -1
- /package/lib/commonjs/components/modals/{modal-journey-rectification → modal-edite-journey-rectification}/interface.d.js +0 -0
- /package/lib/module/components/modals/{modal-journey-rectification → modal-edite-journey-rectification}/interface.d.js +0 -0
|
@@ -10,6 +10,7 @@ import Typography from "../../typography";
|
|
|
10
10
|
import Button from "../../button";
|
|
11
11
|
import SelectOption from "../../selects/select-option";
|
|
12
12
|
import InputDateTime from "../../inputs/input-date-time";
|
|
13
|
+
import MaintenanceDescriptionInput from "../../maintenance-description-input";
|
|
13
14
|
|
|
14
15
|
// commons / svg
|
|
15
16
|
import { Icons } from "../../../common/icons-svg";
|
|
@@ -22,44 +23,53 @@ import { asBaseComponent } from "../../../@types/as-base-component";
|
|
|
22
23
|
import { theme } from "../../../styles/theme/theme";
|
|
23
24
|
|
|
24
25
|
const options = [
|
|
25
|
-
{ label: "Disp com veículo parado", value: "
|
|
26
|
-
{ label: "Operação com veículo", value: "
|
|
27
|
-
{ label: "Em carga", value: "
|
|
28
|
-
{ label: "Em descarga", value: "
|
|
26
|
+
{ label: "Disp com veículo parado", value: "8" },
|
|
27
|
+
{ label: "Operação com veículo", value: "1" },
|
|
28
|
+
{ label: "Em carga", value: "2" },
|
|
29
|
+
{ label: "Em descarga", value: "3" },
|
|
29
30
|
];
|
|
30
31
|
|
|
32
|
+
/**
|
|
33
|
+
* Componente modal para edição de atividade para interação do usuário.
|
|
34
|
+
*/
|
|
31
35
|
const ModalJourneyRectification: React.FC<IModalJourneyRectificationProps> = ({
|
|
32
36
|
visible,
|
|
33
37
|
onClose,
|
|
34
38
|
modalConfirm,
|
|
35
39
|
textTitle,
|
|
40
|
+
isLoading,
|
|
36
41
|
}) => {
|
|
37
|
-
const [isLoading] = React.useState(false);
|
|
38
|
-
|
|
39
|
-
// *** DEFAULTS: já começa com um motivo, data e hora atuais
|
|
40
42
|
const defaultReason = options[0]?.value ?? null;
|
|
41
|
-
const [selectedReason, setSelectedReason] = useState<string | null>(defaultReason); // ***
|
|
42
|
-
const [selectedDate, setSelectedDate] = useState<Date>(new Date()); // ***
|
|
43
|
-
const [selectedTime, setSelectedTime] = useState<Date>(new Date()); // ***
|
|
44
43
|
|
|
45
|
-
|
|
44
|
+
const [selectedReason, setSelectedReason] = useState<string | null>(defaultReason);
|
|
45
|
+
const [selectedDate, setSelectedDate] = useState<Date>(new Date());
|
|
46
|
+
const [selectedTime, setSelectedTime] = useState<Date>(new Date());
|
|
47
|
+
|
|
48
|
+
// motivo digitado pelo usuário
|
|
49
|
+
const [editReason, setEditReason] = useState<string>("");
|
|
50
|
+
const [errorReason, setErrorReason] = useState<string>("");
|
|
51
|
+
|
|
52
|
+
// helpers
|
|
46
53
|
const fmtDate = (d: Date) =>
|
|
47
54
|
`${String(d.getDate()).padStart(2, "0")}/${String(d.getMonth() + 1).padStart(2, "0")}/${d.getFullYear()}`;
|
|
48
|
-
|
|
49
55
|
const fmtTime = (d: Date) =>
|
|
50
56
|
`${String(d.getHours()).padStart(2, "0")}:${String(d.getMinutes()).padStart(2, "0")}`;
|
|
51
57
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
if (time) {
|
|
57
|
-
out.setHours(time.getHours());
|
|
58
|
-
out.setMinutes(time.getMinutes());
|
|
59
|
-
out.setSeconds(0);
|
|
60
|
-
out.setMilliseconds(0);
|
|
58
|
+
const handleConfirm = () => {
|
|
59
|
+
if (!editReason.trim()) {
|
|
60
|
+
setErrorReason("Informe o motivo da edição!");
|
|
61
|
+
return;
|
|
61
62
|
}
|
|
62
|
-
|
|
63
|
+
|
|
64
|
+
const payload = {
|
|
65
|
+
jr_tipo_atividade_id: selectedReason,
|
|
66
|
+
description: options.find((o) => o.value === selectedReason)?.label ?? null,
|
|
67
|
+
date_start: selectedDate ? fmtDate(selectedDate) : null,
|
|
68
|
+
hours_start: selectedTime ? fmtTime(selectedTime) : null,
|
|
69
|
+
edit_reason: editReason.trim(),
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
modalConfirm(payload);
|
|
63
73
|
};
|
|
64
74
|
|
|
65
75
|
return (
|
|
@@ -73,11 +83,9 @@ const ModalJourneyRectification: React.FC<IModalJourneyRectificationProps> = ({
|
|
|
73
83
|
}}
|
|
74
84
|
>
|
|
75
85
|
<Box
|
|
76
|
-
width=
|
|
86
|
+
width="90%"
|
|
77
87
|
backgroundColor={theme.colors.orange[500]}
|
|
78
|
-
borderStyled={{
|
|
79
|
-
borderRadius: theme.borderWidths.thick_medium,
|
|
80
|
-
}}
|
|
88
|
+
borderStyled={{ borderRadius: theme.borderWidths.thick_medium }}
|
|
81
89
|
paddingStyle={{
|
|
82
90
|
paddingLeft: theme.paddings["2xs"],
|
|
83
91
|
paddingRight: theme.paddings["2xs"],
|
|
@@ -85,6 +93,7 @@ const ModalJourneyRectification: React.FC<IModalJourneyRectificationProps> = ({
|
|
|
85
93
|
paddingBottom: theme.paddings.sm,
|
|
86
94
|
}}
|
|
87
95
|
>
|
|
96
|
+
{/* Header */}
|
|
88
97
|
<Box
|
|
89
98
|
marginStyle={{ marginBottom: 10, marginLeft: 4 }}
|
|
90
99
|
flexStyle={{ flexDirection: "row", alignItems: "center" }}
|
|
@@ -96,28 +105,28 @@ const ModalJourneyRectification: React.FC<IModalJourneyRectificationProps> = ({
|
|
|
96
105
|
size={22}
|
|
97
106
|
/>
|
|
98
107
|
<Typography
|
|
99
|
-
text={
|
|
108
|
+
text={textTitle ?? "Editar atividade"}
|
|
100
109
|
color={theme.colors.neutral[25]}
|
|
101
110
|
marginLeft={theme.margins["2xs"]}
|
|
102
|
-
fontFamily={theme.fonts.
|
|
111
|
+
fontFamily={theme.fonts.inter_bold}
|
|
112
|
+
fontWeight="700"
|
|
103
113
|
size={theme.fontSizes.lg}
|
|
104
114
|
/>
|
|
105
115
|
</Box>
|
|
106
116
|
|
|
117
|
+
{/* Content */}
|
|
107
118
|
<Box
|
|
108
119
|
backgroundColor={theme.colors.neutral[300]}
|
|
109
|
-
paddingStyle={{
|
|
110
|
-
|
|
111
|
-
}}
|
|
112
|
-
borderStyled={{
|
|
113
|
-
borderRadius: theme.borderWidths.thick_medium,
|
|
114
|
-
}}
|
|
120
|
+
paddingStyle={{ padding: theme.paddings.xs }}
|
|
121
|
+
borderStyled={{ borderRadius: theme.borderWidths.thick_medium }}
|
|
115
122
|
>
|
|
116
123
|
<Typography
|
|
117
|
-
text=
|
|
118
|
-
color={theme.colors.black[
|
|
124
|
+
text="Confirme as alterações antes de salvar."
|
|
125
|
+
color={theme.colors.black[100]}
|
|
119
126
|
fontFamily={theme.fonts.inter_regular_400}
|
|
120
|
-
|
|
127
|
+
fontWeight="400"
|
|
128
|
+
lineHeight={theme.lineHeight["2xl"]}
|
|
129
|
+
size={theme.fontSizes.sm}
|
|
121
130
|
marginBottom={16}
|
|
122
131
|
/>
|
|
123
132
|
|
|
@@ -125,17 +134,15 @@ const ModalJourneyRectification: React.FC<IModalJourneyRectificationProps> = ({
|
|
|
125
134
|
titleLabel="Selecione atividade"
|
|
126
135
|
sizeTitleLabel={18}
|
|
127
136
|
dataOption={options}
|
|
128
|
-
|
|
129
|
-
handleSelectDown={(value) => setSelectedReason(value)} // ***
|
|
137
|
+
handleSelectDown={(value) => setSelectedReason(value)}
|
|
130
138
|
backgroundColor={theme.colors.neutral[300]}
|
|
131
139
|
/>
|
|
132
140
|
|
|
133
141
|
<InputDateTime
|
|
134
142
|
mode="date"
|
|
135
143
|
titleLabel="Data"
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
onChange={(d) => setSelectedDate(d)} // ***
|
|
144
|
+
value={selectedDate}
|
|
145
|
+
onChange={(d) => setSelectedDate(d)}
|
|
139
146
|
backgroundColor="#f5f5f5"
|
|
140
147
|
colortitleLabel="#333"
|
|
141
148
|
/>
|
|
@@ -143,13 +150,27 @@ const ModalJourneyRectification: React.FC<IModalJourneyRectificationProps> = ({
|
|
|
143
150
|
<InputDateTime
|
|
144
151
|
mode="time"
|
|
145
152
|
titleLabel="Horário"
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
onChange={(d) => setSelectedTime(d)} // ***
|
|
153
|
+
value={selectedTime}
|
|
154
|
+
onChange={(d) => setSelectedTime(d)}
|
|
149
155
|
backgroundColor="#f5f5f5"
|
|
150
156
|
colortitleLabel="#333"
|
|
151
157
|
/>
|
|
152
158
|
|
|
159
|
+
<Box width="100%">
|
|
160
|
+
<MaintenanceDescriptionInput
|
|
161
|
+
label="Motivo da edição"
|
|
162
|
+
placeholderTextColor={theme.colors.gray[700]}
|
|
163
|
+
placeholder="Informe o motivo da edição"
|
|
164
|
+
value={editReason}
|
|
165
|
+
onChangeText={(text) => {
|
|
166
|
+
setEditReason(text);
|
|
167
|
+
if (text.trim()) setErrorReason("");
|
|
168
|
+
}}
|
|
169
|
+
error={errorReason}
|
|
170
|
+
/>
|
|
171
|
+
</Box>
|
|
172
|
+
|
|
173
|
+
{/* Actions */}
|
|
153
174
|
<Box
|
|
154
175
|
marginStyle={{ marginTop: 4 }}
|
|
155
176
|
flexStyle={{
|
|
@@ -160,14 +181,14 @@ const ModalJourneyRectification: React.FC<IModalJourneyRectificationProps> = ({
|
|
|
160
181
|
<Button
|
|
161
182
|
title="CANCELAR"
|
|
162
183
|
onPress={onClose}
|
|
163
|
-
width=
|
|
184
|
+
width="48%"
|
|
164
185
|
height={40}
|
|
165
|
-
isLoading={isLoading}
|
|
186
|
+
isLoading={isLoading!}
|
|
166
187
|
disabled={isLoading}
|
|
167
188
|
backgroundColor={theme.colors.neutral[300]}
|
|
168
189
|
buttonTextStyle={{
|
|
169
|
-
color: theme.colors.blue[
|
|
170
|
-
fontFamily:
|
|
190
|
+
color: theme.colors.blue[500],
|
|
191
|
+
fontFamily: theme.fonts.inter_medium_500,
|
|
171
192
|
fontSize: theme.fontSizes.xs,
|
|
172
193
|
fontWeight: "500",
|
|
173
194
|
}}
|
|
@@ -185,29 +206,16 @@ const ModalJourneyRectification: React.FC<IModalJourneyRectificationProps> = ({
|
|
|
185
206
|
/>
|
|
186
207
|
|
|
187
208
|
<Button
|
|
188
|
-
title="
|
|
189
|
-
onPress={
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
const payload = {
|
|
193
|
-
reasonValue: selectedReason,
|
|
194
|
-
reasonLabel: options.find((o) => o.value === selectedReason)?.label ?? null,
|
|
195
|
-
date: selectedDate ? fmtDate(selectedDate) : null,
|
|
196
|
-
time: selectedTime ? fmtTime(selectedTime) : null,
|
|
197
|
-
dateTimeISO: merged ? merged.toISOString() : null,
|
|
198
|
-
};
|
|
199
|
-
|
|
200
|
-
modalConfirm(payload);
|
|
201
|
-
onClose();
|
|
202
|
-
}}
|
|
203
|
-
width={"48%"}
|
|
209
|
+
title="ALTERAR"
|
|
210
|
+
onPress={handleConfirm}
|
|
211
|
+
width="48%"
|
|
204
212
|
height={40}
|
|
205
|
-
isLoading={isLoading}
|
|
213
|
+
isLoading={isLoading!}
|
|
206
214
|
disabled={isLoading}
|
|
207
215
|
backgroundColor={theme.colors.blue[500]}
|
|
208
216
|
buttonTextStyle={{
|
|
209
217
|
color: theme.colors.neutral[25],
|
|
210
|
-
fontFamily:
|
|
218
|
+
fontFamily: theme.fonts.inter_medium_500,
|
|
211
219
|
fontSize: theme.fontSizes.xs,
|
|
212
220
|
fontWeight: "500",
|
|
213
221
|
}}
|
|
@@ -233,4 +241,7 @@ const ModalJourneyRectification: React.FC<IModalJourneyRectificationProps> = ({
|
|
|
233
241
|
|
|
234
242
|
ModalJourneyRectification.displayName = "ModalJourneyRectification";
|
|
235
243
|
|
|
244
|
+
/**
|
|
245
|
+
* EXPORTS
|
|
246
|
+
*/
|
|
236
247
|
export default asBaseComponent(ModalJourneyRectification);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/* eslint-disable no-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export type { IModalJourneyRectificationProps };
|
|
1
|
+
/* eslint-disable no-unused-vars */
|
|
2
|
+
interface IModalJourneyRectificationProps {
|
|
3
|
+
visible: boolean;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
modalConfirm: (value: T) => void;
|
|
6
|
+
textTitle?: string;
|
|
7
|
+
isLoading?: boolean;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type { IModalJourneyRectificationProps };
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
import React, { forwardRef } from "react";
|
|
5
|
+
import { TouchableOpacity, View } from "react-native";
|
|
6
|
+
|
|
7
|
+
// commons / icons
|
|
8
|
+
import { Icons } from "../../common/icons-svg";
|
|
9
|
+
|
|
10
|
+
// components
|
|
11
|
+
import Box from "../box";
|
|
12
|
+
import Typography from "../typography";
|
|
13
|
+
import Button from "../button";
|
|
14
|
+
|
|
15
|
+
// styles / theme
|
|
16
|
+
import { theme } from "../../styles/theme/theme";
|
|
17
|
+
|
|
18
|
+
// typings
|
|
19
|
+
import { asBaseComponent } from "../../@types/as-base-component";
|
|
20
|
+
import type { INotificationCardProps } from "./interface";
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Componente NotificationCard
|
|
24
|
+
*/
|
|
25
|
+
const NotificationCard: React.FC<INotificationCardProps> = forwardRef<View, INotificationCardProps>(
|
|
26
|
+
({ variant = "read", title, description, actionLabel, onPress, onPressAction, testID }, ref) => {
|
|
27
|
+
const isWarning = variant === "unread";
|
|
28
|
+
|
|
29
|
+
// cor da borda lateral
|
|
30
|
+
const borderColor = isWarning ? theme.colors.orange[150] : theme.colors.blue[525];
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<TouchableOpacity onPress={onPress} activeOpacity={0.7}>
|
|
34
|
+
<Box
|
|
35
|
+
ref={ref}
|
|
36
|
+
testID={testID ?? "notification-card"}
|
|
37
|
+
flexStyle={{ flexDirection: "row" }}
|
|
38
|
+
borderStyled={{
|
|
39
|
+
borderWidth: 1,
|
|
40
|
+
borderColor: isWarning ? theme.colors.orange[150] : theme.colors.neutral[200],
|
|
41
|
+
borderRadius: theme.borderWidths.thick_medium,
|
|
42
|
+
}}
|
|
43
|
+
marginStyle={{ marginBottom: 12 }}
|
|
44
|
+
backgroundColor={isWarning ? theme.colors.neutral[500] : theme.colors.neutral[25]}
|
|
45
|
+
>
|
|
46
|
+
{/* borda fixa lateral esquerda */}
|
|
47
|
+
<Box
|
|
48
|
+
width={8}
|
|
49
|
+
backgroundColor={borderColor}
|
|
50
|
+
borderStyled={{
|
|
51
|
+
borderTopLeftRadius: theme.borderWidths.thick_medium,
|
|
52
|
+
borderBottomLeftRadius: theme.borderWidths.thick_medium,
|
|
53
|
+
}}
|
|
54
|
+
/>
|
|
55
|
+
|
|
56
|
+
{/* Conteúdo do card */}
|
|
57
|
+
<Box flexStyle={{ flex: 1 }} paddingStyle={{ padding: theme.paddings.sm }}>
|
|
58
|
+
{/* Header */}
|
|
59
|
+
<Box
|
|
60
|
+
flexStyle={{ flexDirection: "row", alignItems: "center" }}
|
|
61
|
+
marginStyle={{ marginBottom: 6 }}
|
|
62
|
+
>
|
|
63
|
+
<Icons icon="BELL" color={borderColor} size={20} />
|
|
64
|
+
<Typography
|
|
65
|
+
text={title}
|
|
66
|
+
fontFamily={theme.fonts.inter_bold}
|
|
67
|
+
fontWeight="700"
|
|
68
|
+
size={theme.fontSizes.md}
|
|
69
|
+
color={theme.colors.black[100]}
|
|
70
|
+
marginLeft={8}
|
|
71
|
+
/>
|
|
72
|
+
</Box>
|
|
73
|
+
|
|
74
|
+
{/* Texto */}
|
|
75
|
+
<Typography
|
|
76
|
+
text={description}
|
|
77
|
+
numberOfLines={isWarning ? 2 : 4}
|
|
78
|
+
ellipsizeMode="tail"
|
|
79
|
+
size={theme.fontSizes.sm}
|
|
80
|
+
lineHeight={theme.lineHeight.md}
|
|
81
|
+
fontFamily={theme.fonts.inter_regular_400}
|
|
82
|
+
color={theme.colors.gray[700]}
|
|
83
|
+
marginBottom={isWarning && actionLabel ? 12 : 0}
|
|
84
|
+
/>
|
|
85
|
+
|
|
86
|
+
{/* Ação opcional */}
|
|
87
|
+
{actionLabel && onPressAction && (
|
|
88
|
+
<Button
|
|
89
|
+
isLoading={false}
|
|
90
|
+
title={actionLabel}
|
|
91
|
+
onPress={onPressAction}
|
|
92
|
+
backgroundColor={theme.colors.neutral[25]}
|
|
93
|
+
borderStyled={{
|
|
94
|
+
borderWidth: 1,
|
|
95
|
+
borderColor: theme.colors.red[500],
|
|
96
|
+
borderRadius: 12,
|
|
97
|
+
}}
|
|
98
|
+
buttonTextStyle={{
|
|
99
|
+
color: theme.colors.red[500],
|
|
100
|
+
fontSize: theme.fontSizes.sm,
|
|
101
|
+
fontFamily: theme.fonts.inter_medium_500,
|
|
102
|
+
}}
|
|
103
|
+
flexStyle={{
|
|
104
|
+
flexDirection: "row",
|
|
105
|
+
alignItems: "center",
|
|
106
|
+
justifyContent: "center",
|
|
107
|
+
}}
|
|
108
|
+
style={{ alignSelf: "flex-start", paddingHorizontal: 12 }}
|
|
109
|
+
/>
|
|
110
|
+
)}
|
|
111
|
+
</Box>
|
|
112
|
+
</Box>
|
|
113
|
+
</TouchableOpacity>
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
);
|
|
117
|
+
|
|
118
|
+
NotificationCard.displayName = "NotificationCard";
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* EXPORTS
|
|
122
|
+
*/
|
|
123
|
+
export default asBaseComponent(NotificationCard);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
interface INotificationCardProps {
|
|
6
|
+
variant?: "read" | "unread";
|
|
7
|
+
title: string;
|
|
8
|
+
description: string;
|
|
9
|
+
actionLabel?: string;
|
|
10
|
+
onPress?: () => void;
|
|
11
|
+
onPressAction?: () => void;
|
|
12
|
+
testID?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* EXPORTS
|
|
17
|
+
*/
|
|
18
|
+
export { type INotificationCardProps };
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
import React, { forwardRef, useState } from "react";
|
|
5
|
+
import { Modal, TouchableOpacity, Image, View } from "react-native";
|
|
6
|
+
|
|
7
|
+
// commons / icons
|
|
8
|
+
import { Icons } from "../../common/icons-svg";
|
|
9
|
+
|
|
10
|
+
// components
|
|
11
|
+
import Box from "../box";
|
|
12
|
+
import Typography from "../typography";
|
|
13
|
+
|
|
14
|
+
// typings
|
|
15
|
+
import type { INotificationDetailCardProps } from "./interface";
|
|
16
|
+
import { asBaseComponent } from "../../@types/as-base-component";
|
|
17
|
+
|
|
18
|
+
// styles / theme
|
|
19
|
+
import { theme } from "../../styles/theme/theme";
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Componente NotificationDetailCard
|
|
23
|
+
*/
|
|
24
|
+
const NotificationDetailCard: React.FC<INotificationDetailCardProps> = forwardRef<
|
|
25
|
+
View,
|
|
26
|
+
INotificationDetailCardProps
|
|
27
|
+
>(({ title, description, fileUrl, fileType = "image", testID }, ref) => {
|
|
28
|
+
const [visible, setVisible] = useState(false);
|
|
29
|
+
|
|
30
|
+
function openFile() {
|
|
31
|
+
if (fileType === "image") {
|
|
32
|
+
setVisible(true);
|
|
33
|
+
} else if (fileUrl) {
|
|
34
|
+
import("react-native").then(({ Linking }) => {
|
|
35
|
+
Linking.openURL(fileUrl).catch((err) => console.warn("Erro ao abrir arquivo:", err));
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const borderColor = theme.colors.blue[500];
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<Box
|
|
44
|
+
ref={ref}
|
|
45
|
+
testID={testID ?? "notification-detail-card"}
|
|
46
|
+
flexStyle={{ flexDirection: "row" }}
|
|
47
|
+
borderStyled={{
|
|
48
|
+
borderWidth: 1,
|
|
49
|
+
borderColor: theme.colors.neutral[200],
|
|
50
|
+
borderRadius: theme.borderWidths.thick_medium,
|
|
51
|
+
}}
|
|
52
|
+
marginStyle={{ marginBottom: 16 }}
|
|
53
|
+
backgroundColor={theme.colors.neutral[25]}
|
|
54
|
+
>
|
|
55
|
+
{/* borda fixa lateral esquerda */}
|
|
56
|
+
<Box
|
|
57
|
+
width={8}
|
|
58
|
+
backgroundColor={borderColor}
|
|
59
|
+
borderStyled={{
|
|
60
|
+
borderTopLeftRadius: theme.borderWidths.thick_medium,
|
|
61
|
+
borderBottomLeftRadius: theme.borderWidths.thick_medium,
|
|
62
|
+
}}
|
|
63
|
+
/>
|
|
64
|
+
|
|
65
|
+
{/* Conteúdo do card */}
|
|
66
|
+
<Box flexStyle={{ flex: 1 }} paddingStyle={{ padding: theme.paddings.md }}>
|
|
67
|
+
{/* header */}
|
|
68
|
+
<Typography
|
|
69
|
+
text={title}
|
|
70
|
+
fontFamily={theme.fonts.inter_bold}
|
|
71
|
+
fontWeight="700"
|
|
72
|
+
size={theme.fontSizes.md}
|
|
73
|
+
color={theme.colors.black[100]}
|
|
74
|
+
marginBottom={8}
|
|
75
|
+
/>
|
|
76
|
+
|
|
77
|
+
{/* texto */}
|
|
78
|
+
<Typography
|
|
79
|
+
text={description}
|
|
80
|
+
size={theme.fontSizes.sm}
|
|
81
|
+
lineHeight={theme.lineHeight.md}
|
|
82
|
+
color={theme.colors.gray[700]}
|
|
83
|
+
marginBottom={fileUrl ? 12 : 0}
|
|
84
|
+
/>
|
|
85
|
+
|
|
86
|
+
{/* arquivo (se existir) */}
|
|
87
|
+
{fileUrl && (
|
|
88
|
+
<TouchableOpacity
|
|
89
|
+
testID="button"
|
|
90
|
+
onPress={openFile}
|
|
91
|
+
activeOpacity={0.8}
|
|
92
|
+
style={{
|
|
93
|
+
borderRadius: theme.borderWidths.thick_medium,
|
|
94
|
+
overflow: "hidden",
|
|
95
|
+
borderWidth: 1,
|
|
96
|
+
borderColor: theme.colors.gray[300],
|
|
97
|
+
}}
|
|
98
|
+
>
|
|
99
|
+
{fileType === "image" ? (
|
|
100
|
+
<Box
|
|
101
|
+
borderStyled={{
|
|
102
|
+
borderWidth: 2,
|
|
103
|
+
borderColor: theme.colors.blue[525],
|
|
104
|
+
borderRadius: theme.borderWidths.thick_medium,
|
|
105
|
+
}}
|
|
106
|
+
>
|
|
107
|
+
<Image
|
|
108
|
+
source={{ uri: fileUrl }}
|
|
109
|
+
style={{
|
|
110
|
+
width: "100%",
|
|
111
|
+
height: 180,
|
|
112
|
+
borderRadius: theme.borderWidths.thick_medium,
|
|
113
|
+
borderWidth: 2,
|
|
114
|
+
borderColor: theme.colors.blue[525],
|
|
115
|
+
}}
|
|
116
|
+
resizeMode="cover"
|
|
117
|
+
/>
|
|
118
|
+
</Box>
|
|
119
|
+
) : (
|
|
120
|
+
<Box
|
|
121
|
+
flexStyle={{
|
|
122
|
+
flexDirection: "row",
|
|
123
|
+
alignItems: "center",
|
|
124
|
+
justifyContent: "space-between",
|
|
125
|
+
}}
|
|
126
|
+
paddingStyle={{ padding: theme.paddings.sm }}
|
|
127
|
+
>
|
|
128
|
+
<Typography
|
|
129
|
+
text={`Abrir arquivo (${fileType.toUpperCase()})`}
|
|
130
|
+
fontFamily={theme.fonts.inter_medium_500}
|
|
131
|
+
color={theme.colors.blue[500]}
|
|
132
|
+
size={theme.fontSizes.md}
|
|
133
|
+
/>
|
|
134
|
+
<Icons icon="FILES" size={20} color={theme.colors.blue[500]} />
|
|
135
|
+
</Box>
|
|
136
|
+
)}
|
|
137
|
+
</TouchableOpacity>
|
|
138
|
+
)}
|
|
139
|
+
</Box>
|
|
140
|
+
|
|
141
|
+
{/* modal para zoom da imagem */}
|
|
142
|
+
{fileType === "image" && (
|
|
143
|
+
<Modal visible={visible} transparent animationType="fade">
|
|
144
|
+
<View
|
|
145
|
+
style={{
|
|
146
|
+
flex: 1,
|
|
147
|
+
backgroundColor: "rgba(0,0,0,0.9)",
|
|
148
|
+
justifyContent: "center",
|
|
149
|
+
alignItems: "center",
|
|
150
|
+
}}
|
|
151
|
+
>
|
|
152
|
+
<TouchableOpacity
|
|
153
|
+
onPress={() => setVisible(false)}
|
|
154
|
+
style={{ position: "absolute", top: 40, right: 20 }}
|
|
155
|
+
>
|
|
156
|
+
<Icons icon="CLOSED" size={28} color={theme.colors.neutral[25]} />
|
|
157
|
+
</TouchableOpacity>
|
|
158
|
+
|
|
159
|
+
<Image
|
|
160
|
+
source={{ uri: fileUrl }}
|
|
161
|
+
style={{
|
|
162
|
+
width: "90%",
|
|
163
|
+
height: "70%",
|
|
164
|
+
borderRadius: theme.borderWidths.thick_medium,
|
|
165
|
+
}}
|
|
166
|
+
resizeMode="contain"
|
|
167
|
+
/>
|
|
168
|
+
</View>
|
|
169
|
+
</Modal>
|
|
170
|
+
)}
|
|
171
|
+
</Box>
|
|
172
|
+
);
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
NotificationDetailCard.displayName = "NotificationDetailCard";
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* EXPORTS
|
|
179
|
+
*/
|
|
180
|
+
export default asBaseComponent(NotificationDetailCard);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
interface INotificationDetailCardProps {
|
|
6
|
+
title: string;
|
|
7
|
+
description: string;
|
|
8
|
+
fileUrl?: string; // link para arquivo (png, pdf, csv, etc.)
|
|
9
|
+
fileType?: "image" | "pdf" | "csv" | "other";
|
|
10
|
+
testID?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* EXPORTS
|
|
15
|
+
*/
|
|
16
|
+
export { type INotificationDetailCardProps };
|
|
@@ -27,9 +27,11 @@ const UserJourneyWorkCard = forwardRef<any, IUserJourneyWorkCard>(
|
|
|
27
27
|
initialTime = "00:40",
|
|
28
28
|
duration = "00:00",
|
|
29
29
|
avatar = "",
|
|
30
|
+
counterBadge = 0,
|
|
30
31
|
backgroundColor,
|
|
31
32
|
width,
|
|
32
33
|
handleNavigation,
|
|
34
|
+
handleNavigationNotification,
|
|
33
35
|
} = props;
|
|
34
36
|
return (
|
|
35
37
|
<Box
|
|
@@ -125,7 +127,32 @@ const UserJourneyWorkCard = forwardRef<any, IUserJourneyWorkCard>(
|
|
|
125
127
|
</Box>
|
|
126
128
|
</Box>
|
|
127
129
|
|
|
128
|
-
<
|
|
130
|
+
<TouchableOpacity activeOpacity={0.7} onPress={handleNavigationNotification}>
|
|
131
|
+
{counterBadge > 0 && (
|
|
132
|
+
<Box
|
|
133
|
+
backgroundColor={theme.colors.red[500]}
|
|
134
|
+
flexStyle={{ alignItems: "center", justifyContent: "center" }}
|
|
135
|
+
borderStyled={{ borderRadius: theme.borderWidths.hairline }}
|
|
136
|
+
style={[
|
|
137
|
+
counterBadge < 10
|
|
138
|
+
? { right: -5, top: -2, height: 16, width: 16 }
|
|
139
|
+
: { right: -8, top: -5, padding: 2 },
|
|
140
|
+
{ position: "absolute", zIndex: 10 },
|
|
141
|
+
]}
|
|
142
|
+
>
|
|
143
|
+
<Typography
|
|
144
|
+
text={`${counterBadge}`}
|
|
145
|
+
align={"center"}
|
|
146
|
+
size={theme.fontSizes["2xs"]}
|
|
147
|
+
color={theme.colors.neutral[25]}
|
|
148
|
+
fontFamily={theme.fonts.inter_bold_700}
|
|
149
|
+
lineHeight={theme.fontSizes.sm}
|
|
150
|
+
letterSpacing={"regular"}
|
|
151
|
+
/>
|
|
152
|
+
</Box>
|
|
153
|
+
)}
|
|
154
|
+
<Icons icon={"BELL"} size={28} style={{ position: "relative" }} />
|
|
155
|
+
</TouchableOpacity>
|
|
129
156
|
</Box>
|
|
130
157
|
|
|
131
158
|
<Box
|