-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
1,162 additions
and
1,069 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
import React from 'react' | ||
import { Icon, TextInput, Button, Checkbox } from '@aleph-front/aleph-core' | ||
import { | ||
Icon, | ||
TextInput, | ||
Button, | ||
Checkbox, | ||
FormError, | ||
} from '@aleph-front/aleph-core' | ||
import { useAddSSHKeys, useSSHKeyItem } from '@/hooks/form/useAddSSHKeys' | ||
import { SSHKeyItemProps, AddSSHKeysProps } from './types' | ||
import NoisyContainer from '@/components/common/NoisyContainer' | ||
|
@@ -16,47 +22,56 @@ const SSHKeyItem = React.memo((props: SSHKeyItemProps) => { | |
} = useSSHKeyItem(props) | ||
|
||
return ( | ||
<div tw="flex gap-6"> | ||
<div tw="flex items-start pt-11"> | ||
<Checkbox {...isSelectedCtrl.field} {...isSelectedCtrl.fieldState} /> | ||
</div> | ||
<div tw="flex-auto flex flex-col md:flex-row gap-6"> | ||
<div tw="flex-auto"> | ||
<TextInput | ||
{...keyCtrl.field} | ||
{...keyCtrl.fieldState} | ||
label={`Key #${index + 1}`} | ||
placeholder="AAAAB3NzaC1yc2EAAAAB ... B3NzaaC1==" | ||
disabled={!isNew} | ||
/> | ||
</div> | ||
<div tw="md:w-4/12"> | ||
<TextInput | ||
{...labelCtrl.field} | ||
{...labelCtrl.fieldState} | ||
label={`Label`} | ||
placeholder="[email protected]" | ||
disabled={!isNew} | ||
<> | ||
{isSelectedCtrl.fieldState.error && ( | ||
<FormError error={isSelectedCtrl.fieldState.error} /> | ||
)} | ||
<div tw="flex gap-6"> | ||
<div tw="flex items-start pt-11"> | ||
<Checkbox | ||
{...isSelectedCtrl.field} | ||
{...isSelectedCtrl.fieldState} | ||
checked={!!isSelectedCtrl.field.value} | ||
/> | ||
</div> | ||
{allowRemove && ( | ||
<div tw="w-14 flex items-end md:justify-center pb-2"> | ||
{isNew && ( | ||
<Button | ||
color="main2" | ||
variant="secondary" | ||
kind="neon" | ||
size="regular" | ||
type="button" | ||
onClick={handleRemove} | ||
> | ||
<Icon name="trash" /> | ||
</Button> | ||
)} | ||
<div tw="flex-auto flex flex-col md:flex-row gap-6"> | ||
<div tw="flex-auto"> | ||
<TextInput | ||
{...keyCtrl.field} | ||
{...keyCtrl.fieldState} | ||
label={`Key #${index + 1}`} | ||
placeholder="AAAAB3NzaC1yc2EAAAAB ... B3NzaaC1==" | ||
disabled={!isNew} | ||
/> | ||
</div> | ||
<div tw="md:w-4/12"> | ||
<TextInput | ||
{...labelCtrl.field} | ||
{...labelCtrl.fieldState} | ||
label={`Label`} | ||
placeholder="[email protected]" | ||
disabled={!isNew} | ||
/> | ||
</div> | ||
)} | ||
{allowRemove && ( | ||
<div tw="w-14 flex items-end md:justify-center pb-2"> | ||
{isNew && ( | ||
<Button | ||
color="main2" | ||
variant="secondary" | ||
kind="neon" | ||
size="regular" | ||
type="button" | ||
onClick={handleRemove} | ||
> | ||
<Icon name="trash" /> | ||
</Button> | ||
)} | ||
</div> | ||
)} | ||
</div> | ||
</div> | ||
</div> | ||
</> | ||
) | ||
}) | ||
SSHKeyItem.displayName = 'SSHKeyItem' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.