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
8 changed files
with
101 additions
and
31 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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { GoGoal } from 'react-icons/go' | ||
|
||
import { cn } from '@/util/util' | ||
|
||
const ObjectiveBoard = () => { | ||
return ( | ||
<div className={cn('w-[290px] h-full border-l pl-2 flex flex-col bg-gray-50 shadow-md')}> | ||
<div className="h-[44px] flex items-center gap-1.5 relative after:shadow after:absolute after:bottom-0 after:w-full after:h-1"> | ||
<GoGoal /> Objective | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default ObjectiveBoard |
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,43 @@ | ||
import { useAtom } from 'jotai' | ||
import { AiOutlineLeft, AiOutlineRight } from 'react-icons/ai' | ||
|
||
import { type App, appAtom } from '@/Agenda3/models/app' | ||
import { cn } from '@/util/util' | ||
|
||
import Backlog from './Backlog' | ||
import ObjectiveBoard from './ObjectiveBoard' | ||
import TimeBox from './timebox/TimeBox' | ||
|
||
const Sidebar = () => { | ||
const [app, setApp] = useAtom(appAtom) | ||
|
||
return ( | ||
<div className={cn('transition-all group/sidebar relative', app.rightSidebarFolded ? 'w-0' : 'w-[290px]')}> | ||
<SidebarContent sidebarType={app.sidebarType} /> | ||
{/* folded option bar */} | ||
<div className="w-[16px] h-full absolute -left-[16px] top-0 flex items-center z-10 opacity-0 group-hover/sidebar:opacity-100 transition-opacity"> | ||
<div | ||
className="bg-[#f0f0f0] h-[50px] w-full rounded-tl rounded-bl flex items-center text-gray-400 hover:bg-gray-200 cursor-pointer border-l border-t border-b" | ||
onClick={() => setApp((_app) => ({ ..._app, rightSidebarFolded: !_app.rightSidebarFolded }))} | ||
> | ||
{app.rightSidebarFolded ? <AiOutlineLeft /> : <AiOutlineRight />} | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
function SidebarContent({ sidebarType }: { sidebarType: App['sidebarType'] }) { | ||
switch (sidebarType) { | ||
case 'backlog': | ||
return <Backlog /> | ||
case 'timebox': | ||
return <TimeBox onChangeType={() => {}} /> | ||
case 'objective': | ||
return <ObjectiveBoard /> | ||
default: | ||
return null | ||
} | ||
} | ||
|
||
export default Sidebar |
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,20 @@ | ||
import { useSetAtom } from 'jotai' | ||
import React from 'react' | ||
import { GoGoal } from 'react-icons/go' | ||
|
||
import { appAtom } from '@/Agenda3/models/app' | ||
|
||
const WeekNumber = ({ weekNumber }: { weekNumber: number }) => { | ||
const setApp = useSetAtom(appAtom) | ||
const onClick = () => { | ||
setApp((_app) => ({ ..._app, sidebarType: 'objective' })) | ||
} | ||
return ( | ||
<div onClick={onClick} className="faiz-week-number text-xs flex gap-1 items-center cursor-pointer"> | ||
W{weekNumber} | ||
<GoGoal /> | ||
</div> | ||
) | ||
} | ||
|
||
export default WeekNumber |
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