File tree Expand file tree Collapse file tree
lib/components/event-schedule-new/event Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ const compat = new FlatCompat({
1010} ) ;
1111
1212const eslintConfig = [
13- ...compat . extends ( [ 'next/core-web-vitals' ] ) ,
13+ ...compat . extends ( 'next/core-web-vitals' ) ,
1414] ;
1515
1616export default eslintConfig ;
Original file line number Diff line number Diff line change 11import HomePageContent from './page-content' ;
2- import { getAtprotoEvents } from './worlds-fair/page ' ;
2+ import { getAtprotoEvents } from '@/utils/atproto-events ' ;
33
44export default async function HomePage ( ) {
55 const atprotoEvents = await getAtprotoEvents ( ) ;
Original file line number Diff line number Diff line change 11import ProgrammePageContent from './page-content' ;
2- import { apiResultToCalendarFormat } from 'lib/components/event-schedule-new/atproto-to-calendar-format' ;
3-
4- export async function getAtprotoEvents ( ) {
5- try {
6- const atprotoEvents = await fetch (
7- process . env . NODE_ENV === 'development' && ! process . env . FORCE_PROD_ENV
8- ? 'http://localhost:4000/calendar-events'
9- : 'https://at-slurper.onrender.com/calendar-events' ,
10- {
11- next : { revalidate : 300 } , // Cache for 5 minutes
12- }
13- ) ;
14-
15- const atprotoEventsData = await atprotoEvents . json ( ) ;
16-
17- const formattedAtprotoEvents = apiResultToCalendarFormat ( atprotoEventsData ) ;
18-
19- return formattedAtprotoEvents ;
20- } catch ( error ) {
21- console . error ( error ) ;
22- return [ ] ;
23- }
24- }
2+ import { getAtprotoEvents } from '@/utils/atproto-events' ;
253
264export default async function ProgrammePage ( ) {
275 const atprotoEvents = await getAtprotoEvents ( ) ;
Original file line number Diff line number Diff line change 11import ProgrammePageContent from './page-content' ;
2- import { apiResultToCalendarFormat } from 'lib/components/event-schedule-new/atproto-to-calendar-format' ;
3-
4- export async function getAtprotoEvents ( ) {
5- try {
6- const atprotoEvents = await fetch (
7- process . env . NODE_ENV === 'development' && ! process . env . FORCE_PROD_ENV
8- ? 'http://localhost:4000/calendar-events'
9- : 'https://at-slurper.onrender.com/calendar-events' ,
10- {
11- next : { revalidate : 300 } , // Cache for 5 minutes
12- }
13- ) ;
14-
15- const atprotoEventsData = await atprotoEvents . json ( ) ;
16-
17- const formattedAtprotoEvents = apiResultToCalendarFormat ( atprotoEventsData ) ;
18-
19- return formattedAtprotoEvents ;
20- } catch ( error ) {
21- console . error ( error ) ;
22- return [ ] ;
23- }
24- }
2+ import { getAtprotoEvents } from '@/utils/atproto-events' ;
253
264export default async function ProgrammePage ( ) {
275 const atprotoEvents = await getAtprotoEvents ( ) ;
Original file line number Diff line number Diff line change 1+ import { apiResultToCalendarFormat } from 'lib/components/event-schedule-new/atproto-to-calendar-format' ;
2+
3+ export async function getAtprotoEvents ( ) {
4+ try {
5+ const atprotoEvents = await fetch (
6+ process . env . NODE_ENV === 'development' && ! process . env . FORCE_PROD_ENV
7+ ? 'http://localhost:4000/calendar-events'
8+ : 'https://at-slurper.onrender.com/calendar-events' ,
9+ {
10+ next : { revalidate : 300 } , // Cache for 5 minutes
11+ }
12+ ) ;
13+
14+ const atprotoEventsData = await atprotoEvents . json ( ) ;
15+
16+ const formattedAtprotoEvents = apiResultToCalendarFormat ( atprotoEventsData ) ;
17+
18+ return formattedAtprotoEvents ;
19+ } catch ( error ) {
20+ console . error ( error ) ;
21+ return [ ] ;
22+ }
23+ }
Original file line number Diff line number Diff line change @@ -228,7 +228,7 @@ const ExportEvent = ({
228228 ) ;
229229} ;
230230
231- const Event : React . FC < EventProps > = ( {
231+ function Event ( {
232232 compact,
233233 event,
234234 isDialog,
@@ -238,7 +238,7 @@ const Event: React.FC<EventProps> = ({
238238 setExports,
239239 toggleFavoriteEvent,
240240 favoriteEvents,
241- } ) => {
241+ } : EventProps ) : React . JSX . Element {
242242 const [ showMobileProgramming , setShowMobileProgramming ] = useState ( false ) ;
243243 const [ imageLoaded , setImageLoaded ] = useState ( false ) ;
244244 const imageRef = useRef < any > ( null ) ;
You can’t perform that action at this time.
0 commit comments