generated from haydenull/logseq-plugin-react-boilerplate
-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
Showing
16 changed files
with
186 additions
and
57 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 |
---|---|---|
|
@@ -23,4 +23,5 @@ export type Filter = { | |
id: string | ||
name: string | ||
query: string | ||
color: string | ||
} |
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,31 @@ | ||
import { Button, ColorPicker } from 'antd' | ||
import type { Color } from 'antd/es/color-picker' | ||
|
||
import { BACKGROUND_COLOR } from '@/constants/agenda' | ||
|
||
const ColorPickerCom = ({ value, onChange }: { value?: string; onChange?: (value: string) => void }) => { | ||
// const [color, setColor] = useState<Color | string>(BACKGROUND_COLOR[DEFAULT_BG_COLOR_NAME]) | ||
|
||
// const bgColor = useMemo<string>(() => (typeof color === 'string' ? color : color.toHexString()), [color]) | ||
|
||
const btnStyle: React.CSSProperties = { | ||
backgroundColor: value, | ||
} | ||
|
||
return ( | ||
<ColorPicker | ||
disabledAlpha | ||
presets={[{ label: 'Recommend', colors: Object.values(BACKGROUND_COLOR) }]} | ||
value={value} | ||
onChange={(color, hex) => { | ||
onChange?.(hex) | ||
}} | ||
> | ||
<Button block type="primary" style={btnStyle}> | ||
Agenda | ||
</Button> | ||
</ColorPicker> | ||
) | ||
} | ||
|
||
export default ColorPickerCom |
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,33 @@ | ||
import { type AgendaTask } from '@/types/task' | ||
|
||
const Group = ({ task, type }: { task: AgendaTask; type: 'page' | 'filter' }) => { | ||
return type === 'page' ? <RenderPage task={task} /> : <RenderFilter task={task} /> | ||
} | ||
|
||
function RenderPage({ task }: { task: AgendaTask }) { | ||
return ( | ||
<> | ||
{task.project.isJournal ? null : ( | ||
<div className="text-gray-400 text-xs flex gap-1 items-center"> | ||
<span className="w-2 h-2 rounded-full" style={{ backgroundColor: task.project.bgColor }} /> | ||
<span>{task.project?.originalName}</span> | ||
</div> | ||
)} | ||
</> | ||
) | ||
} | ||
|
||
function RenderFilter({ task }: { task: AgendaTask }) { | ||
return ( | ||
<div className="flex gap-2 items-center"> | ||
{task.filters?.map((filter) => ( | ||
<div key={filter.id} className="text-gray-400 text-xs flex gap-1 items-center border px-1 rounded-full"> | ||
<span className="w-2 h-2 rounded-full" style={{ backgroundColor: filter.color }} /> | ||
<span>{filter.name}</span> | ||
</div> | ||
))} | ||
</div> | ||
) | ||
} | ||
|
||
export default Group |
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
Oops, something went wrong.