Skip to content

Commit

Permalink
Prettier fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hiletmis committed Jan 18, 2024
1 parent 8a5a219 commit b70812e
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 107 deletions.
74 changes: 18 additions & 56 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -1,80 +1,42 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended"
],
"extends": ["config:recommended"],
"packageRules": [
{
"matchPackageNames": [
"camelcase"
],
"matchPackageNames": ["camelcase"],
"enabled": false
},
{
"matchDepTypes": [
"devDependencies"
],
"matchPackagePatterns": [
"@api3\/.*",
"@phase21\/.*"
],
"matchUpdateTypes": [
"major"
],
"schedule": [
"before 2:00pm"
],
"matchDepTypes": ["devDependencies"],
"matchPackagePatterns": ["@api3/.*", "@phase21/.*"],
"matchUpdateTypes": ["major"],
"schedule": ["before 2:00pm"],
"groupName": "api3 major updates"
},
{
"matchDepTypes": [
"devDependencies"
],
"matchPackagePatterns": [
"@api3\/.*",
"@phase21\/.*"
],
"matchUpdateTypes": [
"patch",
"minor"
],
"schedule": [
"before 2:00pm"
],
"matchDepTypes": ["devDependencies"],
"matchPackagePatterns": ["@api3/.*", "@phase21/.*"],
"matchUpdateTypes": ["patch", "minor"],
"schedule": ["before 2:00pm"],
"groupName": "api3"
},
{
"matchDepTypes": [
"devDependencies"
],
"matchUpdateTypes": [
"patch",
"minor"
],
"schedule": [
"after 5pm on Friday"
],
"matchDepTypes": ["devDependencies"],
"matchUpdateTypes": ["patch", "minor"],
"schedule": ["after 5pm on Friday"],
"groupName": "other minor updates"
},
{
"matchDepTypes": [
"devDependencies"
],
"matchUpdateTypes": [
"major"
],
"schedule": [
"after 5pm on Friday"
],
"matchDepTypes": ["devDependencies"],
"matchUpdateTypes": ["major"],
"schedule": ["after 5pm on Friday"],
"groupName": "other major updates"
}
],
"rangeStrategy": "bump",
"lockFileMaintenance": {
"enabled": false
},
"reviewers": [
"hiletmis"
],
"reviewers": ["hiletmis"],
"dependencyDashboard": false
}
}
12 changes: 9 additions & 3 deletions scripts/build-svg.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const chains = require('@phase21/chains');
const fs = require('fs/promises');
const { rimraf } = require('rimraf')
const { rimraf } = require('rimraf');
const babel = require('@babel/core');
const utils = require('../helpers/utils');
const { apisData, getApiProviderAliases } = require('@phase21/api-integrations');
Expand Down Expand Up @@ -28,7 +28,13 @@ function getLogoList(mode) {
case 'chain':
return [...getManualLogos(mode), ...chains.CHAINS.map((chain) => chain.id)];
case 'symbol':
const supportedFeed = [... new Set(getApiProviderAliases().map((apiProvider) => Object.values(apisData[apiProvider].supportedFeedsInBatches).flat(2)).flat())];
const supportedFeed = [
...new Set(
getApiProviderAliases()
.map((apiProvider) => Object.values(apisData[apiProvider].supportedFeedsInBatches).flat(2))
.flat()
)
];
return [...getManualLogos(mode), ...new Set(supportedFeed.map((feed) => feed.split('/')).flat())];
case 'api-provider':
return [...getManualLogos(mode), ...getApiProviderAliases()];
Expand Down Expand Up @@ -133,6 +139,6 @@ async function main() {
.then(() => Promise.all([renameFiles()]))
.then(() => Promise.all([generateLogos('cjs'), generateLogos('esm')]))
.then(() => console.log('✅ Finished building package.'));
};
}

main();
2 changes: 1 addition & 1 deletion viewer/src/Components/ApiProviderView.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ApiProviderLogo } from '@phase21/logos';
import SearchRow from '../Custom/SearchRow';
import { useState } from 'react';
import InfoView from '../Custom/InfoView';
import { getApiProviderAliases } from '@phase21/api-integrations'
import { getApiProviderAliases } from '@phase21/api-integrations';

