addressed some review comments from @alalonde

This commit is contained in:
luxumbra
2023-10-24 20:26:49 +01:00
committed by Alec LaLonde
parent f7a7ba5b53
commit 01c6bf9e49
3 changed files with 4 additions and 8 deletions

View File

@@ -27,13 +27,12 @@ import {
} from '@metafam/ds';
import { MetaLink } from 'components/Link';
import { MarkdownViewer } from 'components/MarkdownViewer';
import { CONFIG } from 'config';
import type { GoogleCalEventType } from 'lib/hooks/useCalendar';
import { useCalendar } from 'lib/hooks/useCalendar';
import { DateTime } from 'luxon';
import React, { useEffect, useState } from 'react';
import { calendarID } from './config';
type GroupedEventsType = {
date: string;
events: GoogleCalEventType[];
@@ -54,11 +53,12 @@ const loadMoreButtonStyles: ButtonProps = {
export const Calendar: React.FC = () => {
const [calendar, setCalendar] = useState<GroupedEventsType[]>([]);
const { calendarId } = CONFIG;
const [loadingMore, setLoadingMore] = useState(false);
const showHowMany = 4;
const [limit, setLimit] = useState(showHowMany);
const { events, fetching, error } = useCalendar();
const calICS = `https://calendar.google.com/calendar/ical/${calendarID}%40group.calendar.google.com/public/basic.ics`;
const calICS = `https://calendar.google.com/calendar/ical/${calendarId}%40group.calendar.google.com/public/basic.ics`;
const totalEvents = events?.length || 0;
const clampedEvents = events?.slice(0, limit);
@@ -145,9 +145,6 @@ export const Calendar: React.FC = () => {
setCalendar(days);
}
return () => {
setCalendar([]);
};
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [limit, fetching]);

View File

@@ -9,7 +9,6 @@ import {
import { getBoxLayoutItemDefaults } from 'utils/layoutHelpers';
export const podcastRSSURL = 'https://anchor.fm/s/57a641c/podcast/rss';
export const calendarID = 'nih59ktgafmm64ed4qk6ue8vv4';
const DEFAULT_BOX_POSITIONS: Record<ChakraSize, Positions> = {
lg: {

View File

@@ -23,7 +23,7 @@ export const CONFIG = {
'https://ceramic-clay.3boxlabs.com', // testnet
ceramicNetwork:
process.env.NEXT_PUBLIC_CERAMIC_NETWORK || 'mainnet' || 'testnet-clay',
calendarId: 'nih59ktgafmm64ed4qk6ue8vv4@group.calendar.google.com',
calendarId: 'nih59ktgafmm64ed4qk6ue8vv4',
googleDataAPIKey: process.env.NEXT_PUBLIC_YOUTUBE_API_KEY,
web3StorageToken: process.env.WEB3_STORAGE_TOKEN,
openseaAPIKey: process.env.OPENSEA_API_KEY,