-
Notifications
You must be signed in to change notification settings - Fork 3k
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
feat: empty ui for create flows #42413
Merged
mountiny
merged 32 commits into
Expensify:main
from
tienifr:feature/empty-ui-for-create-flows
Aug 14, 2024
+809
−12
Merged
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
403fc65
feat: empty ui for create flows
tienifr dbbe56a
fix illustration overflow
tienifr 77414dc
Merge branch 'main' of https://github.com/tienifr/App into feature/em…
tienifr d8aab64
fix: icon is clipped in ios
tienifr bd55add
modify line break
tienifr 7e2a1e7
Merge branch 'main' of https://github.com/tienifr/App into feature/em…
tienifr b191d36
fix lint
tienifr c759252
Merge branch 'main' of https://github.com/tienifr/App into feature/em…
tienifr f08701f
update copies and only show empty ui in some create flows
tienifr 3c5a3ab
Merge branch 'main' of https://github.com/tienifr/App into feature/em…
tienifr c7077e4
Merge branch 'main' of https://github.com/tienifr/App into feature/em…
tienifr b06f0be
remove native ListEmptyContent
tienifr 52d2bd9
Merge branch 'main' of https://github.com/tienifr/App into feature/em…
tienifr 2dad766
reapply changes
tienifr 8dc5bd4
Merge branch 'main' of https://github.com/tienifr/App into feature/em…
tienifr 7534ebc
let empty state ui be obsecured by keyboard
tienifr 9cb5622
Merge branch 'main' of https://github.com/tienifr/App into feature/em…
tienifr 9dbbd20
Merge branch 'main' of https://github.com/tienifr/App into feature/em…
tienifr 0f2106d
Merge branch 'main' of https://github.com/tienifr/App into feature/em…
tienifr d616f64
Merge branch 'main' of https://github.com/tienifr/App into feature/em…
tienifr 2e39825
revert: let empty state ui be obsecured by keyboard
tienifr 4a837df
resize icon to 120x125
tienifr 554e1cb
Merge branch 'main' of https://github.com/tienifr/App into feature/em…
tienifr 42c7e9a
fix: empty ui jumps
tienifr 9e9a3dd
Merge branch 'main' of https://github.com/tienifr/App into feature/em…
tienifr ee36a72
Merge branch 'main' of https://github.com/tienifr/App into feature/em…
tienifr 5566c28
Merge branch 'main' of https://github.com/tienifr/App into feature/em…
tienifr 6c015dd
fix: blink ui
tienifr 6ff0875
Merge branch 'main' into feature/empty-ui-for-create-flows
tienifr 5f9cb38
flicker issue
tienifr 10a792e
add padding bottom
tienifr 023eba1
increase padding
tienifr 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
667 changes: 667 additions & 0 deletions
667
assets/images/product-illustrations/todd-with-phones.svg
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import React from 'react'; | ||
import {View} from 'react-native'; | ||
import type {TupleToUnion} from 'type-fest'; | ||
import useLocalize from '@hooks/useLocalize'; | ||
import useThemeStyles from '@hooks/useThemeStyles'; | ||
import variables from '@styles/variables'; | ||
import CONST from '@src/CONST'; | ||
import BlockingView from './BlockingViews/BlockingView'; | ||
import * as Illustrations from './Icon/Illustrations'; | ||
import Text from './Text'; | ||
import TextLink from './TextLink'; | ||
|
||
type EmptySelectionListContentProps = { | ||
/** Type of selection list */ | ||
contentType: string; | ||
}; | ||
|
||
const CONTENT_TYPES = [CONST.IOU.TYPE.SUBMIT, CONST.IOU.TYPE.SPLIT, CONST.IOU.TYPE.PAY]; | ||
type ContentType = TupleToUnion<typeof CONTENT_TYPES>; | ||
|
||
function isContentType(contentType: unknown): contentType is ContentType { | ||
return CONTENT_TYPES.includes(contentType as ContentType); | ||
} | ||
|
||
function EmptySelectionListContent({contentType}: EmptySelectionListContentProps) { | ||
const styles = useThemeStyles(); | ||
const {translate} = useLocalize(); | ||
|
||
if (!isContentType(contentType)) { | ||
return null; | ||
} | ||
|
||
const EmptySubtitle = ( | ||
<Text style={[styles.textAlignCenter]}> | ||
{translate(`emptyList.${contentType}.subtitleText1`)} | ||
<TextLink href={CONST.REFERRAL_PROGRAM.LEARN_MORE_LINK}>{translate(`emptyList.${contentType}.subtitleText2`)}</TextLink> | ||
{translate(`emptyList.${contentType}.subtitleText3`)} | ||
</Text> | ||
); | ||
|
||
return ( | ||
<View style={[styles.flex1, styles.overflowHidden]}> | ||
<BlockingView | ||
icon={Illustrations.ToddWithPhones} | ||
iconWidth={variables.emptySelectionListIconWidth} | ||
iconHeight={variables.emptySelectionListIconHeight} | ||
title={translate(`emptyList.${contentType}.title`)} | ||
shouldShowLink={false} | ||
CustomSubtitle={EmptySubtitle} | ||
containerStyle={[styles.mb8, styles.ph15]} | ||
/> | ||
</View> | ||
); | ||
} | ||
|
||
EmptySelectionListContent.displayName = 'EmptySelectionListContent'; | ||
|
||
export default EmptySelectionListContent; |
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
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
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.
This line introduces #50577
More details in here: #50577 (comment)