const ApiProvidersView = () => {
const [apiProvider, setApiProvider] = useState('');
Expand Down
94 changes: 48 additions & 46 deletions viewer/src/Components/MissingLogosView.js
Original file line number Diff line number Diff line change
@@ -1,66 +1,68 @@
import { Flex, Text, Image, VStack } from '@chakra-ui/react';
import * as Api3Chains from '@phase21/chains';
import { SymbolLogoMissing, SymbolLogo, ApiProviderLogoMissing, ApiProviderLogo, ChainLogoMissing, ChainLogo } from '@phase21/logos';
import {
SymbolLogoMissing,
SymbolLogo,
ApiProviderLogoMissing,
ApiProviderLogo,
ChainLogoMissing,
ChainLogo
} from '@phase21/logos';
import Title from '../Custom/Title';

const MissingBatchView = ({ header, batch, method }) => {

const getChain = (chainId) => {
return Api3Chains.CHAINS.find((chainObject) => chainObject.id === chainId).name + ' (' + chainId + ')';
}
};

return (
batch.length === 0 ? null :
<Flex gap={3} bgColor={'white'} wrap={'wrap'} alignItems="center" justifyContent="left">
<VStack width={"100%"} alignItems={"left"}>
<Title header={header} />
<Text fontSize="md" fontWeight="bold" ml={2}>
There is a total of {batch.length} missing {header} logos
</Text>
</VStack>
return batch.length === 0 ? null : (
<Flex gap={3} bgColor={'white'} wrap={'wrap'} alignItems="center" justifyContent="left">
<VStack width={'100%'} alignItems={'left'}>
<Title header={header} />
<Text fontSize="md" fontWeight="bold" ml={2}>
There is a total of {batch.length} missing {header} logos
</Text>
</VStack>

{batch.map((item, index) => {
return (
<Flex
p={3}
boxShadow={'md'}
width={'150px'}
height={'100px'}
bgColor={'gray.100'}
key={index}
alignItems="center"
justifyContent="left"
cursor={'pointer'}
>
<Image src={method(item)} width={50} height={50} />
<Text fontSize="sm" fontWeight="bold" ml={2}>
{header === 'Chains' ? getChain(item) : item}
</Text>
</Flex>
);
})}
</Flex>
{batch.map((item, index) => {
return (
<Flex
p={3}
boxShadow={'md'}
width={'150px'}
height={'100px'}
bgColor={'gray.100'}
key={index}
alignItems="center"
justifyContent="left"
cursor={'pointer'}
>
<Image src={method(item)} width={50} height={50} />
<Text fontSize="sm" fontWeight="bold" ml={2}>
{header === 'Chains' ? getChain(item) : item}
</Text>
</Flex>
);
})}
</Flex>
);
}
};

const MissingLogosView = () => {

const checkIfMissingLogos = () => {
return SymbolLogoMissing.length + ApiProviderLogoMissing.length + ChainLogoMissing.length;
}
};

return (
<Flex p={3} gap={3} bgColor={'white'} wrap={'wrap'} alignItems="center" justifyContent="left">
{
checkIfMissingLogos() === 0 ?
<Text fontSize="md" fontWeight="bold" ml={2}>
There is no missing logos
</Text>
: null
}
<MissingBatchView header={"Symbols"} batch={SymbolLogoMissing} method={SymbolLogo} />
<MissingBatchView header={"ApiProviders"} batch={ApiProviderLogoMissing} method={ApiProviderLogo} />
<MissingBatchView header={"Chains"} batch={ChainLogoMissing} method={ChainLogo} />
{checkIfMissingLogos() === 0 ? (
<Text fontSize="md" fontWeight="bold" ml={2}>
There is no missing logos
</Text>
) : null}
<MissingBatchView header={'Symbols'} batch={SymbolLogoMissing} method={SymbolLogo} />
<MissingBatchView header={'ApiProviders'} batch={ApiProviderLogoMissing} method={ApiProviderLogo} />
<MissingBatchView header={'Chains'} batch={ChainLogoMissing} method={ChainLogo} />
</Flex>
);
};
Expand Down
8 changes: 7 additions & 1 deletion viewer/src/Components/SymbolsView.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ const SymbolsView = () => {
const [selectedSymbol, setSelectedSymbol] = useState('');

const getSymbols = () => {
const supportedFeed = [...new Set(getApiProviderAliases().map((apiProvider) => Object.values(apisData[apiProvider].supportedFeedsInBatches).flat(2)).flat())];
const supportedFeed = [
...new Set(
getApiProviderAliases()
.map((apiProvider) => Object.values(apisData[apiProvider].supportedFeedsInBatches).flat(2))
.flat()
)
];
const filteredFeeds = [...new Set(supportedFeed.map((feed) => feed.split('/')).flat())];
return filteredFeeds.filter((feed) => feed.toLowerCase().includes(symbol.toLowerCase()));
};
Expand Down

0 comments on commit b70812e

Please sign in to comment.