@redocly/theme 0.13.0 → 0.13.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.
@@ -44,8 +44,12 @@ const LanguagePicker = (props) => {
44
44
  if (locales.length < 2) {
45
45
  return null;
46
46
  }
47
+ const locale = locales.find((l) => l.code === currentLocale);
48
+ if (!locale) {
49
+ return null;
50
+ }
47
51
  return (react_1.default.createElement(Dropdown, { "data-component-name": "I18n/LanguagePicker", ref: dropdownRef, isOpen: isOpen, onClick: () => setIsOpen(!isOpen), onBlur: () => setIsOpen(false) },
48
- react_1.default.createElement(DropdownValue, { role: "link" }, currentLocale.toUpperCase()),
52
+ react_1.default.createElement(DropdownValue, { role: "link" }, locale.name || locale.code),
49
53
  react_1.default.createElement(DropdownMenu, null, locales.map((locale) => (react_1.default.createElement(MenuItem, { onClick: () => {
50
54
  const newLangPathname = (0, utils_1.withPathPrefix)((0, utils_1.getPathnameForLocale)(location.pathname, defaultLocale, locale.code, locales));
51
55
  const newUrlWithLanguage = `${newLangPathname}${location.search}${location.hash}`;
@@ -356,7 +356,7 @@ exports.MarkdownWrapper = styled_components_1.default.main.attrs(() => ({
356
356
  }
357
357
  }
358
358
 
359
- ul,
359
+ ul.md,
360
360
  ol {
361
361
  padding-left: var(--md-list-left-padding);
362
362
  margin: 0 0 var(--md-list-margin);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/theme",
3
- "version": "0.13.0",
3
+ "version": "0.13.1",
4
4
  "description": "Shared UI components library",
5
5
  "keywords": [],
6
6
  "author": "team@redocly.com",
@@ -23,6 +23,11 @@ export const LanguagePicker = (props: { onChangeLanguage: (newLang: string) => v
23
23
  return null;
24
24
  }
25
25
 
26
+ const locale = locales.find((l) => l.code === currentLocale);
27
+ if (!locale) {
28
+ return null;
29
+ }
30
+
26
31
  return (
27
32
  <Dropdown
28
33
  data-component-name="I18n/LanguagePicker"
@@ -31,7 +36,7 @@ export const LanguagePicker = (props: { onChangeLanguage: (newLang: string) => v
31
36
  onClick={() => setIsOpen(!isOpen)}
32
37
  onBlur={() => setIsOpen(false)}
33
38
  >
34
- <DropdownValue role="link">{currentLocale.toUpperCase()}</DropdownValue>
39
+ <DropdownValue role="link">{locale.name || locale.code}</DropdownValue>
35
40
  <DropdownMenu>
36
41
  {locales.map((locale) => (
37
42
  <MenuItem
@@ -335,7 +335,7 @@ export const MarkdownWrapper = styled.main.attrs(() => ({
335
335
  }
336
336
  }
337
337
 
338
- ul,
338
+ ul.md,
339
339
  ol {
340
340
  padding-left: var(--md-list-left-padding);
341
341
  margin: 0 0 var(--md-list-margin);