|
|
|
@ -1,4 +1,4 @@ |
|
|
|
|
import { commitChange } from "../../../types"; |
|
|
|
|
import { branch, commitChange } from "../../../types"; |
|
|
|
|
import React from "react"; |
|
|
|
|
import path from "path"; |
|
|
|
|
import { gitActionsContext, pluginActionsContext } from "../../../state/context"; |
|
|
|
@ -8,10 +8,11 @@ import { faGlobe } from "@fortawesome/free-solid-svg-icons"; |
|
|
|
|
export interface CCommitDetailsItemsProps { |
|
|
|
|
commitChange: commitChange; |
|
|
|
|
isAheadOfRepo: boolean; |
|
|
|
|
openFileOnRemote: (file: string, hash: string) => void; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export const CommitDetailsItems = (props: CCommitDetailsItemsProps) => { |
|
|
|
|
const { commitChange, isAheadOfRepo } = props; |
|
|
|
|
const { commitChange, isAheadOfRepo, openFileOnRemote } = props; |
|
|
|
|
const actions = React.useContext(gitActionsContext) |
|
|
|
|
const pluginActions = React.useContext(pluginActionsContext) |
|
|
|
|
|
|
|
|
@ -22,6 +23,10 @@ export const CommitDetailsItems = (props: CCommitDetailsItemsProps) => { |
|
|
|
|
await pluginActions.openDiff(change) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const openRemote = () => { |
|
|
|
|
openFileOnRemote(commitChange.path, commitChange.hashModified) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function FunctionStatusIcons() { |
|
|
|
|
const status = commitChange.type |
|
|
|
|
return (<> |
|
|
|
@ -39,7 +44,8 @@ export const CommitDetailsItems = (props: CCommitDetailsItemsProps) => { |
|
|
|
|
<div className='text-secondary long-and-truncated'> {commitChange.path}</div> |
|
|
|
|
</div> |
|
|
|
|
<div className="d-flex align-items-end"> |
|
|
|
|
<FontAwesomeIcon icon={faGlobe} className="mr-1 align-self-center" /> |
|
|
|
|
{!isAheadOfRepo ? |
|
|
|
|
<FontAwesomeIcon role={'button'} icon={faGlobe} onClick={() => openRemote()} className="pointer mr-1 align-self-center" /> : <></>} |
|
|
|
|
<FunctionStatusIcons></FunctionStatusIcons> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|