1
0
mirror of https://github.com/mattermost/focalboard.git synced 2024-11-24 08:22:29 +02:00

in-=progress add new option

This commit is contained in:
Harshil Sharma 2023-01-23 17:25:06 +05:30
parent 684c1b09a7
commit 68986e181a
2 changed files with 46 additions and 0 deletions

View File

@ -0,0 +1,9 @@
.Label {
input {
border: none;
background: none;
border-bottom: 1px solid;
border-radius: 0;
max-width: 100%;
}
}

View File

@ -0,0 +1,37 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React from 'react'
import Label from '../../../../widgets/label'
import {IPropertyOption} from '../../../../blocks/board'
import './editableLabel.scss'
type Props = {
option: IPropertyOption
editing?: boolean
}
const EditableLabel = (props: Props): JSX.Element => {
const {option} = props
const displayValue = (<span>{option.value}</span>)
const editValue = (
<input
defaultValue={props.option.value}
/>
)
return (
<Label
key={option.id}
color={option.color}
title={option.value}
>
{ props.editing ? editValue : displayValue }
</Label>
)
}
export default React.memo(EditableLabel)