Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
mjadach-iv committed Nov 12, 2024
1 parent db86f0a commit 5778552
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/components/Modal/node/AddAliasModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const CreateAliasModal = (props: CreateAliasModalProps) => {

const aliasesArr = aliases ? Object.keys(aliases) : [];
const aliasPeerIdsArr = aliases ? Object.values(aliases) : [];
const aliasIncludesASpace = alias.includes(" ");
const aliasIncludesASpace = alias.includes(' ');

const setPropPeerId = () => {
if (props.peerId) set_peerId(props.peerId);
Expand Down Expand Up @@ -172,14 +172,22 @@ export const CreateAliasModal = (props: CreateAliasModalProps) => {
placeholder="Alias"
onChange={handleChangeAlias}
value={alias}
error={duplicateAlias || alias.includes(" ")}
helperText={duplicateAlias ? 'This is a duplicate alias!' : aliasIncludesASpace ? 'An alias can\'t include a space' : ''}
error={duplicateAlias || alias.includes(' ')}
helperText={
duplicateAlias
? 'This is a duplicate alias!'
: aliasIncludesASpace
? "An alias can't include a space"
: ''
}
style={{ minHeight: '79px' }}
/>
</SDialogContent>
<DialogActions>
<Button
disabled={alias.length === 0 || peerId.length === 0 || duplicateAlias || duplicatePeerId || aliasIncludesASpace}
disabled={
alias.length === 0 || peerId.length === 0 || duplicateAlias || duplicatePeerId || aliasIncludesASpace
}
onClick={handleAddAlias}
style={{
marginRight: '16px',
Expand Down

0 comments on commit 5778552

Please sign in to comment.