forked from Expensify/App
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Ideal nav merge search bar #11
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
a217f1d
Add subscript icon to SubscriptAvatar
MaciejSWM 3a58c65
WorkspaceSwitcherButton
MaciejSWM 5c3abec
Change default color for border
MaciejSWM ffc295f
Merge branch 'wave8/workspace-switcher-icon' into ideal-nav-merge
kosmydel 9875fe7
add new search bar
kosmydel 77837d1
fixes
kosmydel 255794f
fix crash after loggin in
adamgrzybowski 33b0cfd
remove redundand isSmallScreen check
adamgrzybowski bbe8aaf
Merge branch 'ideal-nav-merge' into ideal-nav-merge-search-bar
kosmydel 34586d8
design fixes
kosmydel adbcde9
add spanish translation
kosmydel 7bd9f47
address review
kosmydel 770c2d9
fix regressions from other PR
kosmydel ba1bbf3
fix new-expensify color
kosmydel bd0d201
Merge branch 'ideal-nav-merge' into ideal-nav-merge-search-bar
adamgrzybowski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,4 +100,5 @@ function Icon({ | |
|
||
Icon.displayName = 'Icon'; | ||
|
||
export type {IconProps}; | ||
export default Icon; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import React from 'react'; | ||
import useLocalize from '@hooks/useLocalize'; | ||
import CONST from '@src/CONST'; | ||
import * as Expensicons from './Icon/Expensicons'; | ||
import {PressableWithFeedback} from './Pressable'; | ||
import SubscriptAvatar from './SubscriptAvatar'; | ||
|
||
function WorkspaceSwitcherButton() { | ||
const {translate} = useLocalize(); | ||
|
||
return ( | ||
<PressableWithFeedback | ||
accessibilityRole={CONST.ROLE.BUTTON} | ||
accessibilityLabel={translate('common.workspaces')} | ||
accessible | ||
onPress={() => {}} | ||
> | ||
<SubscriptAvatar | ||
mainAvatar={{source: Expensicons.ExpensifyAppIcon, name: 'Expensify', type: CONST.ICON_TYPE_AVATAR}} | ||
subscriptIcon={{source: Expensicons.DownArrow, width: 8, height: 8}} | ||
showTooltip={false} | ||
noMargin | ||
/> | ||
</PressableWithFeedback> | ||
); | ||
} | ||
|
||
WorkspaceSwitcherButton.displayName = 'WorkspaceSwitcherButton'; | ||
|
||
export default WorkspaceSwitcherButton; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
src/libs/Navigation/AppNavigator/createCustomBottomTabNavigator/TopBar.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import PropTypes from 'prop-types'; | ||
import React, {useCallback} from 'react'; | ||
import {View} from 'react-native'; | ||
import * as Expensicons from '@components/Icon/Expensicons'; | ||
import PressableWithFeedback from '@components/Pressable/PressableWithFeedback'; | ||
import Search from '@components/Search'; | ||
import SubscriptAvatar from '@components/SubscriptAvatar'; | ||
import useLocalize from '@hooks/useLocalize'; | ||
import useThemeStyles from '@hooks/useThemeStyles'; | ||
import Navigation from '@libs/Navigation/Navigation'; | ||
import SignInOrAvatarWithOptionalStatus from '@pages/home/sidebar/SignInOrAvatarWithOptionalStatus'; | ||
import * as Session from '@userActions/Session'; | ||
import CONST from '@src/CONST'; | ||
import ROUTES from '@src/ROUTES'; | ||
|
||
// TODO-IDEAL: isCreateMenuOpen wasn't used before | ||
function TopBar({isCreateMenuOpen = false}) { | ||
const styles = useThemeStyles(); | ||
const {translate} = useLocalize(); | ||
|
||
const showSearchPage = useCallback(() => { | ||
if (isCreateMenuOpen) { | ||
// Prevent opening Search page when click Search icon quickly after clicking FAB icon | ||
return; | ||
} | ||
|
||
Navigation.navigate(ROUTES.SEARCH); | ||
}, [isCreateMenuOpen]); | ||
|
||
return ( | ||
<View | ||
style={[styles.gap6, styles.flexRow, styles.ph5, styles.pv3, styles.justifyContentBetween, styles.alignItemsCenter]} | ||
dataSet={{dragArea: true}} | ||
> | ||
<PressableWithFeedback role={CONST.ROLE.BUTTON}> | ||
<SubscriptAvatar | ||
mainAvatar={{source: Expensicons.ExpensifyAppIcon, name: 'Expensify', type: CONST.ICON_TYPE_AVATAR}} | ||
subscriptIcon={{source: Expensicons.DownArrow, width: 8, height: 8}} | ||
showTooltip={false} | ||
noMargin | ||
/> | ||
</PressableWithFeedback> | ||
<Search | ||
placeholder={translate('sidebarScreen.buttonSearch')} | ||
onPress={Session.checkIfActionIsAllowed(showSearchPage)} | ||
style={{flex: 1}} | ||
/> | ||
<SignInOrAvatarWithOptionalStatus isCreateMenuOpen={isCreateMenuOpen} /> | ||
</View> | ||
); | ||
} | ||
|
||
TopBar.displayName = 'TopBar'; | ||
TopBar.propTypes = { | ||
isCreateMenuOpen: PropTypes.bool, | ||
}; | ||
TopBar.defaultProps = { | ||
isCreateMenuOpen: false, | ||
}; | ||
|
||
export default TopBar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can TopBar.js be written in TS?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so, the
SignInOrAvatarWithOptionalStatus
is written in JS.