chore: lint errors

This commit is contained in:
Sebastian.Bor 2021-04-23 23:06:56 +01:00
parent 90546db0e5
commit 61f4be3cbd
3 changed files with 24 additions and 24 deletions

View File

@ -112,10 +112,6 @@ export const registerProgramGovernance = async (
); );
} }
const councilMintSeed = uninitializedTimelockConfig.councilMint
? uninitializedTimelockConfig.councilMint.toBuffer()
: Buffer.from('');
const [timelockConfigKey] = await PublicKey.findProgramAddress( const [timelockConfigKey] = await PublicKey.findProgramAddress(
[ [
Buffer.from(GOVERNANCE_AUTHORITY_SEED), Buffer.from(GOVERNANCE_AUTHORITY_SEED),

View File

@ -14,10 +14,6 @@ const MAX_BUBBLE_AMOUNT = 50;
export function VoterBubbleGraph(props: IVoterBubbleGraph) { export function VoterBubbleGraph(props: IVoterBubbleGraph) {
const { data, width, height, endpoint } = props; const { data, width, height, endpoint } = props;
const subdomain = endpoint
.replace('http://', '')
.replace('https://', '')
.split('.')[0];
// For some reason giving this a type causes an issue where setRef // For some reason giving this a type causes an issue where setRef
// cant be used with ref={} prop...not sure why. SetStateAction nonsense. // cant be used with ref={} prop...not sure why. SetStateAction nonsense.
@ -31,6 +27,14 @@ export function VoterBubbleGraph(props: IVoterBubbleGraph) {
d.name.slice(d.name.length - 3, d.name.length), d.name.slice(d.name.length - 3, d.name.length),
})); }));
//console.log('Data', limitedData); //console.log('Data', limitedData);
useEffect(() => {
if (ref) {
const subdomain = endpoint
.replace('http://', '')
.replace('https://', '')
.split('.')[0];
const format = d3.format(',d'); const format = d3.format(',d');
const color = d3 const color = d3
.scaleOrdinal() .scaleOrdinal()
@ -47,8 +51,6 @@ export function VoterBubbleGraph(props: IVoterBubbleGraph) {
); );
}; };
useEffect(() => {
if (ref) {
ref.innerHTML = ''; ref.innerHTML = '';
const root = pack(limitedData); const root = pack(limitedData);
// console.log('Re-rendered'); // console.log('Re-rendered');
@ -127,7 +129,7 @@ export function VoterBubbleGraph(props: IVoterBubbleGraph) {
}${format(d.value)}`, }${format(d.value)}`,
); );
} }
}, [ref, limitedData, height, width]); }, [ref, limitedData, height, width, endpoint]);
return ( return (
<div <div

View File

@ -155,6 +155,7 @@ function voterDisplayData(
title: key, title: key,
group: label, group: label,
value: amount, value: amount,
key: key,
}); });
const undecidedData = [ const undecidedData = [
@ -198,6 +199,7 @@ function voterDisplayData(
const data = [...undecidedData, ...yesData, ...noData].sort( const data = [...undecidedData, ...yesData, ...noData].sort(
(a, b) => b.value - a.value, (a, b) => b.value - a.value,
); );
return data; return data;
} }