mirror of
https://github.com/tiddly-gittly/TidGi-Desktop.git
synced 2025-12-06 02:30:47 -08:00
refactor: move AddWorkspace form into hooks
This commit is contained in:
parent
52fa8943e4
commit
67a70f2829
16 changed files with 264 additions and 228 deletions
40
src/components/TokenForm/index.tsx
Normal file
40
src/components/TokenForm/index.tsx
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
import React, { useState, useEffect } from 'react';
|
||||
import styled from 'styled-components';
|
||||
import { Paper, Typography } from '@material-ui/core';
|
||||
import SearchRepo from '@/components/github/SearchRepo';
|
||||
|
||||
import { GithubTokenForm } from '../github/git-token-form';
|
||||
|
||||
const SyncContainer = styled(Paper)`
|
||||
margin-top: 5px;
|
||||
`;
|
||||
const GithubRepoLink = styled(Typography)`
|
||||
cursor: pointer;
|
||||
opacity: 50%;
|
||||
&:hover {
|
||||
opacity: 100%;
|
||||
}
|
||||
`;
|
||||
|
||||
export function TokenForm(): JSX.Element {
|
||||
return (
|
||||
<SyncContainer elevation={2} square>
|
||||
<GithubTokenForm>
|
||||
{githubWikiUrl?.length > 0 ? (
|
||||
<GithubRepoLink onClick={async () => await window.service.native.open(githubWikiUrl)} variant="subtitle2" align="center">
|
||||
({githubWikiUrl})
|
||||
</GithubRepoLink>
|
||||
) : undefined}
|
||||
<SearchRepo
|
||||
githubWikiUrl={githubWikiUrl}
|
||||
accessToken={accessToken}
|
||||
githubWikiUrlSetter={githubWikiUrlSetter}
|
||||
userInfo={userInfo}
|
||||
currentTab={currentTab}
|
||||
wikiFolderNameSetter={wikiFolderNameSetter}
|
||||
isCreateMainWorkspace={isCreateMainWorkspace}
|
||||
/>
|
||||
</GithubTokenForm>
|
||||
</SyncContainer>
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue