@redocly/theme 0.25.1-beta.4 → 0.25.2

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.
Files changed (92) hide show
  1. package/lib/components/Catalog/Catalog.js +1 -4
  2. package/lib/components/Catalog/useCatalog.js +3 -4
  3. package/lib/components/CodeBlock/CodeBlockControls.js +1 -1
  4. package/lib/components/CopyButton/CopyButton.js +2 -7
  5. package/lib/components/EditPageButton/EditPageButton.js +1 -4
  6. package/lib/components/Feedback/Comment.js +4 -10
  7. package/lib/components/Feedback/Feedback.js +1 -1
  8. package/lib/components/Feedback/Mood.js +15 -18
  9. package/lib/components/Feedback/Rating.js +12 -12
  10. package/lib/components/Feedback/Reasons.js +4 -9
  11. package/lib/components/Feedback/ReportDialog.js +16 -3
  12. package/lib/components/Feedback/Sentiment.js +13 -15
  13. package/lib/components/Feedback/Thumbs.js +2 -8
  14. package/lib/components/Feedback/types.d.ts +1 -1
  15. package/lib/components/Feedback/useReportDialog.js +6 -8
  16. package/lib/components/Filter/Filter.js +6 -6
  17. package/lib/components/Filter/FilterContent.js +2 -6
  18. package/lib/components/Filter/FilterPopover.js +2 -6
  19. package/lib/components/Footer/FooterCopyright.js +2 -5
  20. package/lib/components/LastUpdated/LastUpdated.js +1 -1
  21. package/lib/components/Menu/hooks/use-mobile-menu-items.js +1 -4
  22. package/lib/components/Menu/hooks/use-mobile-menu-levels.js +2 -6
  23. package/lib/components/Menu/utils.d.ts +2 -1
  24. package/lib/components/Profile/LoginLink.js +2 -5
  25. package/lib/components/Profile/MobileUserProfile.js +1 -4
  26. package/lib/components/Profile/UserProfile.js +3 -7
  27. package/lib/components/Scorecard/Card.d.ts +1 -3
  28. package/lib/components/Scorecard/Card.js +2 -4
  29. package/lib/components/Scorecard/Gauge.d.ts +2 -5
  30. package/lib/components/Scorecard/Gauge.js +2 -6
  31. package/lib/components/Scorecard/StatusByLevelWidget.d.ts +0 -1
  32. package/lib/components/Scorecard/StatusByLevelWidget.js +2 -5
  33. package/lib/components/Search/CancelSearch.js +1 -4
  34. package/lib/components/Search/RecentSearches.js +1 -4
  35. package/lib/components/Search/SearchDialog.js +4 -10
  36. package/lib/components/Search/SearchTrigger.js +1 -4
  37. package/lib/components/Search/SuggestedPages.js +1 -4
  38. package/lib/components/Sidebar/DrilldownMenu.js +2 -5
  39. package/lib/components/Sidebar/VersionPicker.js +2 -6
  40. package/lib/components/TableOfContent/TableOfContent.js +1 -4
  41. package/lib/config.d.ts +0 -6
  42. package/lib/config.js +0 -1
  43. package/lib/layouts/Forbidden.js +2 -6
  44. package/lib/layouts/NotFound.js +2 -6
  45. package/lib/layouts/OIDCForbidden.js +1 -4
  46. package/lib/mocks/hooks/index.d.ts +3 -2
  47. package/lib/mocks/hooks/index.js +3 -4
  48. package/lib/types/portal/src/shared/types/feedback.d.ts +1 -0
  49. package/package.json +2 -2
  50. package/src/components/Catalog/Catalog.tsx +1 -4
  51. package/src/components/Catalog/useCatalog.ts +3 -6
  52. package/src/components/CodeBlock/CodeBlockControls.tsx +0 -1
  53. package/src/components/CopyButton/CopyButton.tsx +3 -8
  54. package/src/components/EditPageButton/EditPageButton.tsx +2 -5
  55. package/src/components/Feedback/Comment.tsx +14 -14
  56. package/src/components/Feedback/Feedback.tsx +2 -2
  57. package/src/components/Feedback/Mood.tsx +25 -20
  58. package/src/components/Feedback/Rating.tsx +15 -14
  59. package/src/components/Feedback/Reasons.tsx +6 -11
  60. package/src/components/Feedback/ReportDialog.tsx +6 -2
  61. package/src/components/Feedback/Sentiment.tsx +15 -17
  62. package/src/components/Feedback/Thumbs.tsx +2 -9
  63. package/src/components/Feedback/types.ts +1 -1
  64. package/src/components/Feedback/useReportDialog.ts +6 -8
  65. package/src/components/Filter/Filter.tsx +9 -6
  66. package/src/components/Filter/FilterContent.tsx +2 -6
  67. package/src/components/Filter/FilterPopover.tsx +2 -6
  68. package/src/components/Footer/FooterCopyright.tsx +2 -5
  69. package/src/components/LastUpdated/LastUpdated.tsx +1 -1
  70. package/src/components/Menu/hooks/use-mobile-menu-items.ts +1 -5
  71. package/src/components/Menu/hooks/use-mobile-menu-levels.ts +2 -7
  72. package/src/components/Menu/utils.ts +2 -1
  73. package/src/components/Profile/LoginLink.tsx +2 -5
  74. package/src/components/Profile/MobileUserProfile.tsx +1 -4
  75. package/src/components/Profile/UserProfile.tsx +5 -8
  76. package/src/components/Scorecard/Card.tsx +2 -4
  77. package/src/components/Scorecard/Gauge.tsx +7 -16
  78. package/src/components/Scorecard/StatusByLevelWidget.tsx +2 -6
  79. package/src/components/Search/CancelSearch.tsx +2 -5
  80. package/src/components/Search/RecentSearches.tsx +2 -5
  81. package/src/components/Search/SearchDialog.tsx +8 -15
  82. package/src/components/Search/SearchTrigger.tsx +3 -5
  83. package/src/components/Search/SuggestedPages.tsx +2 -6
  84. package/src/components/Sidebar/DrilldownMenu.tsx +2 -5
  85. package/src/components/Sidebar/VersionPicker.tsx +3 -7
  86. package/src/components/TableOfContent/TableOfContent.tsx +2 -5
  87. package/src/config.ts +0 -1
  88. package/src/layouts/Forbidden.tsx +4 -13
  89. package/src/layouts/NotFound.tsx +4 -13
  90. package/src/layouts/OIDCForbidden.tsx +2 -6
  91. package/src/mocks/hooks/index.ts +7 -6
  92. package/src/types/portal/src/shared/types/feedback.ts +1 -0
