Skip to content

Commit

Permalink
Add type imports
Browse files Browse the repository at this point in the history
  • Loading branch information
ProchaLu committed Nov 8, 2024
1 parent d58d5e2 commit 68dabb9
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 17 deletions.
6 changes: 3 additions & 3 deletions app/[contentType]/[slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Metadata } from 'next';
import type { Metadata } from 'next';
import Image from 'next/image';
import { notFound } from 'next/navigation';
import { Chips, Container } from '../../../components';
Expand All @@ -8,8 +8,8 @@ import {
getContentData,
getContentList,
getContentTypes,
IContentData,
IContentType,
type IContentData,
type IContentType,
} from '../../../utils/content';
import { contentTypesMap } from '../../../utils/content-types';
import Content from './content';
Expand Down
4 changes: 2 additions & 2 deletions app/[contentType]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Metadata } from 'next';
import type { Metadata } from 'next';
import { notFound } from 'next/navigation';
import { Container, ContentList } from '../../components';
import info from '../../config/index.json' assert { type: 'json' };
import {
getContentList,
getContentTypes,
IContentType,
type IContentType,
} from '../../utils/content';
import { contentTypesMap } from '../../utils/content-types';
import { generateRSS } from '../../utils/rss';
Expand Down
5 changes: 4 additions & 1 deletion app/[contentType]/tags/[tag]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { notFound } from 'next/navigation';
import { Container, ContentList } from '../../../../components';
import { getContentWithTag, IContentType } from '../../../../utils/content';
import {
getContentWithTag,
type IContentType,
} from '../../../../utils/content';
import { contentTypesMap } from '../../../../utils/content-types';

// TODO: I need to rethink the tags page. I don't think I want to have a page for each tag.
Expand Down
2 changes: 1 addition & 1 deletion app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Metadata } from 'next';
import type { Metadata } from 'next';
import { Container, Header, Testimonials, WorkItem } from '../components';
import info from '../config/index.json' assert { type: 'json' };
import testimonials from '../config/testimonials.json' assert { type: 'json' };
Expand Down
1 change: 0 additions & 1 deletion components/back-button.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use client';

import { useRouter } from 'next/navigation';
import React from 'react';
import { ChevronLeft } from 'react-feather';

export default function BackButton() {
Expand Down
2 changes: 1 addition & 1 deletion components/cards.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import clsx from 'clsx';
import Image from 'next/image';
import Link from 'next/link';
import { IContent } from '../utils/content';
import type { IContent } from '../utils/content';

export interface ICard {
basePath: string;
Expand Down
2 changes: 1 addition & 1 deletion components/container.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FC, HTMLAttributes } from 'react';
import type { FC, HTMLAttributes } from 'react';
import { cn } from '../utils/cn';

export type IWidth = 'default' | 'bleed' | 'narrow';
Expand Down
4 changes: 2 additions & 2 deletions components/content-list.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { HTMLAttributes } from 'react';
import { IContent, IContentType } from '../utils/content';
import type { HTMLAttributes } from 'react';
import type { IContent, IContentType } from '../utils/content';
import { Cards, WorkItem } from './';

interface ContentListProps extends HTMLAttributes<HTMLElement> {
Expand Down
2 changes: 1 addition & 1 deletion components/hamburger.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { HTMLAttributes, useContext } from 'react';
import { type HTMLAttributes, useContext } from 'react';
import { cn } from '../utils/cn';
import { menuContext } from './MenuContext';

Expand Down
2 changes: 1 addition & 1 deletion components/nav/nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { useTheme } from 'next-themes';
import Link from 'next/link';
import { ReactNode, useEffect, useState } from 'react';
import { type ReactNode, useEffect, useState } from 'react';
import { Loader, Moon, Rss, Sun } from 'react-feather';
import { Logo } from '../';
import SiteConfig from '../../config/index.json' assert { type: 'json' };
Expand Down
2 changes: 1 addition & 1 deletion components/notes/note.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Link from 'next/link';
import React from 'react';
import { Calendar } from 'react-feather';
import { IContent } from '../../utils/content';
import type { IContent } from '../../utils/content';

export function Note({ date, title, slug, basePath }: IContent) {
return (
Expand Down
2 changes: 1 addition & 1 deletion components/notes/notes.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { IContent } from '../../utils/content';
import type { IContent } from '../../utils/content';
import { Note } from './note';

interface INotes {
Expand Down
2 changes: 1 addition & 1 deletion components/works/work.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Link from 'next/link';
import { ArrowRight } from 'react-feather';
import placeholderImg from '../../public/images/placeholder.jpg';
import { cn } from '../../utils/cn';
import { IContent } from '../../utils/content';
import type { IContent } from '../../utils/content';

// TODO: use some type of hash function to generate the colors
const colorsLookup = {
Expand Down

0 comments on commit 68dabb9

Please sign in to comment.