@stack-spot/portal-components 2.25.0 → 2.25.1
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/CHANGELOG.md +7 -0
- package/dist/components/InfoMaintenanceBanner.d.ts +2 -3
- package/dist/components/InfoMaintenanceBanner.d.ts.map +1 -1
- package/dist/components/InfoMaintenanceBanner.js +12 -5
- package/dist/components/InfoMaintenanceBanner.js.map +1 -1
- package/package.json +1 -1
- package/src/components/InfoMaintenanceBanner.tsx +13 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.25.1](https://github.com/stack-spot/portal-commons/compare/portal-components@v2.25.0...portal-components@v2.25.1) (2025-08-14)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* maintenance banner ([#1406](https://github.com/stack-spot/portal-commons/issues/1406)) ([41c5258](https://github.com/stack-spot/portal-commons/commit/41c52588c7ab4377da31e79cf4e31b17b7b714c0))
|
|
9
|
+
|
|
3
10
|
## [2.25.0](https://github.com/stack-spot/portal-commons/compare/portal-components@v2.24.3...portal-components@v2.25.0) (2025-08-14)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
interface InfoMaintenanceBannerProps {
|
|
2
|
-
date:
|
|
3
|
-
year: string;
|
|
2
|
+
date: Date;
|
|
4
3
|
initialHour: string;
|
|
5
4
|
endHour: string;
|
|
6
5
|
}
|
|
7
|
-
export declare const InfoMaintenanceBanner: ({ date,
|
|
6
|
+
export declare const InfoMaintenanceBanner: ({ date, initialHour, endHour }: InfoMaintenanceBannerProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
7
|
export {};
|
|
9
8
|
//# sourceMappingURL=InfoMaintenanceBanner.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InfoMaintenanceBanner.d.ts","sourceRoot":"","sources":["../../src/components/InfoMaintenanceBanner.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"InfoMaintenanceBanner.d.ts","sourceRoot":"","sources":["../../src/components/InfoMaintenanceBanner.tsx"],"names":[],"mappings":"AAKA,UAAU,0BAA0B;IAClC,IAAI,EAAE,IAAI,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,qBAAqB,GAAI,gCAAgC,0BAA0B,4CAQ/F,CAAA"}
|
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Text } from '@citric/core';
|
|
3
|
-
import { interpolate, useTranslate } from '@stack-spot/portal-translate';
|
|
4
|
-
|
|
3
|
+
import { interpolate, useLanguage, useTranslate } from '@stack-spot/portal-translate';
|
|
4
|
+
import { format } from 'date-fns';
|
|
5
|
+
import { enUS, ptBR } from 'date-fns/locale';
|
|
6
|
+
export const InfoMaintenanceBanner = ({ date, initialHour, endHour }) => {
|
|
5
7
|
const t = useTranslate(dictionary);
|
|
6
|
-
|
|
8
|
+
const language = useLanguage();
|
|
9
|
+
const locale = language === 'pt' ? ptBR : enUS;
|
|
10
|
+
const dateToString = language === 'en' ?
|
|
11
|
+
format(date, "MMMM do',' yyyy", { locale }) :
|
|
12
|
+
format(date, "dd 'de' MMMM 'de' yyyy", { locale });
|
|
13
|
+
return _jsx(Text, { children: interpolate(t.info, dateToString, initialHour, endHour) });
|
|
7
14
|
};
|
|
8
15
|
const dictionary = {
|
|
9
16
|
en: {
|
|
10
|
-
info: 'We would like to inform you that StackSpot will undergo maintenance on $0,
|
|
17
|
+
info: 'We would like to inform you that StackSpot will undergo maintenance on $0, from $1 (GMT-3) to $2. During this period, this web portal will be temporarily unavailable.',
|
|
11
18
|
},
|
|
12
19
|
pt: {
|
|
13
|
-
info: 'Gostaríamos de informar que a StackSpot passará por manutenção no dia $0
|
|
20
|
+
info: 'Gostaríamos de informar que a StackSpot passará por manutenção no dia $0, das $1 (GMT-3) às $2. Durante este período, este portal web estará temporariamente indisponível.',
|
|
14
21
|
},
|
|
15
22
|
};
|
|
16
23
|
//# sourceMappingURL=InfoMaintenanceBanner.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InfoMaintenanceBanner.js","sourceRoot":"","sources":["../../src/components/InfoMaintenanceBanner.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;
|
|
1
|
+
{"version":3,"file":"InfoMaintenanceBanner.js","sourceRoot":"","sources":["../../src/components/InfoMaintenanceBanner.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AACrF,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAQ5C,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAA8B,EAAE,EAAE;IAClG,MAAM,CAAC,GAAG,YAAY,CAAC,UAAU,CAAC,CAAA;IAClC,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAA;IAC9B,MAAM,MAAM,GAAG,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAA;IAC9C,MAAM,YAAY,GAAG,QAAQ,KAAK,IAAI,CAAC,CAAC;QACtC,MAAM,CAAC,IAAI,EAAE,iBAAiB,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;QAC7C,MAAM,CAAC,IAAI,EAAE,wBAAwB,EAAE,EAAE,MAAM,EAAE,CAAC,CAAA;IACpD,OAAO,KAAC,IAAI,cAAE,WAAW,CAAC,CAAC,CAAC,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,OAAO,CAAC,GAAQ,CAAA;AAC/E,CAAC,CAAA;AAED,MAAM,UAAU,GAAG;IACjB,EAAE,EAAE;QACF,IAAI,EAAE,wKAAwK;KAC/K;IACD,EAAE,EAAE;QACF,IAAI,EAAE,4KAA4K;KACnL;CACF,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,23 +1,29 @@
|
|
|
1
1
|
import { Text } from '@citric/core'
|
|
2
|
-
import { interpolate, useTranslate } from '@stack-spot/portal-translate'
|
|
2
|
+
import { interpolate, useLanguage, useTranslate } from '@stack-spot/portal-translate'
|
|
3
|
+
import { format } from 'date-fns'
|
|
4
|
+
import { enUS, ptBR } from 'date-fns/locale'
|
|
3
5
|
|
|
4
6
|
interface InfoMaintenanceBannerProps {
|
|
5
|
-
date:
|
|
6
|
-
year: string,
|
|
7
|
+
date: Date,
|
|
7
8
|
initialHour: string,
|
|
8
9
|
endHour: string,
|
|
9
10
|
}
|
|
10
11
|
|
|
11
|
-
export const InfoMaintenanceBanner = ({ date,
|
|
12
|
+
export const InfoMaintenanceBanner = ({ date, initialHour, endHour }: InfoMaintenanceBannerProps) => {
|
|
12
13
|
const t = useTranslate(dictionary)
|
|
13
|
-
|
|
14
|
+
const language = useLanguage()
|
|
15
|
+
const locale = language === 'pt' ? ptBR : enUS
|
|
16
|
+
const dateToString = language === 'en' ?
|
|
17
|
+
format(date, "MMMM do',' yyyy", { locale }) :
|
|
18
|
+
format(date, "dd 'de' MMMM 'de' yyyy", { locale })
|
|
19
|
+
return <Text>{interpolate(t.info, dateToString, initialHour, endHour)}</Text>
|
|
14
20
|
}
|
|
15
21
|
|
|
16
22
|
const dictionary = {
|
|
17
23
|
en: {
|
|
18
|
-
info: 'We would like to inform you that StackSpot will undergo maintenance on $0,
|
|
24
|
+
info: 'We would like to inform you that StackSpot will undergo maintenance on $0, from $1 (GMT-3) to $2. During this period, this web portal will be temporarily unavailable.',
|
|
19
25
|
},
|
|
20
26
|
pt: {
|
|
21
|
-
info: 'Gostaríamos de informar que a StackSpot passará por manutenção no dia $0
|
|
27
|
+
info: 'Gostaríamos de informar que a StackSpot passará por manutenção no dia $0, das $1 (GMT-3) às $2. Durante este período, este portal web estará temporariamente indisponível.',
|
|
22
28
|
},
|
|
23
29
|
}
|