package com.adealink.weparty.webview.scheme

import android.net.Uri
import com.adealink.frame.router.Router
import com.adealink.weparty.commonui.ext.getActivity
import com.adealink.weparty.module.joinus.JoinUs
import com.adealink.weparty.webview.IWebView

/**
 * gami://web/playmateApply
 */
class PlaymateApplyScheme(webView: IWebView) :
    WebSchemeHandler(webView, arrayOf(WebScheme.PlaymateApply.PATH)) {
    override fun handle(uri: Uri) {
        val activity = webView.getWebView().context?.getActivity() ?: return
        Router.build(activity, JoinUs.JoinUs.PATH)
            .putExtra(JoinUs.JoinUs.EXTRA_SKIP_GUIDE, true)
            .start()

        webView.webViewCallback?.closeWebView()
    }
}