forked from anydistro/bxt
-
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.
This commit changes multiple things to make manual commiting easier: - Allows to hide pending commit drawer so multiple commits now possible - Add drag-n-drop support to a commit modal window so you can append existing commits
- Loading branch information
1 parent
1e2cd0a
commit 7edc7e9
Showing
5 changed files
with
206 additions
and
110 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { Button, Drawer, DrawerProps, Menu } from "react-daisyui"; | ||
import CommitCard from "./CommitCard"; | ||
|
||
type CommitDrawerProps = DrawerProps & { | ||
isOpen: boolean; | ||
commits: ICommit[]; | ||
onPush: (commits: ICommit[]) => void; | ||
onCardActivate: (commit: ICommit) => void; | ||
onCardDelete: (section: ISection) => void; | ||
}; | ||
|
||
export default (props: CommitDrawerProps) => { | ||
return ( | ||
<Drawer | ||
{...props} | ||
open={props.commits.length > 0 && props.isOpen} | ||
contentClassName="fm-content h-full" | ||
className="h-full" | ||
side={ | ||
<div> | ||
<label | ||
htmlFor="my-drawer-2" | ||
className="drawer-overlay" | ||
></label> | ||
<Menu className="h-screen p-4 w-100 space-y-4 bg-accent"> | ||
<li className="text-3xl font-bold text-white"> | ||
Pending commits | ||
</li> | ||
{props.commits?.map((value) => { | ||
return ( | ||
<Menu.Item> | ||
<CommitCard | ||
onActivate={props.onCardActivate} | ||
commit={value} | ||
onDeleteRequested={props.onCardDelete} | ||
/> | ||
</Menu.Item> | ||
); | ||
})} | ||
<div className="grow"></div> | ||
<Button | ||
color="ghost" | ||
className="text-white" | ||
onClick={(e) => props.onPush(props.commits)} | ||
> | ||
Push commits | ||
</Button> | ||
</Menu> | ||
</div> | ||
} | ||
end={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
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 |
---|---|---|
|
@@ -5,7 +5,6 @@ | |
* | ||
*/ | ||
interface ICommit { | ||
id: string; | ||
section: ISection; | ||
packages: IPackageUpload[]; | ||
} |
Oops, something went wrong.