Skip to content

Commit

Permalink
Importing types
Browse files Browse the repository at this point in the history
  • Loading branch information
gotpop committed Nov 2, 2022
1 parent bc7eb1d commit 69b40f0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 90 deletions.
11 changes: 2 additions & 9 deletions src/components/ButtonIcon/index.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
import * as React from 'react'
import { MouseEventHandler, useEffect, useRef } from 'react'
import { IconType } from 'react-icons'
import { useEffect, useRef } from 'react'
import { IButtonIcon } from 'types'
import styles from './ButtonIcon.module.css'

interface IButtonIcon {
content: string
properties?: { local: string; global: string }[]
icon?: IconType
doClick?: MouseEventHandler<HTMLButtonElement>
}

export default function ButtonIcon({
content = 'Click',
properties,
Expand Down
84 changes: 8 additions & 76 deletions src/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import { MouseEventHandler } from "react";
import { IconType } from "react-icons";

declare global {
namespace JSX {
interface IntrinsicElements {
Expand All @@ -9,80 +12,9 @@ declare global {
}
}

export interface IFeedProps {
posts: IPost[];
}

export interface IPost {
id: string;
title: string;
body: string;
}

export interface IPostProps {
post: IPost;
}

export interface IFormProps {
form: IForm;
}

export interface IForm {
[key: string]: {
value: string;
valid: boolean;
error: string;
}
}

export interface ILoader {
src: string;
width: number;
}

export interface IPhotoProps {
photos: IPhoto[];
}

export interface IPhoto {
thumbnailUrl: string;
title: string;
url: string;
}

export interface ICommentProps {
comment: IComment;
}

export interface ICommentsProps {
comments: IComment[];
}

export interface IComment {
name: string;
email: string;
body: string;
}

export interface IPageProps {
page: IPage;
}

export interface IPagesProps {
pages: IPage[];
}

export interface IPage {
name: string;
href: string;
description: string;
}

export interface IIntroProps {
content: IIntro;
}

export interface IIntro {
title: string;
text: string;
export interface IButtonIcon {
content: string
properties?: { local: string; global: string }[]
icon?: IconType
doClick?: MouseEventHandler<HTMLButtonElement>
}
11 changes: 6 additions & 5 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"baseUrl": "./src",
"paths": {
"@content/*": ["./src/content/*"],
"@utils/*": ["./src/utils/*"],
"@types/*": ["./src/types/*"],
"@context/*": ["./src/context/*"],
"@components/*": ["./src/components/*"]
"types/*": ["./@types/*"],
"@content/*": ["./content/*"],
"@utils/*": ["./utils/*"],
"@context/*": ["./context/*"],
"@components/*": ["./components/*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
Expand Down

1 comment on commit 69b40f0

@vercel
Copy link

@vercel vercel bot commented on 69b40f0 Nov 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

ui-system – ./

ui-system-gold.vercel.app
ui-system-teamgotpop.vercel.app
ui-system-git-main-teamgotpop.vercel.app

Please sign in to comment.