Fix password field

This commit is contained in:
aet 2021-11-28 23:19:47 -05:00
parent 8f9ec73caf
commit 298482f70e
3 changed files with 15 additions and 4 deletions

View File

@ -28,11 +28,24 @@ export type BooleanField = {
type: FieldType.Checkbox type: FieldType.Checkbox
name: string name: string
value?: "✓" | string value?: "✓" | string
designation?: undefined
} }
export type ItemField = export type ItemField =
| TextField | TextField
| BooleanField | BooleanField
| {
name: string
designation: "username"
value: string
type?: undefined
}
| {
name: string
designation: "password"
value: string
type?: undefined
}
| { | {
// @TODO: This currently catches all item fields. // @TODO: This currently catches all item fields.
type: FieldType type: FieldType

View File

@ -119,10 +119,7 @@ export const ItemFieldValue: React.FC<{
export const ItemDetailsFieldValue: React.FC<{ export const ItemDetailsFieldValue: React.FC<{
field: ItemField field: ItemField
}> = ({ field }) => { }> = ({ field }) => {
if ( if (field.type === FieldType.Password || field.designation === "password") {
field.type === FieldType.Password ||
(field.type === FieldType.Text && field.designation === "password")
) {
return <Password field={{ v: field.value } as any} /> return <Password field={{ v: field.value } as any} />
} }

View File

@ -25,6 +25,7 @@ const ItemView = styled.li`
align-items: center; align-items: center;
cursor: default; cursor: default;
grid-template-columns: 35px 1fr; grid-template-columns: 35px 1fr;
user-select: none;
&:hover { &:hover {
background-color: var(--hover-background); background-color: var(--hover-background);
} }