Skip to content
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

Dock the keyboard hide button to the right side of the screen #480

Merged
merged 13 commits into from
Jan 23, 2019
2 changes: 1 addition & 1 deletion gutenberg
Submodule gutenberg updated 40 files
+5 −1 docs/contributors/repository-management.md
+7 −1 docs/tool/generator.js
+1 −0 docs/tool/parser.js
+1 −1 gutenberg.php
+23 −10 lib/client-assets.php
+1,206 −434 package-lock.json
+2 −2 package.json
+6 −0 packages/block-library/CHANGELOG.md
+79 −0 packages/block-library/src/html/edit.js
+7 −39 packages/block-library/src/html/index.js
+63 −10 packages/block-library/src/table/edit.js
+1 −1 packages/block-library/src/table/editor.scss
+22 −6 packages/block-library/src/table/index.js
+46 −0 packages/block-library/src/table/style.scss
+1 −1 packages/block-serialization-default-parser/parser.php
+2 −0 packages/components/src/color-palette/index.js
+12 −3 packages/components/src/color-palette/style.scss
+6 −0 packages/components/src/color-palette/test/__snapshots__/index.js.snap
+84 −10 packages/components/src/form-toggle/README.md
+1 −1 packages/components/src/menu-group/index.js
+10 −5 packages/components/src/sandbox/index.js
+3 −2 packages/components/src/toolbar/index.js
+2 −2 packages/components/src/toolbar/style.native.scss
+1 −1 packages/components/src/toolbar/toolbar-container.native.js
+2 −3 packages/edit-post/src/components/layout/style.scss
+21 −8 packages/edit-post/src/components/options-modal/index.js
+19 −12 packages/edit-post/src/components/options-modal/test/__snapshots__/index.js.snap
+5 −1 packages/editor/CHANGELOG.md
+6 −1 packages/editor/src/components/block-list/block-invalid-warning.js
+4 −1 packages/editor/src/components/colors/index.js
+23 −0 packages/editor/src/components/colors/test/__snapshots__/with-colors.js.snap
+56 −0 packages/editor/src/components/colors/test/with-colors.js
+173 −104 packages/editor/src/components/colors/with-colors.js
+4 −10 packages/editor/src/components/provider/index.js
+1 −1 packages/editor/src/components/warning/index.js
+42 −3 packages/editor/src/editor-styles/index.js
+1 −0 packages/editor/src/index.js
+18 −0 packages/editor/src/store/test/selectors.js
+2 −2 packages/postcss-themes/package.json
+1 −1 packages/scripts/package.json
11 changes: 6 additions & 5 deletions src/block-management/block-toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,15 @@ export class BlockToolbar extends Component<PropsType> {
onClick={ redo }
/>
</Toolbar>
{ showKeyboardHideButton && ( <Toolbar>
<KeyboardHideButton
onPress={ this.onKeyboardHide }
/>
</Toolbar> ) }
<BlockControls.Slot />
<BlockFormatControls.Slot />
</ScrollView>
{ showKeyboardHideButton &&
( <Toolbar passedStyle={ styles.keyboardHideContainer }>
<KeyboardHideButton
onPress={ this.onKeyboardHide }
/>
</Toolbar> ) }
</View>
);
}
Expand Down
6 changes: 6 additions & 0 deletions src/block-management/block-toolbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@
border-top-color: #e9eff3;
border-top-width: 1;
}

.keyboardHideContainer {
padding-right: 0px;
padding-left: 0px;
}

4 changes: 3 additions & 1 deletion src/components/keyboard-hide-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ import React from 'react';
import Svg, { G, Rect, Path } from 'react-native-svg';
import { TouchableOpacity } from 'react-native';

import styles from './keyboard-hide-button.scss';

type PropsType = {
onPress: void => void,
};

const KeyboardHideButton = ( props: PropsType ) => (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we created KeyboardHideButton just as a temp solution for the alpha, maybe it's a good opportunity to remove this and create the keyboard hide button as every other Toolbar button, @koke @pinarol WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that sounds good @marecar3

<TouchableOpacity
style={ { justifyContent: 'center', alignItems: 'center', width: 44 } }
style={ styles.touchableOpacity }
onPress={ props.onPress }
>
<Svg width={ 20 } height={ 20 } >
Expand Down
7 changes: 7 additions & 0 deletions src/components/keyboard-hide-button.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

.touchableOpacity {
justify-content: center;
align-items: center;
width: 44;
padding-top: 4;
}