mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-10-23 03:26:59 +09:00
* refactor: focus controller refactoring * feat: update to new design system * feat: update to new desing system * chore: bump version
79 lines
2.1 KiB
QML
79 lines
2.1 KiB
QML
pragma ComponentBehavior: Bound
|
|
|
|
import QtQuick
|
|
import QtQuick.Controls
|
|
import QtQuick.Layouts
|
|
import PageEnum 1.0
|
|
import Style 1.0
|
|
|
|
import "../Controls2"
|
|
import "../Controls2/TextTypes"
|
|
|
|
SheetType {
|
|
id: root
|
|
|
|
property bool isRenewalAvailable: false
|
|
|
|
expandedHeight: content.implicitHeight + 8 + PageController.safeAreaBottomMargin
|
|
|
|
onAboutToShow: {
|
|
isRenewalAvailable = ServersUiController.isServerRenewalAvailable(ServersUiController.defaultServerId) && !ApiAccountInfoModel.data("isInAppPurchase")
|
|
}
|
|
|
|
ColumnLayout {
|
|
id: content
|
|
|
|
anchors.top: parent.top
|
|
anchors.left: parent.left
|
|
anchors.right: parent.right
|
|
|
|
spacing: 0
|
|
|
|
SectionHeaderType {
|
|
Layout.fillWidth: true
|
|
Layout.topMargin: 16
|
|
Layout.rightMargin: 16
|
|
Layout.leftMargin: 16
|
|
|
|
headerText: ServersUiController.serverName(ServersUiController.defaultServerId) + qsTr(" subscription has expired")
|
|
descriptionText: root.isRenewalAvailable ? qsTr("Renew to continue using VPN") : ""
|
|
}
|
|
|
|
ButtonType {
|
|
visible: root.isRenewalAvailable
|
|
|
|
Layout.fillWidth: true
|
|
Layout.topMargin: 26
|
|
Layout.rightMargin: 16
|
|
Layout.leftMargin: 16
|
|
|
|
text: qsTr("Renew")
|
|
|
|
onClicked: {
|
|
SubscriptionUiController.getRenewalLink(ServersUiController.defaultServerId)
|
|
}
|
|
}
|
|
|
|
ButtonType {
|
|
Layout.fillWidth: true
|
|
Layout.topMargin: root.isRenewalAvailable ? 12 : 26
|
|
Layout.rightMargin: 16
|
|
Layout.leftMargin: 16
|
|
|
|
variant: ButtonType.Text
|
|
|
|
text: qsTr("Support")
|
|
|
|
onClicked: {
|
|
PageController.showBusyIndicator(true)
|
|
let result = SubscriptionUiController.getAccountInfo(ServersUiController.defaultServerId, false)
|
|
PageController.showBusyIndicator(false)
|
|
if (result) {
|
|
root.close()
|
|
PageController.goToPage(PageEnum.PageSettingsApiSupport)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|