-
Notifications
You must be signed in to change notification settings - Fork 4.3k
/
Copy pathedit.native.js
51 lines (43 loc) · 1.01 KB
/
edit.native.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/**
* External dependencies
*/
import { View } from 'react-native';
import Hr from 'react-native-hr';
/**
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { Component } from '@wordpress/element';
import { withTheme } from '@wordpress/components';
/**
* Internal dependencies
*/
import styles from './editor.scss';
export class MoreEdit extends Component {
constructor() {
super( ...arguments );
this.state = {
defaultText: __( 'Read more' ),
};
}
render() {
const { attributes, useStyle } = this.props;
const { customText } = attributes;
const { defaultText } = this.state;
const content = customText || defaultText;
const textStyle = useStyle( styles.moreText, styles.moreTextDark );
const lineStyle = useStyle( styles.moreLine, styles.moreLineDark );
return (
<View>
<Hr
text={ content }
marginLeft={ 0 }
marginRight={ 0 }
textStyle={ textStyle }
lineStyle={ lineStyle }
/>
</View>
);
}
}
export default withTheme( MoreEdit );