Skip to content

Commit

Permalink
💼 Cüzdan birimi düzenle
Browse files Browse the repository at this point in the history
  • Loading branch information
KimlikDAO-bot committed Jan 7, 2025
1 parent bcedd0b commit 02da6b3
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 52 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
.gizli
.ipynb_checkpoints/
.kdjs_isolate
.secrets.js
.vscode/
*.lock*
*.out.js
Expand Down
4 changes: 2 additions & 2 deletions ana/sayfa.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ import { I18nString } from "/lib/util/i18n"
/** @const {!Array<ChainId>} */
const Chains = [
ChainId.x1,
ChainId.MinaMainnet,
ChainId.xa4b1,
ChainId.MinaMainnet,
ChainId.x89,
ChainId.xa86a,
ChainId.x38
];

/** @const {!Object<ChainId, I18nString>} */
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} */
Expand Down
54 changes: 53 additions & 1 deletion birim/cüzdan/birim.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/**
* Cüzdan
* @name {Kök}
*/
#cu {
display: flex;
align-items: center;
Expand All @@ -6,6 +10,7 @@

/**
* Ağ düğmesi
* @export {AğDüğmesi}
*/
#cuc {
min-width: 48px;
Expand All @@ -15,6 +20,7 @@

/**
* Adres düğmesi
* @export {AdresDüğmesi}
*/
#cua {
margin-right: 10px;
Expand All @@ -26,6 +32,7 @@

/**
* Cüzdan dropdownı
* @export {Menü}
*/
#cub {
background-color: #fff;
Expand All @@ -48,6 +55,10 @@
}
}

/**
* AÄŸ listesi
* @export {AÄŸListesi}
*/
#cud {
cursor: pointer;
list-style: none;
Expand All @@ -57,6 +68,10 @@
border-right: 1px solid #f2f2f2;
}

/**
* Cüzdan sağ paneli
* @export {SaÄŸPanel}
*/
#cue {
list-style: none;
margin: 0;
Expand All @@ -67,6 +82,10 @@
right: 0;
}

/**
* Bağlantı listesi
* @name {BağlantıListesi}
*/
.cuf {
cursor: pointer;
list-style: none;
Expand Down Expand Up @@ -105,19 +124,31 @@
background-color: #eee;
}

/**
* Profil
* @name {Profil}
*/
#cueh {
display: flex;
height: 90px;
padding: 8px;
}

/**
* Profil resmi
* @export {ProfilResmi}
*/
#cutc {
cursor: pointer;
margin-right: 8px;
background: #fff;
border: 1px solid rgba(200, 200, 200, 0.5);
}

/**
* Adres metni
* @export {CüzdanAdresi}
*/
#cuad {
color: #666;
cursor: pointer;
Expand All @@ -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;
Expand Down Expand Up @@ -179,6 +223,10 @@ li.on>.cust {
text-wrap: nowrap;
}

/**
* KPass eylem düğmesi
* @export {KPassDüğmesi}
*/
#cuin {
margin-top: 20px;
}
Expand All @@ -188,6 +236,10 @@ li.on>.cust {
right: 7px;
}

