Repository navigation
[Feat #23130] Add custom status settings to profile #23267
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
stitesExpensify
merged 41 commits into
Expensify:main
from
margelo:feat/##23130-status-page-settings
Aug 9, 2023
Merged
Changes from all commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
ccd3017
wip: adding status page
hannojg cf6fa1c
wip
hannojg 95d18ee
Merge branch 'main' of https://github.com/margelo/expensify-app-fork …
perunt 725f8eb
add routes
perunt 10b1779
add const
perunt f054f6f
update onyx keys
perunt c7e3c84
Merge branch 'main' of https://github.com/margelo/expensify-app-fork …
perunt f5bdc40
add svg
perunt 87fcf74
add translations
perunt bd5ff5d
update StatusPage
perunt 5a8f8b1
create analog for IllustratedHeaderPageLayout
perunt 5052d01
add actions
perunt c414d49
create StatusSetPage
perunt 591a518
display status on profilePage
perunt 43d6e53
create EmojiPickerButtonDropdown
perunt c126d26
remove link to ClearAfter
perunt 577d412
Merge branch 'main' of https://github.com/margelo/expensify-app-fork …
perunt 8a97e33
use lodashGet
perunt 71cac3a
prettier
perunt 6bc1743
remove todo
perunt 4856a08
remove unused set date
perunt 4e0d0f2
add betas flag for status
perunt 1c34c4b
clean comment
perunt 1154c7e
fix title
perunt dc9ebea
hide clean button in draft mode
perunt c2fc3e3
update personal details correctly
hannojg b3fe3ad
handle top left anchor position
perunt c33661d
use lodash
perunt 2ee78f0
Merge branch 'feat/##23130-status-page-settings' of https://github.co…
perunt 4b8cf30
clean draft status
perunt ef4726d
add shiftVertical for picker
perunt 8d9f0bb
hide save button for non draft status
perunt c168fc9
convert date to iso string
perunt e5ae203
forwardRef
perunt 7b9eaf3
Merge branch 'main' of https://github.com/margelo/expensify-app-fork …
perunt 805ce5e
clean code
perunt e914658
update titleColor and iconFill
perunt d416ddc
clean
perunt e34095c
Merge branch 'main' of https://github.com/Expensify/App into feat/##2…
perunt ce4f923
lint
perunt b36faec
remove onyx key
perunt 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,81 @@ | ||
| import React, {useRef, useEffect} from 'react'; | ||
| import PropTypes from 'prop-types'; | ||
| import {View} from 'react-native'; | ||
| import styles from '../../styles/styles'; | ||
| import CONST from '../../CONST'; | ||
| import * as StyleUtils from '../../styles/StyleUtils'; | ||
| import getButtonState from '../../libs/getButtonState'; | ||
| import * as Expensicons from '../Icon/Expensicons'; | ||
| import Tooltip from '../Tooltip'; | ||
| import Text from '../Text'; | ||
| import Icon from '../Icon'; | ||
| import withLocalize, {withLocalizePropTypes} from '../withLocalize'; | ||
| import * as EmojiPickerAction from '../../libs/actions/EmojiPickerAction'; | ||
| import PressableWithoutFeedback from '../Pressable/PressableWithoutFeedback'; | ||
|
|
||
| const propTypes = { | ||
| /** Flag to disable the emoji picker button */ | ||
| isDisabled: PropTypes.bool, | ||
|
|
||
| ...withLocalizePropTypes, | ||
| }; | ||
|
|
||
| const defaultProps = { | ||
| isDisabled: false, | ||
| }; | ||
|
|
||
| function EmojiPickerButtonDropdown(props) { | ||
| const emojiPopoverAnchor = useRef(null); | ||
| useEffect(() => EmojiPickerAction.resetEmojiPopoverAnchor, []); | ||
|
|
||
| const onPress = () => | ||
| EmojiPickerAction.showEmojiPicker(props.onModalHide, (emoji) => props.onInputChange(emoji), emojiPopoverAnchor.current, { | ||
| horizontal: CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.LEFT, | ||
| vertical: CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.TOP, | ||
| shiftVertical: 4, | ||
| }); | ||
|
|
||
| return ( | ||
| <Tooltip text={props.translate('reportActionCompose.emoji')}> | ||
| <PressableWithoutFeedback | ||
| ref={emojiPopoverAnchor} | ||
| style={styles.emojiPickerButtonDropdown} | ||
| disabled={props.isDisabled} | ||
| onPress={onPress} | ||
| nativeID="emojiDropdownButton" | ||
| accessibilityLabel="statusEmoji" | ||
| accessibilityRole="text" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Setting |
||
| > | ||
| {({hovered, pressed}) => ( | ||
| <View style={styles.emojiPickerButtonDropdownContainer}> | ||
| <Text | ||
| style={styles.emojiPickerButtonDropdownIcon} | ||
| numberOfLines={1} | ||
| > | ||
| {props.value} | ||
| </Text> | ||
| <View style={[styles.popoverMenuIcon, styles.pointerEventsAuto, props.disabled && styles.cursorDisabled, styles.rotate90]}> | ||
| <Icon | ||
| src={Expensicons.ArrowRight} | ||
| fill={StyleUtils.getIconFillColor(getButtonState(hovered, pressed))} | ||
| /> | ||
| </View> | ||
| </View> | ||
| )} | ||
| </PressableWithoutFeedback> | ||
| </Tooltip> | ||
| ); | ||
| } | ||
|
|
||
| EmojiPickerButtonDropdown.propTypes = propTypes; | ||
| EmojiPickerButtonDropdown.defaultProps = defaultProps; | ||
| EmojiPickerButtonDropdown.displayName = 'EmojiPickerButtonDropdown'; | ||
| export default withLocalize( | ||
| React.forwardRef((props, ref) => ( | ||
| <EmojiPickerButtonDropdown | ||
| // eslint-disable-next-line react/jsx-props-no-spreading | ||
| {...props} | ||
| forwardedRef={ref} | ||
|
stitesExpensify marked this conversation as resolved.
Resolved
|
||
| /> | ||
| )), | ||
| ); | ||
This file contains hidden or 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,92 @@ | ||
| import _ from 'underscore'; | ||
| import React, {useMemo} from 'react'; | ||
| import PropTypes from 'prop-types'; | ||
| import {ScrollView, View} from 'react-native'; | ||
| import headerWithBackButtonPropTypes from './HeaderWithBackButton/headerWithBackButtonPropTypes'; | ||
| import HeaderWithBackButton from './HeaderWithBackButton'; | ||
| import ScreenWrapper from './ScreenWrapper'; | ||
| import styles from '../styles/styles'; | ||
| import themeColors from '../styles/themes/default'; | ||
| import * as StyleUtils from '../styles/StyleUtils'; | ||
| import useWindowDimensions from '../hooks/useWindowDimensions'; | ||
| import FixedFooter from './FixedFooter'; | ||
|
|
||
| const propTypes = { | ||
| ...headerWithBackButtonPropTypes, | ||
|
|
||
| /** Children to display in the lower half of the page (below the header section w/ an animation) */ | ||
| children: PropTypes.node.isRequired, | ||
|
|
||
| /** The background color to apply in the upper half of the screen. */ | ||
| backgroundColor: PropTypes.string, | ||
|
|
||
| /** A fixed footer to display at the bottom of the page. */ | ||
| footer: PropTypes.node, | ||
| }; | ||
|
|
||
| const defaultProps = { | ||
| backgroundColor: themeColors.appBG, | ||
| footer: null, | ||
| }; | ||
|
|
||
| function StaticHeaderPageLayout({backgroundColor, children, image: Image, footer, imageContainerStyle, style, ...propsToPassToHeader}) { | ||
| const {windowHeight} = useWindowDimensions(); | ||
|
|
||
| const {titleColor, iconFill} = useMemo(() => { | ||
| const isColorfulBackground = backgroundColor !== themeColors.appBG; | ||
| return { | ||
| titleColor: isColorfulBackground ? themeColors.textColorfulBackground : undefined, | ||
| iconFill: isColorfulBackground ? themeColors.iconColorfulBackground : undefined, | ||
| }; | ||
| }, [backgroundColor]); | ||
|
|
||
| return ( | ||
| <ScreenWrapper | ||
| style={[StyleUtils.getBackgroundColorStyle(backgroundColor)]} | ||
| shouldEnablePickerAvoiding={false} | ||
| includeSafeAreaPaddingBottom={false} | ||
| offlineIndicatorStyle={[StyleUtils.getBackgroundColorStyle(themeColors.appBG)]} | ||
| > | ||
| {({safeAreaPaddingBottomStyle}) => ( | ||
| <> | ||
| <HeaderWithBackButton | ||
| // eslint-disable-next-line react/jsx-props-no-spreading | ||
| {...propsToPassToHeader} | ||
| titleColor={titleColor} | ||
| iconFill={iconFill} | ||
| /> | ||
| <View style={[styles.flex1, StyleUtils.getBackgroundColorStyle(themeColors.appBG)]}> | ||
| <ScrollView | ||
| contentContainerStyle={[safeAreaPaddingBottomStyle, style]} | ||
| showsVerticalScrollIndicator={false} | ||
| > | ||
| <View style={styles.overscrollSpacer(backgroundColor, windowHeight)} /> | ||
| <View | ||
| style={[ | ||
| styles.alignItemsCenter, | ||
| styles.justifyContentEnd, | ||
| StyleUtils.getBackgroundColorStyle(backgroundColor), | ||
| imageContainerStyle, | ||
| styles.staticHeaderImage, | ||
| ]} | ||
| > | ||
| <Image | ||
| pointerEvents="none" | ||
| style={styles.staticHeaderImage} | ||
| /> | ||
| </View> | ||
| <View style={styles.pt5}>{children}</View> | ||
| </ScrollView> | ||
| {!_.isNull(footer) && <FixedFooter>{footer}</FixedFooter>} | ||
| </View> | ||
| </> | ||
| )} | ||
| </ScreenWrapper> | ||
| ); | ||
| } | ||
|
|
||
| StaticHeaderPageLayout.propTypes = propTypes; | ||
| StaticHeaderPageLayout.defaultProps = defaultProps; | ||
| StaticHeaderPageLayout.displayName = 'StaticHeaderPageLayout'; | ||
|
|
||
| export default StaticHeaderPageLayout; |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
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.
Coming from #29093
I wouldn't call it a regression per se, but rather a case that was missed/not planned, but the button didn't toggle an emoji picker (i.e. pressing a button when the emoji picker is already open didn't close it)