-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add fileUpload, editor, and tag/category input component and cr…
…eate post page create custom react context and reducer also refactor code and folder structure, and editorjs plugin dependencies
- Loading branch information
1 parent
f6ec209
commit a76567d
Showing
16 changed files
with
502 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,7 +72,6 @@ export const SHOW_ALL_TAGS = gql` | |
query ShowAllTags { | ||
showAllTag { | ||
name | ||
id | ||
} | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
const KEY_CODES = { | ||
comma: 188, | ||
enter: 13, | ||
}; | ||
|
||
export const DELIMITER = [KEY_CODES.comma, KEY_CODES.enter]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { useTagSource } from "src/context/tag.context"; | ||
|
||
export type TagState = { | ||
suggestions: string[]; | ||
tags: string[]; | ||
input: string; | ||
}; | ||
|
||
export type TagProviderType = ReturnType<typeof useTagSource>; | ||
|
||
export type TagAction = | ||
| { | ||
type: "insert"; | ||
payload: { | ||
name: string; | ||
}; | ||
} | ||
| { | ||
type: "delete"; | ||
payload: { | ||
index: number; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Box } from "@chakra-ui/react"; | ||
import EditorJS from "@editorjs/editorjs"; | ||
import Header from "@editorjs/header"; | ||
|
||
const Editor = () => { | ||
const editor = new EditorJS({ | ||
holder: "editorjs", | ||
tools: { | ||
headers: Header, | ||
}, | ||
autofocus: false, | ||
}); | ||
|
||
return ( | ||
<Box w="full" h="full"> | ||
<div id="editorjs"></div> | ||
</Box> | ||
); | ||
}; | ||
|
||
export default Editor; |
Oops, something went wrong.