-
-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
732a261
commit b94340e
Showing
47 changed files
with
698 additions
and
387 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
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,6 +1,6 @@ | ||
{ | ||
"name": "blinko", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"private": true, | ||
"browser": { | ||
"fs": false, | ||
|
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,50 @@ | ||
import { observer } from "mobx-react-lite"; | ||
import { BlinkoStore } from '@/store/blinkoStore'; | ||
import { Card } from '@nextui-org/react'; | ||
import { _ } from '@/lib/lodash'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { RootStore } from '@/store'; | ||
import { motion } from "framer-motion" | ||
import { FilesAttachmentRender } from '@/components/Common/Editor/attachmentsRender'; | ||
import { ContextMenuTrigger } from '@/components/Common/ContextMenu'; | ||
import { MarkdownRender } from '@/components/Common/MarkdownRender'; | ||
import { Icon } from '@iconify/react'; | ||
import dayjs from '@/lib/dayjs'; | ||
import { Note, NoteType } from '@/server/types'; | ||
|
||
export const BlinkoCard = observer(({ blinkoItem }: { blinkoItem: Note }) => { | ||
const { t } = useTranslation(); | ||
const blinko = RootStore.Get(BlinkoStore) | ||
|
||
return <motion.div key={blinkoItem.id} className='w-full' style={{ boxShadow: '0 0 15px -5px #5858581a' }}> | ||
<ContextMenuTrigger id="blink-item-context-menu" > | ||
<div onContextMenu={e => { | ||
blinko.curSelectedNote = _.cloneDeep(blinkoItem) | ||
}} | ||
onClick={() => { | ||
if (blinko.isMultiSelectMode) { | ||
blinko.onMultiSelectNote(blinkoItem.id!) | ||
} | ||
}}> | ||
<Card shadow='none' className={`mb-4 flex flex-col p-4 bg-background transition-all ${blinko.curMultiSelectIds?.includes(blinkoItem.id!) ? 'border-2 border-primary' : ''}`}> | ||
<div className='mb-2 text-xs text-desc'>{dayjs(blinkoItem.createdAt).fromNow()}</div> | ||
<MarkdownRender content={blinkoItem.content} /> | ||
<div className={blinkoItem.attachments?.length != 0 ? 'my-2' : ''}> | ||
<FilesAttachmentRender files={blinkoItem.attachments ?? []} preview /> | ||
</div> | ||
{ | ||
blinkoItem.type == NoteType.BLINKO ? | ||
<div className='flex items-center justify-start mt-2'> | ||
<Icon className='text-yellow-500' icon="basil:lightning-solid" width="12" height="12" /> | ||
<div className='text-desc text-xs font-bold ml-1'>{t('blinko')}</div> | ||
</div> : | ||
<div className='flex items-center justify-start mt-2'> | ||
<Icon className='text-blue-500' icon="solar:notes-minimalistic-bold-duotone" width="12" height="12" /> | ||
<div className='text-desc text-xs font-bold ml-1'>{t('note')}</div> | ||
</div> | ||
} | ||
</Card> | ||
</div> | ||
</ContextMenuTrigger> | ||
</motion.div> | ||
}) |
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 |
---|---|---|
@@ -1,8 +1,16 @@ | ||
import { observer } from "mobx-react-lite" | ||
|
||
export const Item = observer(({ leftContent, rightContent }: any) => { | ||
return <div className="flex flex-col md:flex-row items-center py-2"> | ||
<div className="font-bold">{leftContent}</div> | ||
<div className="ml-auto mt-2 md:mt-0">{rightContent}</div> | ||
</div> | ||
export const Item = observer(({ leftContent, rightContent, type = 'row' }: any) => { | ||
|
||
if (type == 'col') { | ||
return <div className="flex flex-col py-2"> | ||
<div className="font-bold">{leftContent}</div> | ||
<div className="mt-2 w-full">{rightContent}</div> | ||
</div> | ||
} else { | ||
return <div className="flex flex-row items-center py-2"> | ||
<div className="font-bold">{leftContent}</div> | ||
<div className="ml-auto">{rightContent}</div> | ||
</div> | ||
} | ||
}) |
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.