-
Notifications
You must be signed in to change notification settings - Fork 31
feat: add brownfield navigation #236
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
hurali97
wants to merge
24
commits into
main
Choose a base branch
from
feat/brownfield-navigation
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
24 commits
Select commit
Hold shift + click to select a range
79d9166
feat: add BrownfieldNavigation TurboModule and other classes
hurali97 531c9fd
feat: consume brownfield navigation
hurali97 03db726
feat: expose brownfield navigation as separate package
hurali97 3efc755
chore: rename to brownfield-navigation
hurali97 b6deb6f
feat: add BrownfieldNavigation framework
hurali97 4bcb4fc
feat: add babel transpiler
hurali97 0a31c7a
feat: add android template
hurali97 32ba266
feat: add android codegen support
hurali97 7b0be42
feat(android): implement BrownfieldNavigationDelegate
hurali97 ded8658
docs: add brownfield-navigation docs
hurali97 575d9b1
feat: move navigation codegen to cli
hurali97 8e2db27
feat: use ts-morph and quicktype
hurali97 d4e8c70
fix: changes
hurali97 91b2a98
fix(ci): add build packages script
hurali97 2e5d58a
chore: align major version
hurali97 d61f4d6
chore: run changeset
hurali97 8592f7d
refactor: remove comments
hurali97 12b33ca
feat: add brownfield-navigation to expo app
hurali97 3f330e0
chore: run changeset
hurali97 4bf34f9
fix: add guard for navigation
hurali97 737a8b3
docs: add note
hurali97 53d1235
feat: throw error if delegate is nil
hurali97 ccdb606
fix: align with obj-c convention
hurali97 9ad26e6
test: add test for navigation codegen
hurali97 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| --- | ||
| '@callstack/brownfield-navigation': minor | ||
| '@callstack/brownfield-cli': minor | ||
| 'brownfield': minor | ||
| '@callstack/brownie': minor | ||
| '@callstack/react-native-brownfield': minor | ||
| --- | ||
|
|
||
| add brownfield navigation | ||
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
63 changes: 63 additions & 0 deletions
63
...ndroidApp/app/src/main/java/com/callstack/brownfield/android/example/ReferralsActivity.kt
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,63 @@ | ||
| package com.callstack.brownfield.android.example | ||
|
|
||
| import android.os.Bundle | ||
| import androidx.activity.ComponentActivity | ||
| import androidx.activity.compose.setContent | ||
| import androidx.activity.enableEdgeToEdge | ||
| import androidx.compose.foundation.layout.Arrangement | ||
| import androidx.compose.foundation.layout.Column | ||
| import androidx.compose.foundation.layout.fillMaxSize | ||
| import androidx.compose.foundation.layout.padding | ||
| import androidx.compose.material3.Button | ||
| import androidx.compose.material3.MaterialTheme | ||
| import androidx.compose.material3.Scaffold | ||
| import androidx.compose.material3.Text | ||
| import androidx.compose.ui.Alignment | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.text.style.TextAlign | ||
| import androidx.compose.ui.unit.dp | ||
| import com.callstack.brownfield.android.example.ui.theme.AndroidBrownfieldAppTheme | ||
|
|
||
| class ReferralsActivity : ComponentActivity() { | ||
| override fun onCreate(savedInstanceState: Bundle?) { | ||
| super.onCreate(savedInstanceState) | ||
| enableEdgeToEdge() | ||
|
|
||
| val userId = intent.getStringExtra(EXTRA_USER_ID).orEmpty() | ||
|
|
||
| setContent { | ||
| AndroidBrownfieldAppTheme { | ||
| Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding -> | ||
| Column( | ||
| modifier = Modifier | ||
| .fillMaxSize() | ||
| .padding(innerPadding) | ||
| .padding(24.dp), | ||
| verticalArrangement = Arrangement.spacedBy(16.dp), | ||
| horizontalAlignment = Alignment.CenterHorizontally | ||
| ) { | ||
| Text( | ||
| text = "Referrals", | ||
| style = MaterialTheme.typography.headlineMedium | ||
| ) | ||
| Text( | ||
| text = "Opened from BrownfieldNavigation.navigateToReferrals(userId).", | ||
| textAlign = TextAlign.Center | ||
| ) | ||
| Text( | ||
| text = "userId: $userId", | ||
| style = MaterialTheme.typography.bodyLarge | ||
| ) | ||
| Button(onClick = { finish() }) { | ||
| Text("Go back") | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| companion object { | ||
| const val EXTRA_USER_ID = "extra_user_id" | ||
| } | ||
| } |
53 changes: 53 additions & 0 deletions
53
...AndroidApp/app/src/main/java/com/callstack/brownfield/android/example/SettingsActivity.kt
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,53 @@ | ||
| package com.callstack.brownfield.android.example | ||
|
|
||
| import android.os.Bundle | ||
| import androidx.activity.ComponentActivity | ||
| import androidx.activity.compose.setContent | ||
| import androidx.activity.enableEdgeToEdge | ||
| import androidx.compose.foundation.layout.Arrangement | ||
| import androidx.compose.foundation.layout.Column | ||
| import androidx.compose.foundation.layout.fillMaxSize | ||
| import androidx.compose.foundation.layout.padding | ||
| import androidx.compose.material3.Button | ||
| import androidx.compose.material3.MaterialTheme | ||
| import androidx.compose.material3.Scaffold | ||
| import androidx.compose.material3.Text | ||
| import androidx.compose.ui.Alignment | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.text.style.TextAlign | ||
| import androidx.compose.ui.unit.dp | ||
| import com.callstack.brownfield.android.example.ui.theme.AndroidBrownfieldAppTheme | ||
|
|
||
| class SettingsActivity : ComponentActivity() { | ||
| override fun onCreate(savedInstanceState: Bundle?) { | ||
| super.onCreate(savedInstanceState) | ||
| enableEdgeToEdge() | ||
|
|
||
| setContent { | ||
| AndroidBrownfieldAppTheme { | ||
| Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding -> | ||
| Column( | ||
| modifier = Modifier | ||
| .fillMaxSize() | ||
| .padding(innerPadding) | ||
| .padding(24.dp), | ||
| verticalArrangement = Arrangement.spacedBy(16.dp), | ||
| horizontalAlignment = Alignment.CenterHorizontally | ||
| ) { | ||
| Text( | ||
| text = "Settings", | ||
| style = MaterialTheme.typography.headlineMedium | ||
| ) | ||
| Text( | ||
| text = "Opened from BrownfieldNavigation.navigateToSettings().", | ||
| textAlign = TextAlign.Center | ||
| ) | ||
| Button(onClick = { finish() }) { | ||
| Text("Go back") | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
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.
Should we go with a major version bump? To maintain parity with
react-native-brownfield, I have set the version to3.0.0forbrownfield-navigationand doing a minor bump here.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.
Always sync
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.
Bumped all minors to align.