mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 06:03:45 +01:00
Github Sync: initial commit
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
import { useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { useProjectContext } from '@/shared/context/project-context'
|
||||
import GithubLogo from '@/shared/svgs/github-logo'
|
||||
import IntegrationCard from '@/features/integrations-panel/integration-card'
|
||||
import GitSyncModal from './modals/git-sync-modal'
|
||||
import { GitSyncModalStatus } from '../types/git-sync-types'
|
||||
|
||||
const GitHubSyncCard = () => {
|
||||
const { t } = useTranslation()
|
||||
|
||||
const [showModal, setShowModal] = useState(false)
|
||||
const { projectId, name } = useProjectContext()
|
||||
const [modalStatus, setModalStatus] = useState<GitSyncModalStatus>('loading')
|
||||
|
||||
return (
|
||||
<>
|
||||
<IntegrationCard
|
||||
title={t('github')}
|
||||
description={t('sync_with_a_github_repository')}
|
||||
icon={<GithubLogo size={32} />}
|
||||
showPaywallBadge={false}
|
||||
onClick={() => setShowModal(true)}
|
||||
>
|
||||
</IntegrationCard>
|
||||
<GitSyncModal
|
||||
show={showModal}
|
||||
modalStatus={modalStatus}
|
||||
setModalStatus={setModalStatus}
|
||||
handleHide={() => {
|
||||
setShowModal(false)
|
||||
setModalStatus('loading')
|
||||
}}
|
||||
projectId={projectId}
|
||||
projectName={name}
|
||||
/>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export default GitHubSyncCard
|
||||
Reference in New Issue
Block a user