Skip to content

Commit

Permalink
context updated
Browse files Browse the repository at this point in the history
  • Loading branch information
vishvamsinh28 committed Mar 1, 2024
1 parent f5d17bd commit a7e2a00
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 46 deletions.
4 changes: 2 additions & 2 deletions context/BlogContext.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createContext } from 'react';
import { BlogContextValue } from '@/types/context/BlogContext';
import { IDocs } from '@/types/post';

export default createContext<BlogContextValue>({});
export default createContext<IDocs>([]);
4 changes: 1 addition & 3 deletions context/DocsContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ import { createContext } from 'react';
import { DocsContextType } from '@/types/context/DocsContext';

const initialDocsContext: DocsContextType = {
post: {
title: '',
},
post: [],
navItems: {},
};

Expand Down
13 changes: 2 additions & 11 deletions context/GenericPostContext.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
import { createContext } from 'react';
import { Post } from '@/types/context/GenericPostContext';
import { IDocs } from '@/types/post';

const defaultPost: Post = {
title: '',
slug: '',
excerpt: '',
cover: '',
};

export default createContext<{ post: Post }>({
post: defaultPost,
});
export default createContext<IDocs>([]);
14 changes: 0 additions & 14 deletions types/context/BlogContext.ts

This file was deleted.

12 changes: 2 additions & 10 deletions types/context/DocsContext.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
export interface Post {
title: string;
slug?: string;
excerpt?: string;
cover?: string;
toc?: { id: string; title: string }[];
sectionTitle?: string;
releaseNoteLink?: string;
}
import { IDocs } from "../post";

export interface NavigationItem {
title: string;
Expand All @@ -17,6 +9,6 @@ export interface NavigationItems {
}

export interface DocsContextType {
post: Post;
post: IDocs;
navItems: NavigationItems;
}
6 changes: 0 additions & 6 deletions types/context/GenericPostContext.ts

This file was deleted.

0 comments on commit a7e2a00

Please sign in to comment.