Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions block-management/block-styles.android.scss

This file was deleted.

5 changes: 0 additions & 5 deletions block-management/block-styles.ios.scss

This file was deleted.

46 changes: 0 additions & 46 deletions block-management/toolbar.js

This file was deleted.

17 changes: 0 additions & 17 deletions block-management/toolbar.scss

This file was deleted.

2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @format */

import { AppRegistry } from 'react-native';
import App from './app/App';
import App from './src/app/App';
AppRegistry.registerComponent( 'gutenberg', () => App );
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"version": "0.1.0",
"private": true,
"config": {
"jsfiles": "index.js app/*.js app/**/*.js block-management/*.js block-management/**/*.js store/*.js store/**/*.js",
"scssfiles": "app/*.scss app/**/*.scss block-management/*.scss block-management/**/*.scss store/*.scss store/**/*.scss"
"jsfiles": "index.js src/*.js src/**/*.js",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moving mobile-related code to src/ is worth it.

"scssfiles": "src/*.scss src/**/*.scss"
},
"devDependencies": {
"@wordpress/babel-preset-default": "^1.1.2",
Expand Down
2 changes: 1 addition & 1 deletion sass-transformer.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ function transform( src, filename, options ) {
const importerOptions = this.options;
const incPaths = importerOptions.includePaths.slice( 0 ).split( ':' );
if ( urlPath.dir.length > 0 ) {
incPaths.unshift( urlPath.dir ); // add the file's dir to the search array
incPaths.unshift( path.resolve( path.dirname( filename ), urlPath.dir ) ); // add the file's dir to the search array
}
const f = findVariant( urlPath.name, exts, incPaths );

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,15 @@

.blockContainer {
background-color: white;
}

.blockContent {
padding-left: 10;
padding-right: 10;
padding-top: 10;
padding-bottom: 10;
padding-left: 8;
padding-right: 8;
padding-top: 8;
padding-bottom: 8;
}

.blockTitle {
background-color: grey;
padding-left: 10;
padding-left: 8;
padding-top: 4;
padding-bottom: 4;
}
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export default class BlockManager extends React.Component<PropsType, StateType>
onValueChange={ value => this.setState( { showHtml: value } ) }
/>
</View>
{ this.state.showHtml && <Text style={ styles.list }>{ this.serializeToHtml() }</Text> }
{ this.state.showHtml && <Text style={ styles.htmlView }>{ this.serializeToHtml() }</Text> }
{ ! this.state.showHtml && list }
</View>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/** @format */

@import '../variables.scss';

.container {
flex: 1;
justify-content: flex-start;
Expand All @@ -12,8 +14,13 @@
}

.htmlView {
font-family: $default-monospace-font;
flex: 1;
background-color: #fff;
background-color: #eee;
padding-left: 8;
padding-right: 8;
padding-top: 8;
padding-bottom: 8;
}

.switch {
Expand Down
7 changes: 7 additions & 0 deletions src/block-management/block-styles.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/** @format */

@import '../variables.scss';

.block_code {
font-family: $default-monospace-font;
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const ToolbarButton = {
DOWN: 2,
SETTINGS: 3,
DELETE: 4,
PLUS: 5,
};

export { ToolbarButton };
66 changes: 66 additions & 0 deletions src/block-management/toolbar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/** @flow
* @format */

import React from 'react';
import { View, TouchableOpacity, Text } from 'react-native';
import { ToolbarButton } from './constants';

import styles from './toolbar.scss';

type PropsType = {
uid: string,
onButtonPressed: ( button: number, uid: string ) => void,
};

export default class Toolbar extends React.Component<PropsType> {
render() {
return (
<View style={ styles.toolbar }>
<TouchableOpacity
onPress={ this.props.onButtonPressed.bind( this, ToolbarButton.PLUS, this.props.uid ) }
>
<View style={ styles.toolbarButton }>
<Text>+</Text>
</View>
</TouchableOpacity>
<View style={ styles.buttonSeparator } />
<TouchableOpacity
onPress={ this.props.onButtonPressed.bind( this, ToolbarButton.UP, this.props.uid ) }
>
<View style={ styles.toolbarButton }>
<Text>▲</Text>
</View>
</TouchableOpacity>
<View style={ styles.buttonSeparator } />
<TouchableOpacity
onPress={ this.props.onButtonPressed.bind( this, ToolbarButton.DOWN, this.props.uid ) }
>
<View style={ styles.toolbarButton }>
<Text>▼</Text>
</View>
</TouchableOpacity>
<View style={ styles.buttonSeparator } />
<TouchableOpacity
onPress={ this.props.onButtonPressed.bind(
this,
ToolbarButton.SETTINGS,
this.props.uid
) }
>
<View style={ styles.toolbarButton }>
{ /* eslint-disable-next-line jsx-a11y/accessible-emoji */ }
<Text>⚙️</Text>
</View>
</TouchableOpacity>
<View style={ styles.buttonSeparator } />
<TouchableOpacity
onPress={ this.props.onButtonPressed.bind( this, ToolbarButton.DELETE, this.props.uid ) }
>
<View style={ styles.toolbarButton }>
<Text>🗑</Text>
</View>
</TouchableOpacity>
</View>
);
}
}
19 changes: 19 additions & 0 deletions src/block-management/toolbar.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/** @format */

.toolbar {
height: 34;
background-color: white;
flex-direction: row;
padding-left: 8;
padding-right: 8;
}

.toolbarButton {
width: 50;
justify-content: center;
align-items: center;
}

.buttonSeparator {
width: 8;
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions src/variables.android.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/** @format */

// Fonts
$default-monospace-font: monospace;
4 changes: 4 additions & 0 deletions src/variables.ios.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/** @format */

// Fonts
$default-monospace-font: courier;