-
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(daily-notes): Add daily notes to home
- Loading branch information
Showing
21 changed files
with
75 additions
and
49 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
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
55 changes: 55 additions & 0 deletions
55
src/app/(user)/components/workspace/components/button-extension.tsx
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,55 @@ | ||
import { Node } from '@tiptap/core'; | ||
import { mergeAttributes, nodeInputRule, NodeViewWrapper, ReactNodeViewRenderer } from '@tiptap/react'; | ||
import React from 'react'; | ||
import { TbMoodCheck } from 'react-icons/tb'; | ||
|
||
import Button from '@/app/components/ui/button/button'; | ||
|
||
type ButtonExtensionComponentProps = { node: { attrs: { label: string, icon: () => JSX.Element } } }; | ||
|
||
function ButtonComponent({ node: { attrs: { label, icon } } }: ButtonExtensionComponentProps) { | ||
return ( | ||
<NodeViewWrapper> | ||
<Button label={label} intent="cta" icon={icon}></Button> | ||
</NodeViewWrapper> | ||
); | ||
} | ||
|
||
export default Node.create({ | ||
name: 'button', | ||
group: 'block', | ||
atom: true, | ||
parseHTML() { | ||
return [ | ||
{ | ||
tag: 'button' | ||
} | ||
]; | ||
}, | ||
addAttributes() { | ||
return { | ||
label: { | ||
default: null | ||
}, | ||
icon: { | ||
default: null | ||
} | ||
}; | ||
}, | ||
renderHTML({ HTMLAttributes }) { | ||
return ['button', mergeAttributes(HTMLAttributes)]; | ||
}, | ||
addNodeView() { | ||
return ReactNodeViewRenderer(ButtonComponent); | ||
}, | ||
addInputRules() { | ||
return [nodeInputRule({ | ||
find: new RegExp('^action-mood$'), | ||
type: this.type, | ||
getAttributes: { | ||
label: 'How are you feeling today?', | ||
icon: () => <TbMoodCheck /> | ||
} | ||
})]; | ||
} | ||
}); |
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
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