You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

runtime.tsx 721B

10 miesięcy temu
12345678910111213141516171819202122232425
  1. // @ts-nocheck
  2. // This file is generated by Umi automatically
  3. // DO NOT CHANGE IT MANUALLY!
  4. import React from 'react';
  5. import icons from './icons';
  6. function formatIcon(name: string) {
  7. return name
  8. .replace(name[0], name[0].toUpperCase())
  9. .replace(/-(w)/g, function(all, letter) {
  10. return letter.toUpperCase();
  11. });
  12. }
  13. export function patchRoutes({ routes }) {
  14. Object.keys(routes).forEach(key => {
  15. const { icon } = routes[key];
  16. if (icon && typeof icon === 'string') {
  17. const upperIcon = formatIcon(icon);
  18. if (icons[upperIcon] || icons[upperIcon + 'Outlined']) {
  19. routes[key].icon = React.createElement(icons[upperIcon] || icons[upperIcon + 'Outlined']);
  20. }
  21. }
  22. });
  23. }