mirror of
https://github.com/logos-blockchain/lez-programs.git
synced 2026-05-18 15:09:51 +00:00
feat(amm/ui): add initial AMM UI module
This commit is contained in:
parent
1f8eea8442
commit
7ba46b11a4
30
amm-ui/Main.qml
Normal file
30
amm-ui/Main.qml
Normal file
@ -0,0 +1,30 @@
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
|
||||
Item {
|
||||
width: 400
|
||||
height: 300
|
||||
|
||||
ColumnLayout {
|
||||
anchors.centerIn: parent
|
||||
spacing: 12
|
||||
|
||||
Text {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
text: "Hello from ui_qml_example!"
|
||||
font.pixelSize: 18
|
||||
}
|
||||
|
||||
Button {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
text: "Call Core Module"
|
||||
onClicked: {
|
||||
// The logos bridge is injected by the host application.
|
||||
// Uncomment to call a backend module:
|
||||
// var result = logos.callModule("my_module", "myMethod", ["arg"])
|
||||
console.log("Button clicked")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
31
amm-ui/README.md
Normal file
31
amm-ui/README.md
Normal file
@ -0,0 +1,31 @@
|
||||
# AMM UI
|
||||
|
||||
A QML UI application for the Automated Market Maker (AMM) program.
|
||||
|
||||
See the [Logos QML UI App Tutorial](https://github.com/logos-co/logos-tutorial/blob/master/tutorial-qml-ui-app.md) for more information.
|
||||
|
||||
## Setup
|
||||
|
||||
This project requires Nix with experimental features enabled. If you haven't already, enable them permanently:
|
||||
|
||||
```bash
|
||||
mkdir -p ~/.config/nix && echo "experimental-features = nix-command flakes" >> ~/.config/nix/nix.conf
|
||||
```
|
||||
|
||||
## Running the UI
|
||||
|
||||
Start the UI with:
|
||||
|
||||
```bash
|
||||
nix run .
|
||||
```
|
||||
|
||||
This builds and runs the application in development mode.
|
||||
|
||||
## Updating Dependencies
|
||||
|
||||
To update the pinned versions of dependencies in `flake.lock`:
|
||||
|
||||
```bash
|
||||
nix flake update
|
||||
```
|
||||
2553
amm-ui/flake.lock
generated
Normal file
2553
amm-ui/flake.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
14
amm-ui/flake.nix
Normal file
14
amm-ui/flake.nix
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
description = "Logos QML UI Module — replace with your description";
|
||||
|
||||
inputs = {
|
||||
logos-module-builder.url = "github:logos-co/logos-module-builder";
|
||||
};
|
||||
|
||||
outputs = inputs@{ logos-module-builder, ... }:
|
||||
logos-module-builder.lib.mkLogosQmlModule {
|
||||
src = ./.;
|
||||
configFile = ./metadata.json;
|
||||
flakeInputs = inputs;
|
||||
};
|
||||
}
|
||||
BIN
amm-ui/icons/amm.png
Normal file
BIN
amm-ui/icons/amm.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.6 KiB |
24
amm-ui/metadata.json
Normal file
24
amm-ui/metadata.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"name": "amm_ui",
|
||||
"version": "0.1.0",
|
||||
"type": "ui_qml",
|
||||
"category": "amm",
|
||||
"description": "UI module for the AMM program",
|
||||
"view": "Main.qml",
|
||||
"icon": "icons/amm.png",
|
||||
"dependencies": [],
|
||||
|
||||
"nix": {
|
||||
"packages": {
|
||||
"build": [],
|
||||
"runtime": []
|
||||
},
|
||||
"external_libraries": [],
|
||||
"cmake": {
|
||||
"find_packages": [],
|
||||
"extra_sources": [],
|
||||
"extra_include_dirs": [],
|
||||
"extra_link_libraries": []
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user