-
-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added support for nested stack navigators
- Loading branch information
1 parent
a41a3af
commit 69ddd7a
Showing
7 changed files
with
155 additions
and
22 deletions.
There are no files selected for viewing
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,8 @@ | ||
import React from 'react'; | ||
import SharedElementRendererData from './SharedElementRendererData'; | ||
|
||
const SharedElementRendererContext = React.createContext<SharedElementRendererData | null>( | ||
null | ||
); | ||
|
||
export default SharedElementRendererContext; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import SharedElementRendererData, { | ||
ISharedElementRendererData, | ||
} from './SharedElementRendererData'; | ||
import { SharedElementAnimatedValue, SharedElementsConfig } from './types'; | ||
import SharedElementSceneData from './SharedElementSceneData'; | ||
|
||
export class SharedElementRendererProxy implements ISharedElementRendererData { | ||
private data: SharedElementRendererData | null = null; | ||
|
||
startTransition(animValue: SharedElementAnimatedValue) { | ||
if (!this.data) { | ||
console.warn( | ||
'SharedElementRendererProxy.startTransition called before Proxy was initialized' | ||
); | ||
return; | ||
} | ||
return this.data.startTransition(animValue); | ||
} | ||
|
||
endTransition() { | ||
if (!this.data) { | ||
console.warn( | ||
'SharedElementRendererProxy.endTransition called before Proxy was initialized' | ||
); | ||
return; | ||
} | ||
return this.data.endTransition(); | ||
} | ||
|
||
willActivateScene( | ||
sceneData: SharedElementSceneData, | ||
sharedElements: SharedElementsConfig, | ||
animValue?: SharedElementAnimatedValue | ||
) { | ||
if (!this.data) { | ||
console.warn( | ||
'SharedElementRendererProxy.willActivateScene called before Proxy was initialized' | ||
); | ||
return; | ||
} | ||
return this.data.willActivateScene(sceneData, sharedElements, animValue); | ||
} | ||
|
||
didActivateScene(sceneData: SharedElementSceneData) { | ||
if (!this.data) { | ||
console.warn( | ||
'SharedElementRendererProxy.didActivateScene called before Proxy was initialized' | ||
); | ||
return; | ||
} | ||
return this.data.didActivateScene(sceneData); | ||
} | ||
|
||
get source(): SharedElementRendererData | null { | ||
return this.data; | ||
} | ||
|
||
set source(data: SharedElementRendererData | null) { | ||
this.data = data; | ||
} | ||
} |
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