Skip to content

Commit

Permalink
Merge pull request #93 from kounkou/post-to-social-media
Browse files Browse the repository at this point in the history
(feature) Post to social media
  • Loading branch information
kounkou authored Nov 2, 2024
2 parents ca814c6 + 0606fec commit e490227
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions images/facebook.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions images/x-twitter.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions qml/PracticePage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,29 @@ Rectangle {
}
}

Rectangle {
id: shareOnX
height: 25
width: 70
radius: 10
visible: isCurrentAnswerCorrect

Image {
source: "x-twitter.svg"
fillMode: Image.PreserveAspectFit
anchors.fill: parent

MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: {
let question = QuestionsHandler.getQuestion(questionsData, currentQuestionIndex)
Qt.openUrlExternally("https://x.com/intent/post?text=Just+solved+" + question + "+on+%40Hedgehog%21+🦔+%0A%0A+https://github.com/kounkou/Hedgehog")
}
}
}
}

Item {
Layout.fillWidth: true
}
Expand Down
2 changes: 2 additions & 0 deletions resources.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,7 @@
<file alias="font-dark.svg">images/font-dark.svg</file>
<file alias="appearance-light.svg">images/appearance-light.svg</file>
<file alias="font-light.svg">images/font-light.svg</file>
<file alias="x-twitter.svg">images/x-twitter.svg</file>
<file alias="facebook.svg">images/facebook.svg</file>
</qresource>
</RCC>

0 comments on commit e490227

Please sign in to comment.