Refactor 'inventoryWarning' and fix the position of warning icon