feat: add update from github modal content

pull/12372/head
Joel 1 year ago
parent 43254ceeb0
commit da15a25cf5

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

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

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

Loading…
Cancel
Save