From 39fbff8b02e8fcf64541f2fc862ef05390342fa3 Mon Sep 17 00:00:00 2001 From: Anton Tranelis Date: Sun, 25 Feb 2024 14:00:32 +0100 Subject: [PATCH] fixed some typing --- src/Components/Templates/CircleLayout.tsx | 6 +++--- src/Components/Templates/MoonCalendar.tsx | 4 ---- src/Utils/Moon.ts | 8 ++++---- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/Components/Templates/CircleLayout.tsx b/src/Components/Templates/CircleLayout.tsx index ad659826..2cd79e33 100644 --- a/src/Components/Templates/CircleLayout.tsx +++ b/src/Components/Templates/CircleLayout.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import { useEffect, useRef } from 'react'; -export const CircleLayout = ({ items,radius, fontSize }) => { +export const CircleLayout = ({ items,radius, fontSize } : {items: any, radius: number, fontSize: any}) => { const containerRef = useRef(null); useEffect(() => { @@ -22,8 +22,8 @@ export const CircleLayout = ({ items,radius, fontSize }) => { return (
- {items.map((item, index) => ( -
+ {items.map((item: any) => ( +
{item}
))} diff --git a/src/Components/Templates/MoonCalendar.tsx b/src/Components/Templates/MoonCalendar.tsx index de4c9b17..fda1b39d 100644 --- a/src/Components/Templates/MoonCalendar.tsx +++ b/src/Components/Templates/MoonCalendar.tsx @@ -61,8 +61,4 @@ export const MoonCalendar = () => { ); -} - -const capitalizeFirstLetter = (string: string) => { - return string } \ No newline at end of file diff --git a/src/Utils/Moon.ts b/src/Utils/Moon.ts index a9538496..1126f148 100644 --- a/src/Utils/Moon.ts +++ b/src/Utils/Moon.ts @@ -1,22 +1,22 @@ export const LUNAR_MONTH: number = 29.530588853; -const getJulianDate = (date: Date = new Date()): number => { +export const getJulianDate = (date: Date = new Date()): number => { const time: number = date.getTime(); const tzoffset: number = date.getTimezoneOffset(); return (time / 86400000) - (tzoffset / 1440) + 2440587.5; }; -const normalize = (value: number): number => { +export const normalize = (value: number): number => { value = value - Math.floor(value); if (value < 0) value += 1; return value; }; -const getLunarAgePercent = (date: Date = new Date()): number => { +export const getLunarAgePercent = (date: Date = new Date()): number => { return normalize((getJulianDate(date) - 2451550.1) / LUNAR_MONTH); }; -const getLunarAge = (date: Date = new Date()): number => { +export const getLunarAge = (date: Date = new Date()): number => { const percent: number = getLunarAgePercent(date); return percent * LUNAR_MONTH; };