Skip to content

Commit

Permalink
fix(clayui.com): formatting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
bryceosterhaus committed Mar 18, 2020
1 parent 5125a62 commit 7b9701c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
6 changes: 1 addition & 5 deletions clayui.com/src/components/IconSearch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ const IconSearch = ({
source,
iconLabelFormatter = icon => icon.name,
}) => {

const [searchQuery, setSearchQuery] = useState('');

const filteredIcons = useMemo(() => {
Expand Down Expand Up @@ -55,10 +54,7 @@ const IconSearch = ({
<ul className="d-flex flex-wrap lexicon-icon-list list-unstyled">
{list.map(icon => (
<li key={icon.name}>
<ClayIcon
spritemap={spritemap}
symbol={icon.name}
/>
<ClayIcon spritemap={spritemap} symbol={icon.name} />

<span>{iconLabelFormatter(icon)}</span>
</li>
Expand Down
31 changes: 19 additions & 12 deletions clayui.com/svg-icons.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
/**
* SPDX-FileCopyrightText: © 2020 Liferay, Inc. <https://liferay.com>
* SPDX-License-Identifier: BSD-3-Clause
*/

const fs = require('fs');
const path = require('path');

/* eslint-disable */
// prettier-ignore
const flagsData = {
"af-za": '"af-za", "Afrikaans", "South Africa"',
"ar": '"ar", "Arabic"',
Expand Down Expand Up @@ -472,6 +482,7 @@ const flagsData = {
"zu-za": '"zu-za", "Zulu", "South Africa"'
};

// prettier-ignore
const iconsData = {
"add-cell": '"center", "excel", "grid", "squares", "table"',
"add-column": '"cell", "center", "excel", "grid", "squares", "table", "vertical"',
Expand Down Expand Up @@ -724,9 +735,7 @@ const iconsData = {
"wiki-page": '"knowledge"',
"workflow": '"function", "progress"'
};

const fs = require('fs');
const path = require('path');
/* eslint-enable */

const iconsPath = path.join('static', 'images', 'icons', 'icons.svg');

Expand All @@ -747,19 +756,18 @@ function buildJson(arr, aliasesMap) {
let aliases = aliasesMap[arr[i]];

json += ' {\n';
json += ' "name": "' + arr[i] + '",\n';
json += ' "aliases": ['
json += ` "name": "${arr[i]}",\n`;
json += ' "aliases": [';

if (!aliases) {
aliases = '""';
}

json += aliases + ']\n';
json += `${aliases}]\n`;

if (i === arr.length - 1) {
json += ' }\n';
}
else {
} else {
json += ' },\n';
}
}
Expand All @@ -769,16 +777,15 @@ function buildJson(arr, aliasesMap) {
return json;
}

let flagsArr = [];
let newIconsArr = [];
const flagsArr = [];
const newIconsArr = [];

for (let i = 0; i < symbolsArr.length; i++) {
const symbol = getId(symbolsArr[i]);

if (flagsData[symbol]) {
flagsArr.push(symbol);
}
else {
} else {
newIconsArr.push(symbol);
}
}
Expand Down

0 comments on commit 7b9701c

Please sign in to comment.