Skip to content

Commit 760edb9

Browse files
committed
Extract shared EventData type
1 parent d5e3fd3 commit 760edb9

3 files changed

Lines changed: 11 additions & 17 deletions

File tree

src/components/EventsDisplay/DisplayRC.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
import React, { useState } from 'react';
22
import Image from 'next/image';
33
import { booleanFilter } from '../../util/booleanFilter';
4+
import type { EventData } from '../../types';
45

5-
type DisplayRCProps = {
6-
name: string;
7-
src: string;
8-
event: boolean;
9-
description: string;
10-
venue: string;
11-
date: string;
12-
};
6+
type DisplayRCProps = EventData;
137

148
export default function DisplayRC({
159
name,

src/pages/events/index.page.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,7 @@ import DisplayRC from '../../components/EventsDisplay';
33
import logo from '../../../public/reactdevske.svg';
44
import Head from 'next/head';
55
import type { GetStaticProps } from 'next';
6-
7-
type EventData = {
8-
name: string;
9-
src: string;
10-
event: boolean;
11-
description: string;
12-
venue: string;
13-
date: string;
14-
};
6+
import type { EventData } from '../../types';
157

168
type EventsProps = {
179
data: Array<EventData>;

src/types/index.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export type EventData = {
2+
name: string;
3+
src: string;
4+
event: boolean;
5+
description: string;
6+
venue: string;
7+
date: string;
8+
};

0 commit comments

Comments
 (0)