-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
init branch phuc-dev #27
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
7756fcb
init branch phuc-dev
minhphuc010194 061f013
init branch phuc-dev
minhphuc010194 589327f
FEAT: create post and storage to database
minhphuc010194 8032740
render post list
minhphuc010194 0614c31
remove yarn.clock
minhphuc010194 a524aef
clear console log
minhphuc010194 b874626
pending render page post
minhphuc010194 dda42a7
get post with id
minhphuc010194 2ba972c
merge branch
minhphuc010194 bcfed73
render a post
minhphuc010194 a3f9360
reinstall package
minhphuc010194 bed611d
fix bug not build on vercel
minhphuc010194 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,11 @@ | ||
{ | ||
"files.exclude": { | ||
"**/.git": true, | ||
"**/.svn": true, | ||
"**/.hg": true, | ||
"**/CVS": true, | ||
"**/.DS_Store": true, | ||
"**/Thumbs.db": true, | ||
"**/node_modules": true | ||
} | ||
} |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
version: "3.8" | ||
name: nextjs-template | ||
# name: nextjs-template | ||
|
||
services: | ||
postgres: | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import { type FC, useRef } from 'react'; | ||
import SunEditor, { buttonList } from 'suneditor-react'; | ||
import SunEditorCore from 'suneditor/src/lib/core'; | ||
import 'suneditor/dist/css/suneditor.min.css'; | ||
|
||
type PropTypes = { | ||
autoFocus?: boolean; | ||
width?: string; | ||
height?: string; | ||
onChange?: ((content: string) => void) | undefined; | ||
placeholder?: string; | ||
onSave?: ((content: string) => void) | undefined; | ||
}; | ||
const PagePostEditor: FC<PropTypes> = (props) => { | ||
const { | ||
autoFocus = true, | ||
width = '100%', | ||
height = '300px', | ||
onChange, | ||
placeholder, | ||
onSave, | ||
} = props; | ||
const editor = useRef<SunEditorCore>(); | ||
// The sunEditor parameter will be set to the core suneditor instance when this function is called | ||
const getSunEditorInstance = (sunEditor: SunEditorCore) => { | ||
editor.current = sunEditor; | ||
}; | ||
|
||
return ( | ||
<SunEditor | ||
autoFocus={autoFocus} | ||
width={width} | ||
height={height} | ||
onChange={onChange} | ||
placeholder={placeholder} | ||
onSave={onSave} | ||
setOptions={{ | ||
buttonList: [ | ||
['undo', 'redo'], | ||
['font', 'fontSize', 'formatBlock'], | ||
['paragraphStyle', 'blockquote'], | ||
['bold', 'underline', 'italic', 'strike', 'subscript', 'superscript'], | ||
['fontColor', 'hiliteColor', 'textStyle'], | ||
['removeFormat'], | ||
// '/', // Line break | ||
['outdent', 'indent'], | ||
['align', 'horizontalRule', 'list', 'lineHeight'], | ||
['table', 'link', 'image', 'video', 'audio' /** ,'math' */], // You must add the 'katex' library at options to use the 'math' plugin. | ||
/** ['imageGallery'] */ // You must add the "imageGalleryUrl". | ||
['fullScreen', 'showBlocks', 'codeView'], | ||
['preview', 'print'], | ||
['save'], | ||
], | ||
// Other option | ||
}} | ||
getSunEditorInstance={getSunEditorInstance} | ||
/> | ||
); | ||
}; | ||
export default PagePostEditor; |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ủa sao xoá tên vậy?