feat: add update from github modal content

This commit is contained in:
Joel 2024-11-05 15:27:08 +08:00
parent 43254ceeb0
commit da15a25cf5
3 changed files with 17 additions and 6 deletions

View File

@ -32,9 +32,14 @@ const UpdatePlugin = () => {
payload: {
type: PluginSource.github,
github: {
repo: 'repo_xxx',
originalPluginId: 'original_xxx',
version: 'version_xxx',
originalPackageInfo: {
id: '111',
repo: 'aaa/bbb',
version: 'xxx',
url: 'aaa/bbb',
currVersion: '1.2.3',
currPackage: 'pack1',
} as any,
},
},
onCancelCallback: () => {

View File

@ -18,6 +18,7 @@ import { useTranslation } from 'react-i18next'
type InstallFromGitHubProps = {
updatePayload?: UpdateFromGitHubPayload
onClose: () => void
onSuccess: () => void
}
const InstallFromGitHub: React.FC<InstallFromGitHubProps> = ({ updatePayload, onClose }) => {

View File

@ -2,6 +2,7 @@
import type { FC } from 'react'
import React from 'react'
import type { UpdateFromGitHubPayload } from '../types'
import InstallFromGitHub from '../install-plugin/install-from-github'
type Props = {
payload: UpdateFromGitHubPayload
@ -11,11 +12,15 @@ type Props = {
const FromGitHub: FC<Props> = ({
payload,
onSave,
onCancel,
}) => {
return (
<div>
{JSON.stringify(payload)}
</div>
<InstallFromGitHub
updatePayload={payload}
onClose={onCancel}
onSuccess={onSave}
/>
)
}
export default React.memo(FromGitHub)