mirror of
https://github.com/UiO-Gaming/mustaboard.git
synced 2026-11-05 13:56:52 +01:00
specify types for runtime
This commit is contained in:
1 parent
94715d8145
commit
e4abae84f7
5 files changed
+5
-10
No files matched your search
@@ -29,10 +29,10 @@ interface EventCardProps {
|
||||
|
||||
const recurringEvents: RecurringEvent[] = eventItems.recurring_events;
|
||||
const specialEvents: SpecialEvent[] = eventItems.special_events;
|
||||
const places: Place[] = eventItems.places.map((place: any) => ({
|
||||
const places: Place[] = eventItems.places.map((place: { name: string; closing_times: { day: string; time: string }[] }) => ({
|
||||
name: place.name,
|
||||
closingHours: new Map(
|
||||
place.closing_times.map((time: any) => [time.day, time.time])
|
||||
place.closing_times.map((time) => [time.day, time.time])
|
||||
),
|
||||
}));
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import React, { useEffect, useState } from "react";
|
||||
import React from "react";
|
||||
import vipps from "../../public/images/vipps.png";
|
||||
import Image from 'next/image';
|
||||
import SanityPeople from "../people";
|
||||
import SanityEvents from "../events";
|
||||
|
||||
const InfoCard: React.FC = () => {
|
||||
interface Person {
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import exp from "constants";
|
||||
import React from "react";
|
||||
import { useEffect } from "react";
|
||||
|
||||
function TimeCard() {
|
||||
const [time, setTime] = React.useState<Date>(new Date());
|
||||
const [date, setDate] = React.useState<Date>(new Date());
|
||||
const [date] = React.useState<Date>(new Date());
|
||||
|
||||
useEffect(() => {
|
||||
const interval = setInterval(() => {
|
||||
@@ -25,7 +24,6 @@ function TimeCard() {
|
||||
const formatDate = (date: Date) => {
|
||||
const day = date.getDate().toString().padStart(2, "0");
|
||||
const ending = findDateEnding(date);
|
||||
const month = (date.getMonth() + 1).toString().padStart(2, "0");
|
||||
const monthText = date.toLocaleString("default", { month: "long" });
|
||||
const year = date.getFullYear();
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
"use client";
|
||||
|
||||
import next from "next";
|
||||
import MenuCard from "./components/MenuCard";
|
||||
import TemperatureCard from "./components/TemperatureCard";
|
||||
import TimeCard from "./components/TimeCard";
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
const SanityPeople = () => {
|
||||
const [people, setPeople] = useState([]);
|
||||
|
||||
Reference in new issue
Block a user