From cb9ce4179715e4a9de96e6079d6847ef315927ea Mon Sep 17 00:00:00 2001 From: David Disu Date: Thu, 16 Jun 2022 13:27:59 +0100 Subject: [PATCH] Save settings --- libs/remix-ui/settings/src/lib/github-settings.tsx | 4 ++-- libs/remix-ui/settings/src/lib/remix-ui-settings.tsx | 12 ++++++++++-- libs/remix-ui/settings/src/types/index.ts | 2 +- libs/remix-ui/workspace/src/lib/components/clone.tsx | 12 ++++++------ .../workspace/src/lib/remix-ui-workspace.tsx | 8 ++------ 5 files changed, 21 insertions(+), 17 deletions(-) diff --git a/libs/remix-ui/settings/src/lib/github-settings.tsx b/libs/remix-ui/settings/src/lib/github-settings.tsx index 33c3fa17c0..a91749e478 100644 --- a/libs/remix-ui/settings/src/lib/github-settings.tsx +++ b/libs/remix-ui/settings/src/lib/github-settings.tsx @@ -21,7 +21,7 @@ export function GithubSettings (props: GithubSettingsProps) { // api key settings const saveGithubToken = () => { - props.saveTokenToast(githubToken) + props.saveTokenToast(githubToken, githubUserName, githubEmail) } const removeToken = () => { @@ -41,7 +41,7 @@ export function GithubSettings (props: GithubSettingsProps) {
handleChangeTokenState(e)} value={ githubToken } />
- +
diff --git a/libs/remix-ui/settings/src/lib/remix-ui-settings.tsx b/libs/remix-ui/settings/src/lib/remix-ui-settings.tsx index 7b112eef9c..62d1e07cfb 100644 --- a/libs/remix-ui/settings/src/lib/remix-ui-settings.tsx +++ b/libs/remix-ui/settings/src/lib/remix-ui-settings.tsx @@ -349,8 +349,16 @@ export const RemixUiSettings = (props: RemixUiSettingsProps) => { {state.message ? : null} {generalConfig()} { saveTokenToast(props.config, dispatchToast, githubToken, "gist-access-token") }} - removeTokenToast={() => { removeTokenToast(props.config, dispatchToast, "gist-access-token") }} + saveTokenToast={(githubToken: string, githubUserName: string, githubEmail: string) => { + saveTokenToast(props.config, dispatchToast, githubToken, "gist-access-token") + saveTokenToast(props.config, dispatchToast, githubUserName, "github-user-name") + saveTokenToast(props.config, dispatchToast, githubEmail, "github-email") + }} + removeTokenToast={() => { + removeTokenToast(props.config, dispatchToast, "gist-access-token") + removeTokenToast(props.config, dispatchToast, "github-user-name") + removeTokenToast(props.config, dispatchToast, "github-email") + }} /> {token('etherscan')} {swarmSettings()} diff --git a/libs/remix-ui/settings/src/types/index.ts b/libs/remix-ui/settings/src/types/index.ts index 827820b870..b9f3fcfbd3 100644 --- a/libs/remix-ui/settings/src/types/index.ts +++ b/libs/remix-ui/settings/src/types/index.ts @@ -1,4 +1,4 @@ export interface GithubSettingsProps { - saveTokenToast: (githubToken: string) => void, + saveTokenToast: (githubToken: string, githubUserName: string, githubEmail: string) => void, removeTokenToast: () => void } diff --git a/libs/remix-ui/workspace/src/lib/components/clone.tsx b/libs/remix-ui/workspace/src/lib/components/clone.tsx index f6f4bf49df..fa92552b22 100644 --- a/libs/remix-ui/workspace/src/lib/components/clone.tsx +++ b/libs/remix-ui/workspace/src/lib/components/clone.tsx @@ -3,21 +3,21 @@ import { OverlayTrigger, Popover } from 'react-bootstrap'; const popover = ( - Clone workspace + Clone Repository
) -export const CloneWorkspace = () => ( - - +export const CloneRepository = () => ( + + ) diff --git a/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx b/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx index c4d0e4d5f6..40779306ee 100644 --- a/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx +++ b/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx @@ -2,7 +2,7 @@ import React, { useState, useEffect, useRef, useContext } from 'react' // eslint import { FileExplorer } from './components/file-explorer' // eslint-disable-line import './css/remix-ui-workspace.css' import { FileSystemContext } from './contexts' -import { CloneWorkspace } from './components/clone' +import { CloneRepository } from './components/clone' const canUpload = window.File || window.FileReader || window.FileList || window.Blob @@ -159,7 +159,6 @@ export function Workspace () { -
+ - - - -