Skip to content
This repository has been archived by the owner on Jul 1, 2023. It is now read-only.

Commit

Permalink
fix: add tip on how to add images
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmyloi committed Aug 12, 2020
1 parent 695703f commit 3ca4283
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/ulangi-mobile/src/views/image/SearchInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class SearchInput extends React.Component<SearchInputProps> {
return (
<View style={this.styles.input_container}>
<DefaultTextInput
placeholder="Type topics to search..."
placeholder="Type to search images..."
ref={(ref): void => {
this.textInputRef = ref;
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,18 @@
* See LICENSE or go to https://www.gnu.org/licenses/gpl-3.0.txt
*/

import { ViewStyle } from 'react-native';
import { TextStyle, ViewStyle } from 'react-native';

import { config } from '../../constants/config';
import { ResponsiveStyleSheet, ScaleByFactor } from '../../utils/responsive';

export interface AddEditVocabularyScreenStyles {
screen: ViewStyle;
scrollview: ViewStyle;
preview_container: ViewStyle;
tip_container: ViewStyle;
tip: TextStyle;
bold: TextStyle;
}

export class AddEditVocabularyScreenResponsiveStyles extends ResponsiveStyleSheet<
Expand All @@ -36,15 +40,37 @@ export class AddEditVocabularyScreenResponsiveStyles extends ResponsiveStyleShee
alignSelf: 'stretch',
justifyContent: 'center',
},

tip_container: {
paddingHorizontal: scaleByFactor(16),
paddingVertical: scaleByFactor(14),
},

tip: {
textAlign: 'center',
fontSize: scaleByFactor(13),
},

bold: {
fontWeight: 'bold',
},
};
}

public lightStyles(): Partial<AddEditVocabularyScreenStyles> {
return {};
return {
tip: {
color: config.styles.light.secondaryTextColor,
},
};
}

public darkStyles(): Partial<AddEditVocabularyScreenStyles> {
return {};
return {
tip: {
color: config.styles.dark.secondaryTextColor,
},
};
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ import {
} from '@ulangi/ulangi-observable';
import { observer } from 'mobx-react';
import * as React from 'react';
import { ScrollView } from 'react-native';
import { ScrollView, View } from 'react-native';

import { AddEditVocabularyScreenDelegate } from '../../delegates/vocabulary/AddEditVocabularyScreenDelegate';
import { DefaultText } from '../common/DefaultText';
import { DismissKeyboardView } from '../common/DismissKeyboardView';
import { Screen } from '../common/Screen';
import { SmartScrollView } from '../common/SmartScrollView';
Expand Down Expand Up @@ -93,6 +94,7 @@ export class AddEditVocabularyScreen extends React.Component<
addDefinitionSlot={this.props.screenDelegate.addDefinitionSlot}
deleteDefinition={this.props.screenDelegate.deleteDefinition}
/>
{this.renderTip()}
</DismissKeyboardView>
</SmartScrollView>
</React.Fragment>
Expand All @@ -111,4 +113,18 @@ export class AddEditVocabularyScreen extends React.Component<
</ScrollView>
);
}

private renderTip(): React.ReactElement<any> {
return (
<View style={this.styles.tip_container}>
<DefaultText style={this.styles.tip}>
<DefaultText style={this.styles.bold}>Tip: </DefaultText>
<DefaultText>To add images, tap on </DefaultText>
<DefaultText style={this.styles.bold}>Extra fields</DefaultText>
<DefaultText> button for definitions then press </DefaultText>
<DefaultText style={this.styles.bold}>Search images</DefaultText>.
</DefaultText>
</View>
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export class ExtraFieldsPickerContent extends React.Component<
<View style={this.styles.btn_container}>
{detail.templateName === 'image'
? this.renderButton(
'Select images',
'Search images',
(): void => {
this.props.selectImages();
},
Expand Down

0 comments on commit 3ca4283

Please sign in to comment.