Skip to content

Commit

Permalink
Optimized code
Browse files Browse the repository at this point in the history
  • Loading branch information
fkorotkov committed Nov 1, 2022
1 parent 005ccaa commit 221fac6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
13 changes: 3 additions & 10 deletions src/components/repositories/RepositoryDangerSettings.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
import React, { useState } from 'react';
import React from 'react';
import environment from '../../createRelayEnvironment';
import { commitMutation, createFragmentContainer } from 'react-relay';
import { graphql } from 'babel-plugin-relay/macro';
import Card from '@mui/material/Card';
import CardContent from '@mui/material/CardContent';
import CardHeader from '@mui/material/CardHeader';
import FormControl from '@mui/material/FormControl';
import { RepositoryDangerSettings_repository } from './__generated__/RepositoryDangerSettings_repository.graphql';
import { navigateHelper } from '../../utils/navigateHelper';
import { useNavigate } from 'react-router-dom';
import {
RepositoryDangerSettingsDeleteMutationResponse,
RepositoryDangerSettingsDeleteMutationVariables,
} from './__generated__/RepositoryDangerSettingsDeleteMutation.graphql';
import InputLabel from '@mui/material/InputLabel';
import Input from '@mui/material/Input';
import { FormHelperText, ListItem, ListItemText } from '@mui/material';
import { ListItem, ListItemText } from '@mui/material';
import Button from '@mui/material/Button';
import Check from '@mui/icons-material/Check';
import List from '@mui/material/List';

const deleteMutation = graphql`
Expand All @@ -34,14 +30,11 @@ interface Props {

function RepositoryDangerSettings(props: Props) {
let navigate = useNavigate();
let [inputValue, setInputValue] = useState('');
let [securedVariableName, setSecuredVariableName] = useState(undefined);

function deleteCurrentRepository() {
let valueToSecure = inputValue;
const variables: RepositoryDangerSettingsDeleteMutationVariables = {
input: {
clientMutationId: props.repository.name, // todo: replace with a hash of valueToSecure
clientMutationId: props.repository.name,
repositoryId: props.repository.id,
},
};
Expand Down
1 change: 0 additions & 1 deletion src/components/settings/OwnerScopedTokenDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import {
OwnerScopedTokenDialogMutationVariables,
} from './__generated__/OwnerScopedTokenDialogMutation.graphql';
import TextField from '@mui/material/TextField';
import { Slider } from '@mui/material';

const styles = theme =>
createStyles({
Expand Down

0 comments on commit 221fac6

Please sign in to comment.