StatusView
This commit is contained in:
parent
69e2fe8bc5
commit
6c132cbbcd
|
@ -50,7 +50,7 @@ class SetUsernameView extends React.Component {
|
||||||
saving: false
|
saving: false
|
||||||
};
|
};
|
||||||
const { server } = this.props;
|
const { server } = this.props;
|
||||||
props.navigation.setParams({ title: server });
|
props.navigation.setOptions({ title: server });
|
||||||
if (!isTablet) {
|
if (!isTablet) {
|
||||||
Orientation.lockToPortrait();
|
Orientation.lockToPortrait();
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,20 +56,6 @@ const styles = StyleSheet.create({
|
||||||
});
|
});
|
||||||
|
|
||||||
class StatusView extends React.Component {
|
class StatusView extends React.Component {
|
||||||
static navigationOptions = ({ route }) => ({
|
|
||||||
title: I18n.t('Edit_Status'),
|
|
||||||
headerLeft: () => <CancelModalButton onPress={route.params?.close ?? (() => {})} />,
|
|
||||||
headerRight: () => (
|
|
||||||
<CustomHeaderButtons>
|
|
||||||
<Item
|
|
||||||
title={I18n.t('Done')}
|
|
||||||
onPress={route.params?.submit ?? (() => {})}
|
|
||||||
testID='status-view-submit'
|
|
||||||
/>
|
|
||||||
</CustomHeaderButtons>
|
|
||||||
)
|
|
||||||
})
|
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
user: PropTypes.shape({
|
user: PropTypes.shape({
|
||||||
id: PropTypes.string,
|
id: PropTypes.string,
|
||||||
|
@ -86,8 +72,24 @@ class StatusView extends React.Component {
|
||||||
|
|
||||||
const { statusText } = props.user;
|
const { statusText } = props.user;
|
||||||
this.state = { statusText, loading: false };
|
this.state = { statusText, loading: false };
|
||||||
|
this.setHeader();
|
||||||
|
}
|
||||||
|
|
||||||
props.navigation.setParams({ submit: this.submit, close: this.close });
|
setHeader = () => {
|
||||||
|
const { navigation } = this.props;
|
||||||
|
navigation.setOptions({
|
||||||
|
title: I18n.t('Edit_Status'),
|
||||||
|
headerLeft: () => <CancelModalButton onPress={this.close} />,
|
||||||
|
headerRight: () => (
|
||||||
|
<CustomHeaderButtons>
|
||||||
|
<Item
|
||||||
|
title={I18n.t('Done')}
|
||||||
|
onPress={this.submit}
|
||||||
|
testID='status-view-submit'
|
||||||
|
/>
|
||||||
|
</CustomHeaderButtons>
|
||||||
|
)
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
submit = async() => {
|
submit = async() => {
|
||||||
|
|
Loading…
Reference in New Issue