From 02da6b32d68258365ef79805cf31f09b8389b28c Mon Sep 17 00:00:00 2001 From: KimlikDAO-bot Date: Tue, 7 Jan 2025 13:49:57 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=BC=20C=C3=BCzdan=20birimi=20d=C3=BCze?= =?UTF-8?q?nle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + ana/sayfa.jsx | 4 +-- "birim/c\303\274zdan/birim.css" | 54 ++++++++++++++++++++++++++++- "birim/c\303\274zdan/birim.js" | 37 ++++++++++---------- "birim/c\303\274zdan/birim.jsx" | 60 ++++++++++++++++----------------- lib | 2 +- 6 files changed, 106 insertions(+), 52 deletions(-) diff --git a/.gitignore b/.gitignore index f1f103c3..21b56a9a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ .gizli .ipynb_checkpoints/ .kdjs_isolate +.secrets.js .vscode/ *.lock* *.out.js diff --git a/ana/sayfa.jsx b/ana/sayfa.jsx index e36fbfd2..18088d7f 100644 --- a/ana/sayfa.jsx +++ b/ana/sayfa.jsx @@ -23,8 +23,8 @@ import { I18nString } from "/lib/util/i18n" /** @const {!Array} */ const Chains = [ ChainId.x1, - ChainId.MinaMainnet, ChainId.xa4b1, + ChainId.MinaMainnet, ChainId.x89, ChainId.xa86a, ChainId.x38 @@ -32,8 +32,8 @@ const Chains = [ /** @const {!Object} */ const ChainNotes = { + [ChainId.xa4b1]: { tr: "Ana ağ", en: "Signal chain" }, [ChainId.MinaMainnet]: { tr: "Yeni ✨", en: "New ✨" }, - [ChainId.xa4b1]: { tr: "Ana ağ", en: "Signal chain" } }; /** @const {ChainId} */ diff --git "a/birim/c\303\274zdan/birim.css" "b/birim/c\303\274zdan/birim.css" index 8b66896b..a95111dd 100644 --- "a/birim/c\303\274zdan/birim.css" +++ "b/birim/c\303\274zdan/birim.css" @@ -1,3 +1,7 @@ +/** + * Cüzdan + * @name {Kök} + */ #cu { display: flex; align-items: center; @@ -6,6 +10,7 @@ /** * Ağ düğmesi + * @export {AğDüğmesi} */ #cuc { min-width: 48px; @@ -15,6 +20,7 @@ /** * Adres düğmesi + * @export {AdresDüğmesi} */ #cua { margin-right: 10px; @@ -26,6 +32,7 @@ /** * Cüzdan dropdownı + * @export {Menü} */ #cub { background-color: #fff; @@ -48,6 +55,10 @@ } } +/** + * Ağ listesi + * @export {AğListesi} + */ #cud { cursor: pointer; list-style: none; @@ -57,6 +68,10 @@ border-right: 1px solid #f2f2f2; } +/** + * Cüzdan sağ paneli + * @export {SağPanel} + */ #cue { list-style: none; margin: 0; @@ -67,6 +82,10 @@ right: 0; } +/** + * Bağlantı listesi + * @name {BağlantıListesi} + */ .cuf { cursor: pointer; list-style: none; @@ -105,12 +124,20 @@ background-color: #eee; } +/** + * Profil + * @name {Profil} + */ #cueh { display: flex; height: 90px; padding: 8px; } +/** + * Profil resmi + * @export {ProfilResmi} + */ #cutc { cursor: pointer; margin-right: 8px; @@ -118,6 +145,10 @@ border: 1px solid rgba(200, 200, 200, 0.5); } +/** + * Adres metni + * @export {CüzdanAdresi} + */ #cuad { color: #666; cursor: pointer; @@ -136,7 +167,20 @@ top: 1px; } -#cude, +/** + * Debank linki + * @export {DebankLinki} + */ +#cude { + cursor: pointer; + font-size: 9pt; + color: #666; +} + +/** + * Explorer linki + * @export {ExplorerLinki} + */ #cuex { cursor: pointer; font-size: 9pt; @@ -179,6 +223,10 @@ li.on>.cust { text-wrap: nowrap; } +/** + * KPass eylem düğmesi + * @export {KPassDüğmesi} + */ #cuin { margin-top: 20px; } @@ -188,6 +236,10 @@ li.on>.cust { right: 7px; } +/** + * Ağ notu metni + * @name {AğNotu} + */ .cuo { color: #6337ba; font-size: 9pt; diff --git "a/birim/c\303\274zdan/birim.js" "b/birim/c\303\274zdan/birim.js" index 3bc1e675..a9b372fb 100644 --- "a/birim/c\303\274zdan/birim.js" +++ "b/birim/c\303\274zdan/birim.js" @@ -1,7 +1,8 @@ +import Css from "./birim.css"; import { - AdresButonu, - AdresMetni, - AğButonu, + AdresDüğmesi, + AğDüğmesi, + CüzdanAdresi, DebankLinki, Menü, SağPanel @@ -98,7 +99,7 @@ const Bağlantılar = { /** @const {!Set} */ const Ağlar = new Set(Chains); /** @const {string} */ -const BağlaMetni = AdresButonu.innerText; +const BağlaMetni = AdresDüğmesi.innerText; /** @type {!Array} */ const AdresDeğişince = []; /** @const {!Array} */ @@ -165,9 +166,9 @@ const ağDeğişti = (yeniAğ) => { } else if (yeniAğ != Ağ) { dom.adla("cud" + Ağ).classList.remove("sel"); dom.adla("cud" + yeniAğ).classList.add("sel"); - AğButonu.replaceChild( + AğDüğmesi.replaceChild( dom.adla("cud" + yeniAğ).firstElementChild.cloneNode(true), - AğButonu.firstElementChild); + AğDüğmesi.firstElementChild); /** @const {boolean} */ const ağGrubuDeğişti = !Ağ.startsWith(yeniAğ.slice(0, 2)); Ağ = yeniAğ; @@ -181,9 +182,9 @@ const ağDeğişti = (yeniAğ) => { const kpassDeğişti = () => { if (!Adres) return; /** @const {!HTMLDivElement} */ - const kpassDüğmesi = dom.div("cuin"); + const kpassDüğmesi = dom.div(Css.KPassDüğmesi); /** @const {!HTMLImageElement} */ - const kpassResmi = dom.img("cutc"); + const kpassResmi = dom.img(Css.ProfilResmi); /** @const {ChainId} */ const ağ = Ağ; @@ -221,7 +222,7 @@ const kpassDeğişti = () => { const koptu = () => { Adres = null; - AdresButonu.innerText = BağlaMetni; + AdresDüğmesi.innerText = BağlaMetni; bağlantıSeçildi("", BoşBağlantı); dom.gizle(SağPanel); bağlantıSeçiciGöster(); @@ -238,11 +239,11 @@ const adresDeğişti = (adresler) => { /** @const {?string} */ const eskiAdres = Adres; Adres = adresler[0]; - AdresMetni.firstElementChild.innerText = - AdresButonu.innerText = hızlıArabirimAdı(Adres); + CüzdanAdresi.firstElementChild.innerText = + AdresDüğmesi.innerText = hızlıArabirimAdı(Adres); nihaiArabirimAdı(Adres).then((ad) => { - if (ad) AdresButonu.innerText = ad; + if (ad) AdresDüğmesi.innerText = ad; }); kpassDeğişti(); if (!eskiAdres) { @@ -373,20 +374,20 @@ const izinliyseBağla = () => { const aç = () => { dom.göster(Menü); - AğButonu.onclick = null; - AdresButonu.onclick = null; + AğDüğmesi.onclick = null; + AdresDüğmesi.onclick = null; Menü.focus(); } const kur = () => { /** @const {!Element} */ const seçiliAğ = dom.adla("cud" + DefaultChain); - seçiliAğ.replaceChild(AğButonu.firstElementChild.cloneNode(true), + seçiliAğ.replaceChild(AğDüğmesi.firstElementChild.cloneNode(true), seçiliAğ.firstElementChild); - AdresButonu.onclick = AğButonu.onclick = aç; + AdresDüğmesi.onclick = AğDüğmesi.onclick = aç; Menü.onblur = () => { dom.gizle(Menü); - setTimeout(() => AdresButonu.onclick = AğButonu.onclick = aç, 300); + setTimeout(() => AdresDüğmesi.onclick = AğDüğmesi.onclick = aç, 300); }; dom.adla("cud").onclick = (event) => { @@ -408,7 +409,7 @@ const kur = () => { window.location.href = "//kimlikdao.org/" + dom.i18n({ tr: "iptal", en: "revoke" }); düğmeler[5].onclick = () => koptu(); - AdresMetni.onclick = () => navigator.clipboard.writeText(/** @type {string} */(Adres)); + CüzdanAdresi.onclick = () => navigator.clipboard.writeText(/** @type {string} */(Adres)); dom.adla("cuex").onclick = () => { const adresEki = Ağ.startsWith("mi") ? "wallet" : "address"; const url = `//${AğBilgileri[Ağ].izleyici}/${adresEki}/${Adres}`; diff --git "a/birim/c\303\274zdan/birim.jsx" "b/birim/c\303\274zdan/birim.jsx" index c673317a..d646bbc7 100644 --- "a/birim/c\303\274zdan/birim.jsx" +++ "b/birim/c\303\274zdan/birim.jsx" @@ -1,28 +1,28 @@ import { AğBilgileri, ağResmi } from "../ağlar/birim"; import Css from "./birim.css"; -import { ChainId } from "/lib/crosschain/chains"; -import dom from "/lib/util/dom"; -import { I18nString } from "/lib/util/i18n"; -import { Image } from "/lib/kastro/image"; -import QmarkResmi from "/birim/cüzdan/img/qmark.svg"; import AmbassadorResmi from "/birim/cüzdan/img/ambassador.svg"; -import VoteResmi from "/birim/cüzdan/img/vote.svg"; -import İptalResmi from "/birim/cüzdan/img/iptal.svg"; import DeğiştirResmi from "/birim/cüzdan/img/external-link.svg"; +import İptalResmi from "/birim/cüzdan/img/iptal.svg"; +import QmarkResmi from "/birim/cüzdan/img/qmark.svg"; +import VoteResmi from "/birim/cüzdan/img/vote.svg"; import KopyalaResmi from "/birim/paste.svg"; +import { ChainId } from "/lib/crosschain/chains"; +import { Image } from "/lib/kastro/image"; +import dom from "/lib/util/dom"; +import { I18nString } from "/lib/util/i18n"; /** @const {!HTMLButtonElement} */ -export const AdresButonu = dom.button("cua"); -/** @const {!HTMLSpanElement} */ -export const AdresMetni = dom.span("cuad"); +export const AdresDüğmesi = dom.button(Css.AdresDüğmesi); /** @const {!HTMLButtonElement} */ -export const AğButonu = dom.button("cuc"); +export const AğDüğmesi = dom.button(Css.AğDüğmesi); +/** @const {!HTMLDivElement} */ +export const CüzdanAdresi = dom.div(Css.CüzdanAdresi); /** @const {!HTMLSpanElement} */ -export const DebankLinki = dom.span("cude"); +export const DebankLinki = dom.span(Css.DebankLinki); /** @const {!HTMLDivElement} */ -export const Menü = dom.div("cub"); +export const Menü = dom.div(Css.Menü); /** @const {!HTMLUListElement} */ -export const SağPanel = dom.ul("cue"); +export const SağPanel = dom.ul(Css.SağPanel); /** * @param {string} ad @@ -35,7 +35,7 @@ const bağlantıResmi = (ad) => `birim/cüzdan/img/${ad.split(" ")[0].toLowerCas * @return {string} */ const Bağlantı = ({ idx, name }) => ( -
  • +
  •  {name}
  • @@ -51,37 +51,37 @@ const Bağlantı = ({ idx, name }) => ( * @return {string} */ const Cüzdan = ({ DefaultChain, Chains, ChainNotes, piggyback }) => ( -
    +
    - - Cüzdan bağla - -
      + + {{ tr: "Cüzdan bağla", en: "Connect wallet" }} + +
        {Chains.map((id) => ( -
      • +
      • {id == DefaultChain ? : } {" "} {ChainNotes[id] - ?
        {AğBilgileri[id].ad}
        {ChainNotes[id]}
        + ?
        {AğBilgileri[id].ad}
        {ChainNotes[id]}
        : AğBilgileri[id].ad}
      • ))}
      -
        +
        -