package com.trust.ywx.specs.navigation

import android.content.Intent
import com.facebook.react.bridge.ReactApplicationContext
import com.trust.ywx.AppManager
import com.trust.ywx.BuzActivity
import com.trust.ywx.specs.NativeNavigationManagerSpec

class NavigationManager(reactContext: ReactApplicationContext) :
    NativeNavigationManagerSpec(reactContext) {
    override fun navigate(name: String) {
        NavigationHelper.routerName = name
        AppManager.lastActivity()
            ?.startActivity(Intent(AppManager.lastActivity(), BuzActivity::class.java))
//        AppManager.lastActivity()
//            ?.overridePendingTransition(0, 0)
    }

    override fun pop() {
        AppManager.finishActivity(null)
    }

    override fun getName() = NAME

    companion object {
        const val NAME = "NavigationManager"
    }
}