/**
* AÄŸ notu metni
* @name {AÄŸNotu}
*/
.cuo {
color: #6337ba;
font-size: 9pt;
Expand Down
37 changes: 19 additions & 18 deletions birim/cüzdan/birim.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -98,7 +99,7 @@ const Bağlantılar = {
/** @const {!Set<ChainId>} */
const AÄŸlar = new Set(Chains);
/** @const {string} */
const BaÄŸlaMetni = AdresButonu.innerText;
const BağlaMetni = AdresDüğmesi.innerText;
/** @type {!Array<function(?string)>} */
const AdresDeÄŸiÅŸince = [];
/** @const {!Array<function()>} */
Expand Down Expand Up @@ -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ÄŸ;
Expand All @@ -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ÄŸ;
Expand Down Expand Up @@ -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();
Expand All @@ -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) {
Expand Down Expand Up @@ -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) => {
Expand All @@ -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}`;
Expand Down
60 changes: 30 additions & 30 deletions birim/cüzdan/birim.jsx
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -35,7 +35,7 @@ const bağlantıResmi = (ad) => `birim/cüzdan/img/${ad.split(" ")[0].toLowerCas
* @return {string}
*/
const Bağlantı = ({ idx, name }) => (
<li id={"cu" + idx}>
<li id={Css.Kök + idx}>
<Image src={bağlantıResmi(name)} width={32} height={32} />
<div class="cust"></div> {name}<span class="cui" style="display:none" data-en="GET">İNDİR</span>
</li>
Expand All @@ -51,45 +51,45 @@ const Bağlantı = ({ idx, name }) => (
* @return {string}
*/
const Cüzdan = ({ DefaultChain, Chains, ChainNotes, piggyback }) => (
<div id="cu">
<div id={Css.Kök}>
<Css />
<AÄŸButonu><Image src={aÄŸResmi(DefaultChain)} height={32} width={32} /></AÄŸButonu>
<AdresButonu data-en="Connect wallet">Cüzdan bağla</AdresButonu>
<Menü style="display:none" tabindex="0">
<ul id="cud">
<AğDüğmesi><Image src={ağResmi(DefaultChain)} height={32} width={32} inline /></AğDüğmesi>
<AdresDüğmesi>{{ tr: "Cüzdan bağla", en: "Connect wallet" }}</AdresDüğmesi>
<Menü style="display:none" tabindex={0}>
<ul id={Css.AÄŸListesi}>
{Chains.map((id) => (
<li id={`cud${id}`} class={id == DefaultChain ? "sel" : ""}>
<li id={Css.AÄŸListesi + id} class={id == DefaultChain ? "sel" : ""}>
{id == DefaultChain ? <span></span> : <Image src={aÄŸResmi(id)} width={32} height={32} />}
{" "}
{ChainNotes[id]
? <div>{AÄŸBilgileri[id].ad}<div class="cuo">{ChainNotes[id]}</div></div>
? <div>{AÄŸBilgileri[id].ad}<div class={Css.AÄŸNotu}>{ChainNotes[id]}</div></div>
: AÄŸBilgileri[id].ad}
</li>
))}
</ul>
<ul id="cuf0x" class="cuf">
<ul id="cuf0x" class={Css.BağlantıListesi}>
<Bağlantı idx="ra" name="Rabby Wallet" />
<Bağlantı idx="co" name="Core" />
<Bağlantı idx="mm" name="Metamask" />
</ul>
<ul id="cufmi" class="cuf" style="display:none">
<ul id="cufmi" class={Css.BağlantıListesi} style="display:none">
<Bağlantı idx="au" name="Auro" />
</ul>
<SaÄŸPanel style="display:none">
<div id="cueh">
<QmarkResmi id="cutc" height={80} width={80} />
<div id={Css.Profil}>
<QmarkResmi id={Css.ProfilResmi} height={80} width={80} />
<div>
<div id="cuad"><span>0xcCc...cCc</span><span id="cuadi"><KopyalaResmi inline /></span></div>
<DebankLinki>DeBank</DebankLinki> <span id="cuex">Explorer</span>
<div id="cuin" data-en="MINT KPASS">KPASS AL</div>
<CüzdanAdresi><span>0xcCc...cCc</span><span id="cuadi"><KopyalaResmi inline /></span></CüzdanAdresi>
<DebankLinki>DeBank</DebankLinki> <span id={Css.ExplorerLinki}>Explorer</span>
<div id={Css.KPassDüğmesi} data-en="MINT KPASS">KPASS AL</div>
</div>
</div>
<hr />
<li><AmbassadorResmi inline />{{
en: " Ambassador program",
tr: " Ambassador ol"
}}</li>
<li><VoteResmi width="16" height="16" />{{
<li><VoteResmi width={16} height={16} />{{
en: " Vote",
tr: " Oy kullan"
}}</li>
Expand Down

0 comments on commit 02da6b3

Please sign in to comment.