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 - Adds drag-n-drop support to a commit modal window so you can append existing commits - Adds an option to remove already added packages - Adds progress indicator for package upload
- Loading branch information
1 parent
1e2cd0a
commit 6541b70
Showing
11 changed files
with
472 additions
and
274 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,58 @@ | ||
import { Button, Drawer, DrawerProps, Menu } from "react-daisyui"; | ||
import CommitCard from "./CommitCard"; | ||
import { SectionUtils } from "../utils/SectionUtils"; | ||
|
||
type CommitDrawerProps = DrawerProps & { | ||
isOpen: boolean; | ||
commits: Commits; | ||
onPush: (commits: Commits) => void; | ||
onCardActivate: (section: ISection, commit: Commit) => void; | ||
onCardDelete: (section: ISection) => void; | ||
}; | ||
|
||
export default (props: CommitDrawerProps) => { | ||
return ( | ||
<Drawer | ||
{...props} | ||
open={props.commits.size > 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> | ||
{Array.from(props.commits).map(([section, commit]) => { | ||
return ( | ||
<Menu.Item> | ||
<CommitCard | ||
section={SectionUtils.fromString( | ||
section | ||
)} | ||
onActivate={props.onCardActivate} | ||
commit={commit} | ||
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
Oops, something went wrong.