Skip to content

migrate ActionBar to TS #987

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 21, 2020
Merged

migrate ActionBar to TS #987

merged 3 commits into from
Oct 21, 2020

Conversation

lidord-wix
Copy link
Contributor

@lidord-wix lidord-wix commented Oct 18, 2020

Changelog

Migration of ActionBar and ActionBarScreen to typescript.

@lidord-wix lidord-wix marked this pull request as ready for review October 18, 2020 12:57
@lidord-wix lidord-wix marked this pull request as draft October 18, 2020 12:58
@lidord-wix lidord-wix requested a review from ethanshar October 18, 2020 15:16
@lidord-wix lidord-wix marked this pull request as ready for review October 18, 2020 15:18
Comment on lines 6 to 10
const cameraSelected = require('../../assets/icons/cameraSelected.png');
const video = require('../../assets/icons/video.png');
const tags = require('../../assets/icons/tags.png');
const collections = require('../../assets/icons/collections.png');
const richText = require('../../assets/icons/richText.png');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you change imports to require?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw we usually use require for assets..
Is import is better for this kind of usage?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

require is an es5 syntax
import is an es6 syntax

The advantage of require is that you can call it anywhere (anytime).
This is how we do "lazy loading" when requiring something at a specific point.

While imports always happen and are not lazy loaded

In this case when requiring at the top of the file it's equivalent to import

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got you..
Changing to import :)

Comment on lines 17 to 44
/**
* action bar height
*/
height: PropTypes.number,
height?: number,
/**
* action bar background color
*/
backgroundColor: PropTypes.string,
backgroundColor?: string,
/**
* actions for the action bar
*/
actions: PropTypes.arrayOf(PropTypes.shape(Button.propTypes)),
actions: ButtonPropTypes[],
/**
* should action be equally centered
*/
centered: PropTypes.bool,
centered?: boolean,
/**
* use safe area, in case action bar attached to the bottom (default: true)
*/
useSafeArea: PropTypes.bool,
useSafeArea?: boolean,
/**
* keep the action bar position relative instead of it absolute position
*/
keepRelative: PropTypes.bool,
keepRelative?: boolean,
/**
* style the action bar
*/
style: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array])
style?: ViewStyle ;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

each type should end with semicolon

@lidord-wix lidord-wix requested a review from ethanshar October 19, 2020 14:51
@ethanshar ethanshar merged commit 1c6f35e into master Oct 21, 2020
M-i-k-e-l added a commit that referenced this pull request Oct 25, 2020
* master:
  Fix missed issue with migrating Picker API - PickerItem needs to retrieve the correct value format
  Add Slider testID (#999)
  Remove declaration of ref type on TouchableOpacity
  convert three digit hex to six (#976)
  Fix/text field right icon alignment (#997)
  migrate Switch to TS (#991)
  Move from KeyboardAwareListView to KeyboardAwareFlatList (#960)
  Update constants typings
  migrate ActionBar to TS (#987)
  Do not notify the user onPageChange for the fake page (fix autoscroll on Android bug) (#994)
  Add progress type for ProgressBarProps (#996)
  Fix generated JS files to include propTypes (#995)

# Conflicts:
#	generatedTypes/components/touchableOpacity/index.d.ts
@lidord-wix lidord-wix deleted the Infra/migrate_ActionBar_to_TS branch November 17, 2020 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants