fix: options-ui hide edit icon from not implemented elements

This commit is contained in:
Michal Szczepanski 2023-10-30 17:02:07 +01:00
parent c88f240352
commit db4bad367a
2 changed files with 9 additions and 3 deletions

@ -14,12 +14,14 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { ObjOverrideDto } from './obj-override.dto';
import { ObjUrlDto } from './obj.dto';
import { ObjHashtagable } from './obj-hashtag.dto';
export interface ObjPdfDto extends ObjHashtagable {
hash: string;
data: ObjPdfDataDto;
override?: ObjOverrideDto;
}
export interface ObjPdfDataDto {

@ -45,6 +45,12 @@ export const BoardItemTitle: FunctionComponent<Props> = (props) => {
</IconButton>
) : undefined;
const editIcon = [ObjTypeDto.PageSnapshot, ObjTypeDto.PageElementSnapshot].includes(props.obj.type) ? (
<IconButton onClick={() => props.editCallback()}>
<EditIcon />
</IconButton>
) : undefined;
return (
<div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between' }}>
<h2
@ -56,9 +62,7 @@ export const BoardItemTitle: FunctionComponent<Props> = (props) => {
</h2>
<div style={{ display: 'flex', flexDirection: 'row', alignItems: 'center' }}>
{htmlIcon}
<IconButton onClick={() => props.editCallback()}>
<EditIcon />
</IconButton>
{editIcon}
<IconButton title="Remove" onClick={() => props.removeCallback()}>
<DeleteIcon />
</IconButton>