-
Notifications
You must be signed in to change notification settings - Fork 0
feat(ui-react/ui-rnative): use composite pattern for Subheader #398
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
Open
aquelemiguel
wants to merge
15
commits into
main
Choose a base branch
from
dls-479
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
5a796d5
feat: add composite api for subheader
aquelemiguel 798835d
chore: drop dot notation for composite
aquelemiguel 24bbcc2
feat: ditch children lookup for composite
aquelemiguel 3b66be5
feat: stretch action to the right
aquelemiguel cb5a2b3
feat: add react native counterpart
aquelemiguel e9e0922
chore: run lint
aquelemiguel cbabed4
fix: improper variant
aquelemiguel cd898d4
feat: push linter fixes
aquelemiguel 3b22afa
chore: simplify stories
aquelemiguel 10adc14
chore: replace onPress handler in react with onClick
aquelemiguel 3dfc5ed
docs: don't use link inside SubheaderAction
aquelemiguel 1afd8c0
chore: remove SectionHeader isolated component
aquelemiguel a74c2e6
docs: add subcomponents for subheader
aquelemiguel ed7041f
chore: add missing onClick handler to .figma.tsx
aquelemiguel bd45cf3
chore: use box + lx in subheader
aquelemiguel 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
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,101 @@ | ||
| import { | ||
| Subheader, | ||
| SubheaderRow, | ||
| SubheaderTitle, | ||
| SubheaderCount, | ||
| SubheaderHint, | ||
| SubheaderDescription, | ||
| SubheaderAction, | ||
| Tooltip, | ||
| TooltipTrigger, | ||
| TooltipContent, | ||
| InteractiveIcon, | ||
| } from '@ledgerhq/lumen-ui-rnative'; | ||
| import { Information } from '@ledgerhq/lumen-ui-rnative/symbols'; | ||
| import { View, Text, Alert } from 'react-native'; | ||
|
|
||
| export const Subheaders = () => { | ||
| return ( | ||
| <View style={{ gap: 24 }}> | ||
| <Subheader> | ||
| <SubheaderRow> | ||
| <SubheaderTitle>Simple Title</SubheaderTitle> | ||
| </SubheaderRow> | ||
| </Subheader> | ||
|
|
||
| <Subheader> | ||
| <SubheaderRow> | ||
| <SubheaderTitle>With Count</SubheaderTitle> | ||
| <SubheaderCount value={30} /> | ||
| </SubheaderRow> | ||
| </Subheader> | ||
|
|
||
| <Subheader> | ||
| <SubheaderRow> | ||
| <SubheaderTitle>With Hint</SubheaderTitle> | ||
| <SubheaderHint | ||
| content={ | ||
| <Tooltip> | ||
| <TooltipTrigger> | ||
| <InteractiveIcon iconType='stroked'> | ||
| <Information /> | ||
| </InteractiveIcon> | ||
| </TooltipTrigger> | ||
| <TooltipContent | ||
| content={<Text>This is additional information</Text>} | ||
| /> | ||
| </Tooltip> | ||
| } | ||
| /> | ||
| </SubheaderRow> | ||
| </Subheader> | ||
|
|
||
| <Subheader> | ||
| <SubheaderRow> | ||
| <SubheaderTitle>With Action</SubheaderTitle> | ||
| <SubheaderAction onPress={() => console.log('Action pressed')}> | ||
| Manage | ||
| </SubheaderAction> | ||
| </SubheaderRow> | ||
| </Subheader> | ||
|
|
||
| <Subheader> | ||
| <SubheaderRow> | ||
| <SubheaderTitle>Complete Example</SubheaderTitle> | ||
| <SubheaderCount | ||
| value={200} | ||
| format={(n: number) => (n > 99 ? '(99+)' : `(${n})`)} | ||
| /> | ||
| <SubheaderHint | ||
| content={ | ||
| <Tooltip> | ||
| <TooltipTrigger> | ||
| <InteractiveIcon iconType='stroked'> | ||
| <Information /> | ||
| </InteractiveIcon> | ||
| </TooltipTrigger> | ||
| <TooltipContent content={<Text>Info tooltip</Text>} /> | ||
| </Tooltip> | ||
| } | ||
| /> | ||
| <SubheaderAction onPress={() => console.log('Action')}> | ||
| Action | ||
| </SubheaderAction> | ||
| </SubheaderRow> | ||
| <SubheaderDescription> | ||
| This is a description with all features combined | ||
| </SubheaderDescription> | ||
| </Subheader> | ||
|
|
||
| <Subheader> | ||
| <SubheaderRow onPress={() => Alert.alert('Clicked!')}> | ||
| <SubheaderTitle>Clickable Row</SubheaderTitle> | ||
| <SubheaderCount value={12} /> | ||
| </SubheaderRow> | ||
| <SubheaderDescription> | ||
| Entire row is clickable when onPress is provided | ||
| </SubheaderDescription> | ||
| </Subheader> | ||
| </View> | ||
| ); | ||
| }; | ||
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.
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.
have we not decided to call this
SubheaderInfoinstead ?