-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mobile: Link image setting #13654
Mobile: Link image setting #13654
Changes from all commits
fd7c7eb
abdfd03
1a4e35a
4352c7a
f132158
7bd8a4f
541db3b
b8e5dcf
92e5357
b7236e0
4828348
09582b7
a1db59a
d335a84
67c2ffc
edcd79b
fc1043a
bfd5832
4d7a80c
05fee0c
887fc58
a126776
feab6e0
30ed40c
1e45675
5c6cd81
a3f44ba
290d4fc
dab0fd2
9098808
4643b01
7e391ba
6d60a5f
890404b
a6efb9a
b0fc616
6d525d8
33ad7c5
0dee9bf
5849829
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,7 @@ | |
flex-direction: column; | ||
align-items: center; | ||
} | ||
|
||
.resetSettingsButton { | ||
color: $alert-red; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,28 +24,30 @@ export default function Cell( props ) { | |
labelStyle = {}, | ||
valueStyle = {}, | ||
onChangeValue, | ||
...valueProps | ||
} = props; | ||
|
||
const showValue = value !== undefined; | ||
const isValueEditable = onChangeValue !== undefined; | ||
const defaultLabelStyle = showValue ? styles.cellLabel : styles.cellLabelCentered; | ||
const separatorStyle = showValue ? styles.cellSeparator : styles.separator; | ||
let valueTextInput; | ||
|
||
const onCellPress = () => { | ||
if ( isValueEditable ) { | ||
valueTextInput.focus(); | ||
} else { | ||
} else if ( onPress !== undefined ) { | ||
onPress(); | ||
} | ||
}; | ||
|
||
return ( | ||
<TouchableOpacity onPress={ onCellPress }> | ||
<TouchableOpacity onPress={ onCellPress } > | ||
<View style={ styles.cellContainer }> | ||
<View style={ styles.cellRowContainer }> | ||
{ icon && ( | ||
<View style={ styles.cellRowContainer }> | ||
<Dashicon icon={ icon } size={ 30 } /> | ||
<Dashicon icon={ icon } size={ 24 } /> | ||
<View style={ { width: 12 } } /> | ||
</View> | ||
) } | ||
|
@@ -60,13 +62,15 @@ export default function Cell( props ) { | |
style={ { ...styles.cellValue, ...valueStyle } } | ||
value={ value } | ||
placeholder={ valuePlaceholder } | ||
placeholderTextColor={ '#87a6bc' } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like this color doesn't have a name in gutenberg repo. However, we can maybe put it into an scss and give it a name?(like placeholderGray, I don't know, you name it) that way it might be easier to import the scss from somewhere else and reuse in the future? Although, I don't have a strong opinion on this, so I am totally fine with the way you are willing to choose. |
||
onChangeText={ onChangeValue } | ||
editable={ isValueEditable } | ||
{ ...valueProps } | ||
/> | ||
) } | ||
</View> | ||
{ drawSeparator && ( | ||
<View style={ styles.separator } /> | ||
<View style={ separatorStyle } /> | ||
) } | ||
</TouchableOpacity> | ||
); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,6 @@ | |
background-color: $light-gray-400; | ||
height: 4px; | ||
width: 10%; | ||
top: -12px; | ||
margin: auto; | ||
border-radius: 2px; | ||
} | ||
|
@@ -18,12 +17,12 @@ | |
background-color: $light-gray-400; | ||
height: 1px; | ||
width: 100%; | ||
margin-bottom: 14px; | ||
} | ||
|
||
.content { | ||
padding: 6px 16px 0 16px; | ||
background-color: $white; | ||
padding: 18px 10px 5px 10px; | ||
justify-content: center; | ||
border-top-right-radius: 8px; | ||
border-top-left-radius: 8px; | ||
} | ||
|
@@ -59,41 +58,44 @@ | |
|
||
// Cell | ||
|
||
//Bottom Sheet | ||
|
||
.cellContainer { | ||
flex-direction: row; | ||
min-height: 50; | ||
justify-content: space-between; | ||
margin-left: 12; | ||
margin-right: 12; | ||
min-height: 48; | ||
align-items: center; | ||
} | ||
|
||
.cellSeparator { | ||
background-color: $light-gray-400; | ||
height: 1px; | ||
width: 100%; | ||
margin-left: 36px; | ||
} | ||
|
||
.cellRowContainer { | ||
flex-direction: row; | ||
align-items: center; | ||
} | ||
|
||
.cellIcon { | ||
padding-right: 30; | ||
padding-right: 0; | ||
} | ||
|
||
.cellLabel { | ||
font-size: 18px; | ||
color: #000; | ||
font-size: 17px; | ||
color: #2e4453; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is it possible that we use $gray-dark instead of #2e4453? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
margin-right: 12px; | ||
} | ||
|
||
.cellLabelCentered { | ||
font-size: 18px; | ||
color: #000; | ||
font-size: 17px; | ||
color: #2e4453; | ||
flex: 1; | ||
text-align: center; | ||
} | ||
|
||
.cellValue { | ||
font-size: 18px; | ||
color: $dark-gray-400; | ||
font-size: 17px; | ||
color: #2e4453; | ||
text-align: right; | ||
flex: 1; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so I didn't quite get how to clear the linkDestination here. is it sth to be implemented in the future? Would it be good to clear the LINK_DESTINATION_CUSTOM if the field is empty?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is interesting. We are not implementing the full links feature in mobile yet, but it would be good if they don't break each other. 🤔
For a proper comparison of
LINK_DESTINATION_MEDIA
we need theimage
prop with thesource_url
information. Not sure ifprops.attributes.url
is enough. In the next PR I'm working on getting that image media.I'll also talk with Thomas about this to know what would be the best approach.
Thanks for noticing this!