mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-11 06:47:01 +00:00
e13726e4af
- rework the way social links are displayed/editted; we now only allow to enter a so called "handle" and then substitute that in the final URL template - move the "icon" model role to NIM backend This has several advantages: - we display only the "handle" and don't have to elide some long URL - we won't let users enter random URLs into their profile and spoof the viewing part into clicking it Additionally, make the social link "button" clickable -> navigate to the target URL, and make the tooltip behave as "usual" (on mouse hover).
31 lines
872 B
QML
31 lines
872 B
QML
import QtQuick 2.14
|
|
|
|
import utils 1.0
|
|
|
|
import StatusQ.Core 0.1
|
|
import StatusQ.Controls 0.1
|
|
|
|
StatusInput {
|
|
id: root
|
|
|
|
property int linkType
|
|
property string icon
|
|
|
|
leftPadding: 18 // by design
|
|
|
|
placeholderText: {
|
|
if (linkType === Constants.socialLinkType.twitter) return qsTr("Twitter Handle")
|
|
if (linkType === Constants.socialLinkType.personalSite) return qsTr("Personal Site")
|
|
if (linkType === Constants.socialLinkType.github) return qsTr("Github")
|
|
if (linkType === Constants.socialLinkType.youtube) return qsTr("YouTube Channel")
|
|
if (linkType === Constants.socialLinkType.discord) return qsTr("Discord Handle")
|
|
if (linkType === Constants.socialLinkType.telegram) return qsTr("Telegram Handle")
|
|
return ""
|
|
}
|
|
input.asset {
|
|
name: root.icon
|
|
width: 20
|
|
height: 20
|
|
}
|
|
}
|