@@ -12,19 +12,16 @@ export interface LoginLinkProps {
12
12
  export function LoginLink({ href }: LoginLinkProps): JSX.Element {
13
13
  const { userProfile } = useThemeConfig();
14
14
  const { translate } = useTranslate();
15
- const translationKeys = {
16
- login: 'theme.profile.login',
17
- };
18
15
 
19
16
  return (
20
17
  <StyledLink
21
18
  href={href}
22
- data-translation-key={translationKeys.login}
19
+ data-translation-key="theme.profile.login"
23
20
  onClick={() => {
24
21
  telemetry.send('login_button_clicked', {});
25
22
  }}
26
23
  >
27
- {translate(translationKeys.login, userProfile?.loginLabel || 'Login')}
24
+ {translate('theme.profile.login', userProfile?.loginLabel || 'Login')}
28
25
  </StyledLink>
29
26
  );
30
27
  }
@@ -12,9 +12,6 @@ export function MobileUserProfile() {
12
12
  const { userProfile } = useThemeConfig();
13
13
  const { userData, handleLogout, loginUrl } = useProfileProps();
14
14
  const { translate } = useTranslate();
15
- const translationKeys = {
16
- login: 'theme.profile.login',
17
- };
18
15
 
19
16
  if (!userData?.isAuthenticated && !loginUrl) return null;
20
17
 
@@ -26,7 +23,7 @@ export function MobileUserProfile() {
26
23
  data-cy="login-btn"
27
24
  onClick={() => telemetry.send('login_button_clicked', {})}
28
25
  >
29
- {translate(translationKeys.login, userProfile?.loginLabel || 'Login')}
26
+ {translate('theme.profile.login', userProfile?.loginLabel || 'Login')}
30
27
  </LoginButton>
31
28
  ) : (
32
29
  <>
@@ -18,18 +18,15 @@ export function UserProfile({
18
18
  }: UserProfileProps): JSX.Element {
19
19
  const { userProfile } = useThemeConfig();
20
20
  const { translate } = useTranslate();
21
- const translationKeys = {
22
- myApps: 'theme.profile.myApps',
23
- logout: 'theme.profile.logout',
24
- };
21
+
25
22
  const [isOpened, setIsOpened] = useState<boolean>(false);
26
23
 
27
24
  const menuItems: JSX.Element[] = [<UserProfileData key={userData.name} userData={userData} />];
28
25
 
29
26
  if (hasDeveloperOnboarding) {
30
27
  menuItems.push(
31
- <Link to="/apps" data-translation-key={translationKeys.myApps}>
32
- {translate(translationKeys.myApps, 'My Apps')}
28
+ <Link to="/apps" data-translation-key="theme.profile.myApps">
29
+ {translate('theme.profile.myApps', 'My Apps')}
33
30
  </Link>,
34
31
  );
35
32
  }
@@ -55,11 +52,11 @@ export function UserProfile({
55
52
  handleLogout();
56
53
  telemetry.send('logout_menu_item_clicked', {});
57
54
  }}
58
- data-translation-key={translationKeys.logout}
55
+ data-translation-key="theme.profile.logout"
59
56
  role="link"
60
57
  >
61
58
  <LogoutIcon />
62
- {translate(translationKeys.logout, userProfile?.logoutLabel || 'Log out')}
59
+ {translate('theme.profile.logout', userProfile?.logoutLabel || 'Log out')}
63
60
  </Logout>,
64
61
  );
65
62
 
@@ -1,10 +1,8 @@
1
1
  import styled from 'styled-components';
2
2
 
3
- export const ScorecardCard = styled.div.attrs({
4
- 'data-component-name': 'Scorecard/ScorecardCard',
5
- })`
3
+ export const ScorecardCard = styled.div`
6
4
  color: var(--text-primary);
7
- background-color: var(--bg-raised);
5
+ background-color: var(--thin-tile-background-color);
8
6
  border-radius: 4px;
9
7
 
10
8
  border: 1px solid var(--border-primary);
@@ -1,27 +1,18 @@
1
1
  import * as React from 'react';
2
2
  import styled from 'styled-components';
3
- export interface GaugeProps {
3
+
4
+ export function Gauge({
5
+ chunks,
6
+ }: {
4
7
  chunks: {
5
8
  share: number;
6
9
  color: string;
7
- title?: string;
8
10
  }[];
9
- className?: string;
10
- }
11
-
12
- export function Gauge({ chunks, className }: GaugeProps) {
13
- const title = chunks
14
- .map((chunk) => chunk.title)
15
- .filter(Boolean)
16
- .join(', ');
11
+ }) {
17
12
  return (
18
- <GaugeWrapper
19
- data-component-name="Scorecard/StatusByLevelWidget"
20
- className={className}
21
- title={title}
22
- >
13
+ <GaugeWrapper>
23
14
  {chunks.map((chunk, i) => (
24
- <GaugeChunk key={i} share={chunk.share} color={chunk.color} />
15
+ <GaugeChunk key={i} {...chunk} />
25
16
  ))}
26
17
  </GaugeWrapper>
27
18
  );
@@ -7,13 +7,12 @@ import { ScorecardCard, ScorecardCardTitle } from '@theme/components/Scorecard/C
7
7
  export interface StatusByLevelWidgetProps {
8
8
  title: string;
9
9
  levels: { name: string; errors: number; warnings: number; total: number }[];
10
- className?: string;
11
10
  }
12
11
 
13
12
  export function StatusByLevelWidget(props: StatusByLevelWidgetProps) {
14
- const { levels, title, className } = props;
13
+ const { levels, title } = props;
15
14
  return (
16
- <ScorecardCard data-component-name="Scorecard/StatusByLevelWidget" className={className}>
15
+ <ScorecardCard>
17
16
  <ScorecardCardTitle>{title}</ScorecardCardTitle>
18
17
  <CardBody>
19
18
  {levels.map((level) => {
@@ -26,17 +25,14 @@ export function StatusByLevelWidget(props: StatusByLevelWidgetProps) {
26
25
  {
27
26
  share: (success / level.total) * 100,
28
27
  color: 'var(--scorecard-color-success)',
29
- title: `${success} passed`,
30
28
  },
31
29
  {
32
30
  share: (level.warnings / level.total) * 100,
33
31
  color: 'var(--scorecard-color-warning)',
34
- title: `${level.warnings} ${level.warnings === 1 ? 'warning' : 'warnings'}`,
35
32
  },
36
33
  {
37
34
  share: (level.errors / level.total) * 100,
38
35
  color: 'var(--scorecard-color-error)',
39
- title: `${level.errors} ${level.errors === 1 ? 'error' : 'errors'}`,
40
36
  },
41
37
  ]}
42
38
  />
@@ -12,14 +12,11 @@ export function CancelSearch({
12
12
  className?: string;
13
13
  }): JSX.Element {
14
14
  const { translate } = useTranslate();
15
- const translationKeys = {
16
- cancel: 'theme.search.cancel',
17
- };
18
15
 
19
16
  return (
20
17
  <Wrapper data-component-name="Search/CancelSearch" onClick={onClick} className={className}>
21
- <Button data-translation-keys={translationKeys.cancel} fullWidth variant="outlined">
22
- {translate(translationKeys.cancel, 'Cancel')}
18
+ <Button data-translation-keys="theme.search.cancel" fullWidth variant="outlined">
19
+ {translate('theme.search.cancel', 'Cancel')}
23
20
  </Button>
24
21
  </Wrapper>
25
22
  );
@@ -15,9 +15,6 @@ export function RecentSearches({
15
15
  }) {
16
16
  const { items, removeSearchHistoryItem } = useRecentSearches();
17
17
  const { translate } = useTranslate();
18
- const translationKeys = {
19
- title: 'theme.search.recent',
20
- };
21
18
 
22
19
  if (!items || !items.length) return null;
23
20
 
@@ -34,8 +31,8 @@ export function RecentSearches({
34
31
 
35
32
  return (
36
33
  <Wrapper data-component-name="Search/RecentSearches" className={className}>
37
- <Title data-translation-key={translationKeys.title}>
38
- {translate(translationKeys.title, 'Recent searches')}
34
+ <Title data-translation-key="theme.search.recent">
35
+ {translate('theme.search.recent', 'Recent searches')}
39
36
  </Title>
40
37
  <RecentItems>
41
38
  {items.map((item) => (
@@ -39,13 +39,6 @@ export const SearchDialog = ({
39
39
  }
40
40
  };
41
41
 
42
- const translationKeys = {
43
- noResults: 'theme.search.noResults',
44
- navigate: 'theme.search.keys.navigate',
45
- select: 'theme.search.keys.select',
46
- exit: 'theme.search.keys.exit',
47
- };
48
-
49
42
  const mapItem = (item: SearchDocument) => {
50
43
  return (
51
44
  <SearchItem key={item.id} item={item} product={!product ? item.product?.name : undefined} />
@@ -74,8 +67,8 @@ export const SearchDialog = ({
74
67
  items.length ? (
75
68
  items.map(mapItem)
76
69
  ) : (
77
- <Message data-translation-key={translationKeys.noResults}>
78
- {translate(translationKeys.noResults, 'No results')}
70
+ <Message data-translation-key="theme.search.noResults">
71
+ {translate('theme.search.noResults', 'No results')}
79
72
  </Message>
80
73
  )
81
74
  ) : (
@@ -88,19 +81,19 @@ export const SearchDialog = ({
88
81
  <BottomContainer>
89
82
  <Shortcuts>
90
83
  <Shortcut
91
- data-translation-key={translationKeys.navigate}
84
+ data-translation-key="theme.search.keys.navigate"
92
85
  combination="Tab"
93
- text={translate(translationKeys.navigate, 'to navigate')}
86
+ text={translate('theme.search.keys.navigate', 'to navigate')}
94
87
  />
95
88
  <Shortcut
96
- data-translation-key={translationKeys.select}
89
+ data-translation-key="theme.search.keys.select"
97
90
  combination="↵"
98
- text={translate(translationKeys.select, 'to select')}
91
+ text={translate('theme.search.keys.select', 'to select')}
99
92
  />
100
93
  <Shortcut
101
- data-translation-key={translationKeys.exit}
94
+ data-translation-key="theme.search.keys.exit"
102
95
  combination="Esc"
103
- text={translate(translationKeys.exit, 'to exit')}
96
+ text={translate('theme.search.keys.exit', 'to exit')}
104
97
  />
105
98
  </Shortcuts>
106
99
  <CancelSearch onClick={onClose} />
@@ -15,16 +15,14 @@ export function SearchTrigger({
15
15
  }): JSX.Element {
16
16
  const themeSettings = useThemeConfig();
17
17
  const { translate } = useTranslate();
18
- const translationKeys = {
19
- label: 'theme.search.navbar.label',
20
- };
18
+
21
19
  const keyShortcuts = themeSettings?.search?.shortcuts ?? ['/'];
22
20
 
23
21
  return (
24
22
  <Wrapper data-component-name="Search/SearchTrigger" onClick={onClick} className={className}>
25
23
  <SearchIconSmall />
26
- <Label data-translation-key={translationKeys.label}>
27
- {translate(translationKeys.label, 'Search')}
24
+ <Label data-translation-key="theme.search.navbar.label">
25
+ {translate('theme.search.navbar.label', 'Search')}
28
26
  </Label>
29
27
  <ShortcutKey keyShortcuts={keyShortcuts} />
30
28
  </Wrapper>
@@ -9,16 +9,12 @@ import { useTranslate } from '@portal/hooks';
9
9
  export function SuggestedPages({ className }: { className?: string }) {
10
10
  const pages = useSuggestedPages();
11
11
  const { translate } = useTranslate();
12
- const translationKeys = {
13
- title: 'theme.search.suggested',
14
- };
15
-
16
12
  if (!pages.length) return null;
17
13
 
18
14
  return (
19
15
  <Wrapper data-component-name="Search/SuggestedPages" className={className}>
20
- <Title data-translation-key={translationKeys.title}>
21
- {translate(translationKeys.title, 'Suggested pages')}
16
+ <Title data-translation-key="theme.search.suggested">
17
+ {translate('theme.search.suggested', 'Suggested pages')}
22
18
  </Title>
23
19
  <SuggestedItems>
24
20
  {pages.map(
@@ -15,19 +15,16 @@ export function DrilldownMenu({
15
15
  className,
16
16
  }: React.PropsWithChildren<DrilldownMenuProps>): JSX.Element {
17
17
  const { translate } = useTranslate();
18
- const translationKeys = {
19
- backLabel: 'theme.sidebar.menu.backLabel',
20
- };
21
18
  const label =
22
19
  item.label === prevActiveItem?.label || !prevActiveItem?.label
23
- ? translate(translationKeys.backLabel, 'Back')
20
+ ? translate('theme.sidebar.menu.backLabel', 'Back')
24
21
  : prevActiveItem?.label;
25
22
 
26
23
  return (
27
24
  <MenuContainer data-component-name="Sidebar/DrilldownMenu" className={className}>
28
25
  <MenuContent>
29
26
  <MenuWrapper>
30
- <BackButton back={back} data-translation-key={translationKeys.backLabel}>
27
+ <BackButton back={back} data-translation-key="theme.sidebar.menu.backLabel">
31
28
  {label}
32
29
  </BackButton>
33
30
  <MenuLinkItem item={item}>
@@ -16,10 +16,6 @@ export function VersionPicker(props: { versions?: Version[]; onChange: (v: Versi
16
16
  const { versionPicker } = themeConfig;
17
17
 
18
18
  const { translate } = useTranslate();
19
- const translationKeys = {
20
- label: 'theme.versionPicker.label',
21
- unversioned: 'theme.versionPicker.unversioned',
22
- };
23
19
 
24
20
  const { versions = [], onChange } = props;
25
21
  const options = versions.map((version) => {
@@ -40,11 +36,11 @@ export function VersionPicker(props: { versions?: Version[]; onChange: (v: Versi
40
36
 
41
37
  return (
42
38
  <VersionsPickerWrapper>
43
- <VersionPickerLabel data-translation-key={translationKeys.label}>
44
- {translate(translationKeys.label, 'Version:')}
39
+ <VersionPickerLabel data-translation-key="theme.versionPicker.label">
40
+ {translate('theme.versionPicker.label', 'Version:')}
45
41
  </VersionPickerLabel>
46
42
  <VersionPickerSelect
47
- placeholder={translate(translationKeys.unversioned, 'All versions')}
43
+ placeholder={translate('theme.versionPicker.unversioned', 'All versions')}
48
44
  disabled={!options.length}
49
45
  options={options}
50
46
  value={value}
@@ -35,9 +35,6 @@ export function TableOfContent(props: TableOfContentProps): JSX.Element | null {
35
35
  );
36
36
 
37
37
  const { translate } = useTranslate();
38
- const translationKeys = {
39
- header: 'theme.toc.header',
40
- };
41
38
 
42
39
  if (toc?.hide) {
43
40
  return null;
@@ -48,8 +45,8 @@ export function TableOfContent(props: TableOfContentProps): JSX.Element | null {
48
45
  <TableOfContentMenu data-component-name="TableOfContent/TableOfContent" className={className}>
49
46
  <TableOfContentItems ref={sidebar}>
50
47
  {displayedHeadings.length ? (
51
- <TocHeader data-translation-key={translationKeys.header}>
52
- {translate(translationKeys.header, toc.header || 'On this page')}
48
+ <TocHeader data-translation-key="theme.toc.header">
49
+ {translate('theme.toc.header', toc.header || 'On this page')}
53
50
  </TocHeader>
54
51
  ) : null}
55
52
  {displayedHeadings.map((heading: MdHeading | null, idx: number) => {
package/src/config.ts CHANGED
@@ -319,7 +319,6 @@ const scorecardConfigSchema = {
319
319
  required: ['name'],
320
320
  properties: {
321
321
  name: { type: 'string' },
322
- color: { type: 'string' },
323
322
  extends: { type: 'array', items: { type: 'string' } },
324
323
  rules: {
325
324
  type: 'object',
@@ -6,24 +6,15 @@ import { useTranslate } from '@portal/hooks';
6
6
 
7
7
  export function Forbidden(): JSX.Element {
8
8
  const { translate } = useTranslate();
9
- const translationKeys = {
10
- title: 'theme.page.forbidden.title',
11
- homeButton: 'theme.page.homeButton',
12
- };
13
9
 
14
10
  return (
15
11
  <Wrapper data-component-name="Pages/Forbidden">
16
12
  <Header>403</Header>
17
- <Description data-translation-key={translationKeys.title}>
18
- {translate(translationKeys.title, 'Access forbidden')}
13
+ <Description data-translation-key="theme.page.forbidden.title">
14
+ {translate('theme.page.forbidden.title', 'Access forbidden')}
19
15
  </Description>
20
- <HomeButton
21
- color="primary"
22
- size="large"
23
- to="/"
24
- data-translation-key={translationKeys.homeButton}
25
- >
26
- {translate(translationKeys.homeButton, 'Open Homepage')}
16
+ <HomeButton color="primary" size="large" to="/" data-translation-key="theme.page.homeButton">
17
+ {translate('theme.page.homeButton', 'Open Homepage')}
27
18
  </HomeButton>
28
19
  </Wrapper>
29
20
  );
@@ -6,24 +6,15 @@ import { useTranslate } from '@portal/hooks';
6
6
 
7
7
  export function NotFound(): JSX.Element {
8
8
  const { translate } = useTranslate();
9
- const translationKeys = {
10
- title: 'theme.page.notFound.title',
11
- homeButton: 'theme.page.homeButton',
12
- };
13
9
 
14
10
  return (
15
11
  <Wrapper data-component-name="Pages/NotFound">
16
12
  <Header>404</Header>
17
- <Description data-translation-key={translationKeys.title}>
18
- {translate(translationKeys.title, `It looks like you're lost`)}
13
+ <Description data-translation-key="theme.page.notFound.title">
14
+ {translate('theme.page.notFound.title', "It looks like you're lost")}
19
15
  </Description>
20
- <HomeButton
21
- color="primary"
22
- size="large"
23
- to="/"
24
- data-translation-key={translationKeys.homeButton}
25
- >
26
- {translate(translationKeys.homeButton, 'Open Homepage')}
16
+ <HomeButton color="primary" size="large" to="/" data-translation-key="theme.page.homeButton">
17
+ {translate('theme.page.homeButton', 'Open Homepage')}
27
18
  </HomeButton>
28
19
  </Wrapper>
29
20
  );
@@ -9,10 +9,6 @@ export function OIDCForbidden(): JSX.Element {
9
9
  const [searchParams, setSearchParams] = useSearchParams();
10
10
  const [errorDescription, setErrorDescription] = useState<string>('');
11
11
 
12
- const translationKeys = {
13
- title: 'theme.page.forbidden.title',
14
- };
15
-
16
12
  // use whatever you want here
17
13
  const URL_REGEX =
18
14
  /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/;
@@ -38,8 +34,8 @@ export function OIDCForbidden(): JSX.Element {
38
34
  return (
39
35
  <Wrapper data-component-name="Pages/OIDCForbidden">
40
36
  <Header>403</Header>
41
- <Description data-translation-key={translationKeys.title}>
42
- {translate(translationKeys.title, 'Access forbidden')}
37
+ <Description data-translation-key="theme.page.forbidden.title">
38
+ {translate('theme.page.forbidden.title', 'Access forbidden')}
43
39
  </Description>
44
40
  {errorDescription && <ErrorDescription>{renderText(errorDescription)}</ErrorDescription>}
45
41
  </Wrapper>
@@ -1,5 +1,7 @@
1
+ import type { TFunction } from '@redocly/portal-types';
2
+
1
3
  import type { CatalogConfig, ProductUiConfig, ThemeUIConfig } from '@theme/config';
2
- import type { ResolvedNavItem, TFunction, Version } from '@theme/types/portal';
4
+ import type { ResolvedNavItem, Version } from '@theme/types/portal';
3
5
  import type { FilteredCatalog } from '@theme/types/portal/src/shared/types/catalog';
4
6
  interface PageLink {
5
7
  label: string;
@@ -76,11 +78,10 @@ export function useCatalog(_items: ResolvedNavItem[], _config: CatalogConfig): F
76
78
  throw new Error('Mock not implemented yet.');
77
79
  }
78
80
 
79
- export function useTranslate() {
80
- const translate: TFunction = (value?: string, options?: { defaultValue: string } | string) =>
81
- (typeof options === 'string' ? options : options?.defaultValue) || value || '';
82
- return { translate };
83
- }
81
+ export const useTranslate = (): { translate: TFunction } => ({
82
+ translate: (value?: string, options?: { defaultValue: string } | string) =>
83
+ (typeof options === 'string' ? options : options?.defaultValue) || value || '',
84
+ });
84
85
 
85
86
  export function useI18n() {
86
87
  const changeLanguage = (...args: any) => args.value as string;
@@ -6,6 +6,7 @@ export type SubmitFeedbackParams = {
6
6
  type: string;
7
7
  values: Record<string, unknown>;
8
8
  path?: string;
9
+ location?: string;
9
10
  };
10
11
 
11
12
  export type FeedbackProps = {