From e7780530dfaea98ae55481c955ba9f95a1a1356e Mon Sep 17 00:00:00 2001 From: Michel Weststrate Date: Thu, 16 Jan 2020 06:51:47 -0800 Subject: [PATCH] Fixed #647, urls are not editable in shared preferences Summary: As reported in https://github.com/facebook/flipper/issues/647 urls are not editable in our generic data inspector, as clicking an url will immediately open it, rather than going to edit mode. This diff fixes that by appending an edit icon to URL previews. Reviewed By: jknoxville Differential Revision: D19428925 fbshipit-source-id: 428e8e4c10fb472792b61986d915658f7581c38d --- .../components/data-inspector/DataDescription.tsx | 14 +++++++++++++- static/icons.json | 3 +++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/ui/components/data-inspector/DataDescription.tsx b/src/ui/components/data-inspector/DataDescription.tsx index a33dcd66d..d56c23e27 100644 --- a/src/ui/components/data-inspector/DataDescription.tsx +++ b/src/ui/components/data-inspector/DataDescription.tsx @@ -17,6 +17,7 @@ import Popover from '../Popover'; import {colors} from '../colors'; import Input from '../Input'; import React, {KeyboardEvent} from 'react'; +import Glyph from '../Glyph'; const NullValue = styled.span({ color: 'rgb(128, 128, 128)', @@ -595,7 +596,18 @@ class DataDescriptionContainer extends Component<{ case 'text': case 'string': if (val.startsWith('http://') || val.startsWith('https://')) { - return {val}; + return ( + <> + {val} + + + ); } else { return "{String(val || '')}"; } diff --git a/static/icons.json b/static/icons.json index 2f941851d..76f540827 100644 --- a/static/icons.json +++ b/static/icons.json @@ -318,5 +318,8 @@ ], "card-person": [ 12 + ], + "pencil-outline": [ + 16 ] } \ No newline at end of file