We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b89511c commit 205550aCopy full SHA for 205550a
packages/app/src/embed/components/Sidebar/ExternalResources/index.js
@@ -1,7 +1,20 @@
1
import React from 'react';
2
import { Container, Row } from './elements';
3
4
+function getFontFamily(search) {
5
+ const hashes = search.slice(search.indexOf('?') + 1).split('&');
6
+ const family = hashes
7
+ .find(hash => hash.split('=')[0] === 'family')
8
+ .split('=')[1];
9
+
10
+ return family.split('+').join(' ');
11
+}
12
13
function getName(resource) {
14
+ if (resource.includes('https://fonts.googleapis.com/css')) {
15
+ return `${getFontFamily(resource)} (Google Fonts)`;
16
+ }
17
18
if (resource.endsWith('.css') || resource.endsWith('.js')) {
19
const match = resource.match(/.*\/(.*)/);
20
if (match && match[1]) {
0 commit comments