-
Notifications
You must be signed in to change notification settings - Fork 42
[SDK-366] parse-styles-for-components #817
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
lposen
wants to merge
8
commits into
emb-ootb/master
Choose a base branch
from
loren/embedded/SDK-366-new-parse-styles-for-components
base: emb-ootb/master
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
8 commits
Select commit
Hold shift + click to select a range
fb1e938
feat: implement useEmbeddedView hook and associated styles for embedd…
lposen c474b93
test: add unit tests for getStyles function in useEmbeddedView hook
lposen e0c0a24
feat: add configuration modal to Embedded component for dynamic view …
lposen 05114b1
refactor: extract modal styles into a separate file and update Embedd…
lposen d097190
refactor: simplify jsonEditor styles in Embedded component by removin…
lposen 7de5d61
refactor: remove configError state, replacing error handling with an …
lposen 015f8fa
refactor: streamline modal button styles and ensure config editor vis…
lposen 2385cc0
fix: correct syntax in JSDoc example for useEmbeddedView hook
lposen 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
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,43 @@ | ||
| import type { TextStyle, ViewStyle } from "react-native"; | ||
| import { colors } from "./colors"; | ||
|
|
||
| export const modalTitle: TextStyle = { | ||
| fontSize: 18, | ||
| fontWeight: '600', | ||
| marginBottom: 12, | ||
| textAlign: 'center', | ||
| }; | ||
|
|
||
| export const modalOverlay: ViewStyle = { | ||
| backgroundColor: 'rgba(0,0,0,0.5)', | ||
| flex: 1, | ||
| justifyContent: 'center', | ||
| padding: 20, | ||
| }; | ||
|
|
||
| export const modalContent: ViewStyle = { | ||
| backgroundColor: colors.backgroundPrimary, | ||
| borderRadius: 12, | ||
| maxHeight: '80%', | ||
| padding: 16, | ||
| }; | ||
|
|
||
| export const modalButtons: ViewStyle = { | ||
| flexDirection: 'row', | ||
| gap: 12, | ||
| justifyContent: 'flex-end', | ||
| }; | ||
|
|
||
| export const modalButton: ViewStyle = { | ||
| flex: 1, | ||
| }; | ||
|
|
||
| export const modalButtonText: TextStyle = { | ||
| color: colors.brandCyan, | ||
| fontSize: 14, | ||
| fontWeight: '600', | ||
| }; | ||
|
|
||
| export const modalButtonTextSelected: TextStyle = { | ||
| color: colors.backgroundPrimary, | ||
| }; |
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 @@ | ||
| export * from './useEmbeddedView'; |
85 changes: 85 additions & 0 deletions
85
src/embedded/hooks/useEmbeddedView/embeddedViewDefaults.ts
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,85 @@ | ||
| export const embeddedBackgroundColors = { | ||
| notification: '#ffffff', | ||
| card: '#ffffff', | ||
| banner: '#ffffff', | ||
| }; | ||
|
|
||
| export const embeddedBorderColors = { | ||
| notification: '#E0DEDF', | ||
| card: '#E0DEDF', | ||
| banner: '#E0DEDF', | ||
| }; | ||
|
|
||
| export const embeddedPrimaryBtnBackgroundColors = { | ||
| notification: '#6A266D', | ||
| card: 'transparent', | ||
| banner: '#6A266D', | ||
| }; | ||
|
|
||
| export const embeddedPrimaryBtnTextColors = { | ||
| notification: '#ffffff', | ||
| card: '#79347F', | ||
| banner: '#ffffff', | ||
| }; | ||
|
|
||
| export const embeddedSecondaryBtnBackgroundColors = { | ||
| notification: 'transparent', | ||
| card: 'transparent', | ||
| banner: 'transparent', | ||
| }; | ||
|
|
||
| export const embeddedSecondaryBtnTextColors = { | ||
| notification: '#79347F', | ||
| card: '#79347F', | ||
| banner: '#79347F', | ||
| }; | ||
|
|
||
| export const embeddedTitleTextColors = { | ||
| notification: '#3D3A3B', | ||
| card: '#3D3A3B', | ||
| banner: '#3D3A3B', | ||
| }; | ||
|
|
||
| export const embeddedBodyTextColors = { | ||
| notification: '#787174', | ||
| card: '#787174', | ||
| banner: '#787174', | ||
| }; | ||
|
|
||
| export const embeddedBorderRadius = { | ||
| notification: 8, | ||
| card: 6, | ||
| banner: 8, | ||
| }; | ||
|
|
||
| export const embeddedBorderWidth = { | ||
| notification: 1, | ||
| card: 1, | ||
| banner: 1, | ||
| }; | ||
|
|
||
| export const embeddedMediaImageBorderColors = { | ||
| notification: '#E0DEDF', | ||
| card: '#E0DEDF', | ||
| banner: '#E0DEDF', | ||
| }; | ||
|
|
||
| export const embeddedMediaImageBackgroundColors = { | ||
| notification: '#F5F4F4', | ||
| card: '#F5F4F4', | ||
| banner: '#F5F4F4', | ||
| }; | ||
|
|
||
| export const embeddedStyles = { | ||
| backgroundColor: embeddedBackgroundColors, | ||
| bodyText: embeddedBodyTextColors, | ||
| borderColor: embeddedBorderColors, | ||
| borderCornerRadius: embeddedBorderRadius, | ||
| borderWidth: embeddedBorderWidth, | ||
| mediaImageBorder: embeddedMediaImageBorderColors, | ||
| primaryBtnBackgroundColor: embeddedPrimaryBtnBackgroundColors, | ||
| primaryBtnTextColor: embeddedPrimaryBtnTextColors, | ||
| secondaryBtnBackground: embeddedSecondaryBtnBackgroundColors, | ||
| secondaryBtnTextColor: embeddedSecondaryBtnTextColors, | ||
| titleText: embeddedTitleTextColors, | ||
| }; |
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.
Found 2 issues:
1. Function with many returns (count = 5): IterableEmbeddedView [qlty:return-statements]
2. Function with high complexity (count = 5): IterableEmbeddedView [qlty:function-complexity]