style: run prettier on pre-commit hook
This commit is contained in:
committed by
Stefan Rotsch
parent
b82d5a9da9
commit
9948712690
@@ -26,7 +26,8 @@ function generateCoordinates(
|
||||
ringPadding = 0.7;
|
||||
|
||||
// radian between 0 and 90 degrees
|
||||
const randomDegree = ((0.1 + (blip.angleFraction || Math.random()) * .8) * 90 * pi) / 180;
|
||||
const randomDegree =
|
||||
((0.1 + (blip.angleFraction || Math.random()) * 0.8) * 90 * pi) / 180;
|
||||
// random distance from the centre of the radar, but within given ring. Also, with some "padding" so the points don't touch ring borders.
|
||||
const radius = pointBetween(
|
||||
previousRingRadius + ringPadding,
|
||||
|
||||
@@ -7,7 +7,7 @@ import { QuadrantConfig } from "../../model";
|
||||
const arcAngel = [
|
||||
[(3 * Math.PI) / 2, (4 * Math.PI) / 2],
|
||||
[0, Math.PI / 2],
|
||||
[Math.PI, Math.PI * 3 / 2],
|
||||
[Math.PI, (Math.PI * 3) / 2],
|
||||
[Math.PI / 2, Math.PI],
|
||||
];
|
||||
|
||||
|
||||
@@ -76,8 +76,8 @@ const RadarChart: React.FC<{
|
||||
</g>
|
||||
|
||||
{Object.values(config.quadrantsMap).map((value, index) => {
|
||||
console.log(value)
|
||||
return null
|
||||
console.log(value);
|
||||
return null;
|
||||
})}
|
||||
{Object.values(config.quadrantsMap).map((value, index) => (
|
||||
<QuadrantRings
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { render, screen } from "@testing-library/react";
|
||||
import { MemoryRouter } from "react-router-dom";
|
||||
|
||||
import { item as testItem } from "./testData";
|
||||
import Item from "./Item";
|
||||
import { item as testItem } from "./testData";
|
||||
|
||||
describe("Item", () => {
|
||||
it("Should render the item", () => {
|
||||
|
||||
@@ -38,7 +38,8 @@ export function isMobileViewport() {
|
||||
return width < 1200;
|
||||
}
|
||||
|
||||
export const publicUrl = (process.env.PUBLIC_URL || "").replace(/\/$/, '') + "/";
|
||||
export const publicUrl =
|
||||
(process.env.PUBLIC_URL || "").replace(/\/$/, "") + "/";
|
||||
|
||||
export function assetUrl(file: string) {
|
||||
return publicUrl + file;
|
||||
|
||||
14
src/model.ts
14
src/model.ts
@@ -125,17 +125,19 @@ export const filteredOnly = (items: Item[], tags: Tag[] | string) => {
|
||||
}
|
||||
|
||||
if (Array.isArray(tags)) {
|
||||
return tags.every(tag => itemTags.includes(tag));
|
||||
return tags.every((tag) => itemTags.includes(tag));
|
||||
}
|
||||
|
||||
return itemTags.includes(tags);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
export const getTags = (items: Item[]): Tag[] => {
|
||||
const tags: Tag[] = items.reduce((acc: Tag[], item: Item) => {
|
||||
return !item.tags ? acc : acc.concat(item.tags);
|
||||
}, []).sort();
|
||||
const tags: Tag[] = items
|
||||
.reduce((acc: Tag[], item: Item) => {
|
||||
return !item.tags ? acc : acc.concat(item.tags);
|
||||
}, [])
|
||||
.sort();
|
||||
|
||||
return Array.from(new Set(tags));
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user