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:
parent
684c1b09a7
commit
68986e181a
@ -0,0 +1,9 @@
|
||||
.Label {
|
||||
input {
|
||||
border: none;
|
||||
background: none;
|
||||
border-bottom: 1px solid;
|
||||
border-radius: 0;
|
||||
max-width: 100%;
|
||||
}
|
||||
}
|
@ -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)
|
Loading…
Reference in New Issue
Block a user