Skip to content

Commit

Permalink
feat: description on item listing
Browse files Browse the repository at this point in the history
  • Loading branch information
iRaySpace committed Apr 29, 2019
1 parent 9daed0f commit e041b5c
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/container/SalesContainer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -848,6 +848,7 @@ export default class SalesContainer extends React.Component {
onTakeAwayClick={this.onTakeAwayClick}
// has order
hasTailOrder={this.props.stateStore.hasTailOrder}
useDescription={this.props.stateStore.useDescription}
/>
</Container>
);
Expand Down
2 changes: 2 additions & 0 deletions src/store/PosStore/syncInBackground.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ export async function itemSync(itemObject, store) {
var objecct_to_add = {
name:
itemObject.syncObject.name !== null ? itemObject.syncObject.name : "",
description:
itemObject.syncObject.description !== null ? itemObject.syncObject.description : "",
soldBy:
itemObject.syncObject.stock_uom !== null
? itemObject.syncObject.stock_uom === "Nos"
Expand Down
2 changes: 2 additions & 0 deletions src/stories/components/EntriesComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ export default class EntriesComponent extends React.PureComponent {
currency={this.props.currency}
onPress={this.props.onPressItem}
onLongPress={this.props.onLongPressItem}
useDescription={this.props.useDescription}
/>
);
};

render() {
console.log(this.props.useDescription);
return (
<FlatList
numColumns={2}
Expand Down
6 changes: 5 additions & 1 deletion src/stories/components/EntryComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@ export default class EntryComponent extends React.PureComponent {
textAlign: "center",
}}
>
{this.props.value.name}
{
this.props.useDescription
? this.props.value.description
: this.props.value.name
}
</Text>
</View>
</View>
Expand Down
4 changes: 4 additions & 0 deletions src/stories/screens/Sales/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class Sales extends React.PureComponent {
isViewingOrder,
onTakeAwayClick,
hasTailOrder,
useDescription,
} = this.props;

return (
Expand Down Expand Up @@ -97,6 +98,9 @@ class Sales extends React.PureComponent {
itemsLength={itemsLength}
categoryLengths={categoryLengths}
onLongPressItem={onLongPressItem}

// Descriptive items
useDescription={useDescription}
/>
)}
</Col>
Expand Down
4 changes: 4 additions & 0 deletions src/stories/screens/SalesList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ export default class SalesList extends React.PureComponent {

// TextInput
onChangeBarcodeScannerInput,

// Descriptive items
useDescription,
} = this.props;

return (
Expand Down Expand Up @@ -171,6 +174,7 @@ export default class SalesList extends React.PureComponent {
onPressItem={this.onPressItem}
onLongPressItem={onLongPressItem}
onEndReached={this.onItemEndReached}
useDescription={useDescription}
/>
</Col>
<Col size={35}>
Expand Down

0 comments on commit e041b5c

Please sign in to comment.