Skip to content

Commit

Permalink
removing duplicate code and inserting if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
zkdan committed Jan 24, 2024
1 parent 83f62f2 commit e30247b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 35 deletions.
47 changes: 21 additions & 26 deletions Eplant/views/GeneInfoView/component.tsx
Original file line number Diff line number Diff line change
@@ -1,39 +1,29 @@
import { useConfig } from '@eplant/config'
import GeneticElement from '@eplant/GeneticElement'
import { useConfig } from '@eplant/config'
import { usePanesDispatch, useViewID } from '@eplant/state'
import Stack from '@mui/material/Stack'
import { styled, useTheme } from '@mui/material/styles'
import Typography from '@mui/material/Typography'
import _ from 'lodash'
import React from 'react'
import {
GeneInfoViewAction,
GeneInfoViewData,
GeneInfoViewState,
} from './types'
import { View, ViewProps } from '../../View'
import { useViewData } from '../../View/viewData'
import { GeneModel } from './GeneModel'
import {
Alert,
Box,
Button,
ButtonProps,
LinearProgress,
Snackbar,
} from '@mui/material'
import ContentCopyIcon from '@mui/icons-material/ContentCopy'
import {
Alert,
Box,
Button,
ButtonProps,
IconButton,
LinearProgress,
Snackbar,
} from '@mui/material'
import ContentCopyIcon from '@mui/icons-material/ContentCopy'
import { IconButton } from '@mui/material'
import { setStroke } from '../eFP/Tooltips/EFPTooltip'
import Stack from '@mui/material/Stack'
import Typography from '@mui/material/Typography'
import { styled, useTheme } from '@mui/material/styles'
import _ from 'lodash'
import React from 'react'
import { View, ViewProps } from '../../View'
import { useViewData } from '../../View/viewData'
import { GeneModel } from './GeneModel'
import {
GeneInfoViewAction,
GeneInfoViewData,
GeneInfoViewState,
} from './types'

const SecondaryText = styled(Typography)(({ theme }) => ({
color: theme.palette.text.secondary,
Expand Down Expand Up @@ -308,7 +298,12 @@ export default function GeneInfoViewer({
{activeData.proteinSequence}
</CodeBody>
<IconButton
onClick={() => copyToClipboard(activeData.proteinSequence)}
onClick={() =>{
if(activeData.proteinSequence){
copyToClipboard(activeData.proteinSequence)
}
}
}
color='primary'
sx={{ ml: 1 }}
>
Expand Down
10 changes: 1 addition & 9 deletions Eplant/views/eFP/Viewer/MaskModal.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
// Import necessary dependencies from Material-UI
import React, { useState } from 'react'
import {
Modal,
Slider,
Typography,
Button,
useTheme,
DialogTitle,
} from '@mui/material'
import {
Modal,
Slider,
Typography,
Button,
useTheme,
DialogTitle,
} from '@mui/material'
import { useState } from 'react'
import { EFPViewerState } from './types'

// Modal component with a slider
Expand Down

0 comments on commit e30247b

Please sign in to comment.