mirror of
https://github.com/4ian/GDevelop.git
synced 2025-10-15 10:19:04 +00:00
Refactor styles in instruction or object selector
This commit is contained in:
@@ -62,6 +62,10 @@ import Text from '../../UI/Text';
|
||||
const gd: libGDevelop = global.gd;
|
||||
|
||||
const DISPLAYED_INSTRUCTIONS_MAX_LENGTH = 20;
|
||||
export const styles = {
|
||||
noObjectsText: { opacity: 0.7 },
|
||||
indentedListItem: { paddingLeft: 45 },
|
||||
};
|
||||
|
||||
export type TabName = 'objects' | 'free-instructions';
|
||||
|
||||
@@ -489,11 +493,11 @@ export default class InstructionOrObjectSelector extends React.PureComponent<
|
||||
<ListItem
|
||||
key={`${group.getName()}-empty`}
|
||||
primaryText={
|
||||
<Text style={{ opacity: 0.6 }} noMargin>
|
||||
<Text style={styles.noObjectsText} noMargin>
|
||||
<Trans>No objects in the group</Trans>
|
||||
</Text>
|
||||
}
|
||||
style={{ paddingLeft: 45 }}
|
||||
style={styles.indentedListItem}
|
||||
/>
|
||||
);
|
||||
} else {
|
||||
@@ -529,11 +533,11 @@ export default class InstructionOrObjectSelector extends React.PureComponent<
|
||||
<ListItem
|
||||
key={`${folderWithPath.path}-empty`}
|
||||
primaryText={
|
||||
<Text style={{ opacity: 0.6 }} noMargin>
|
||||
<Text style={styles.noObjectsText} noMargin>
|
||||
<Trans>No objects in the folder</Trans>
|
||||
</Text>
|
||||
}
|
||||
style={{ paddingLeft: 45 }}
|
||||
style={styles.indentedListItem}
|
||||
/>
|
||||
);
|
||||
} else {
|
||||
|
@@ -9,6 +9,7 @@ import {
|
||||
getObjectListItemKey,
|
||||
} from './Keys';
|
||||
import HighlightedText from '../../../UI/Search/HighlightedText';
|
||||
import { styles } from '../InstructionOrObjectSelector';
|
||||
import { type HTMLDataset } from '../../../Utils/HTMLDataset';
|
||||
|
||||
type Props = {|
|
||||
@@ -45,7 +46,7 @@ export const renderObjectListItem = ({
|
||||
selected={
|
||||
selectedValue === getObjectOrObjectGroupListItemValue(objectName)
|
||||
}
|
||||
style={withIndent ? { paddingLeft: 45 } : undefined}
|
||||
style={withIndent ? styles.indentedListItem : undefined}
|
||||
primaryText={
|
||||
<HighlightedText
|
||||
text={objectName}
|
||||
|
Reference in New Issue
Block a user