extract lang
This commit is contained in:
@ -74,7 +74,7 @@ export function LoginSignup({ close }: { close: () => void }) {
|
|||||||
function createAccount() {
|
function createAccount() {
|
||||||
const newKey = bytesToHex(schnorr.utils.randomPrivateKey());
|
const newKey = bytesToHex(schnorr.utils.randomPrivateKey());
|
||||||
setNewKey(newKey);
|
setNewKey(newKey);
|
||||||
setLnAddress(`${getPublicKey(newKey)}@zap.stream`)
|
setLnAddress(`${getPublicKey(newKey)}@zap.stream`);
|
||||||
setStage(Stage.Details);
|
setStage(Stage.Details);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -106,7 +106,7 @@ export function LoginSignup({ close }: { close: () => void }) {
|
|||||||
const info = await px.info();
|
const info = await px.info();
|
||||||
setProviderInfo(info);
|
setProviderInfo(info);
|
||||||
|
|
||||||
setStage(Stage.LnAddress)
|
setStage(Stage.LnAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function saveProfile() {
|
async function saveProfile() {
|
||||||
@ -116,9 +116,11 @@ export function LoginSignup({ close }: { close: () => void }) {
|
|||||||
const lnurl = new LNURL(lnAddress);
|
const lnurl = new LNURL(lnAddress);
|
||||||
await lnurl.load();
|
await lnurl.load();
|
||||||
} catch {
|
} catch {
|
||||||
throw new Error(formatMessage({
|
throw new Error(
|
||||||
defaultMessage: "Hmm, your lightning address looks wrong"
|
formatMessage({
|
||||||
}));
|
defaultMessage: "Hmm, your lightning address looks wrong",
|
||||||
|
})
|
||||||
|
);
|
||||||
}
|
}
|
||||||
const pub = EventPublisher.privateKey(key);
|
const pub = EventPublisher.privateKey(key);
|
||||||
const profile = {
|
const profile = {
|
||||||
@ -162,11 +164,13 @@ export function LoginSignup({ close }: { close: () => void }) {
|
|||||||
<FormattedMessage defaultMessage="OR" />
|
<FormattedMessage defaultMessage="OR" />
|
||||||
<hr />
|
<hr />
|
||||||
</div>
|
</div>
|
||||||
{hasNostrExtension && <>
|
{hasNostrExtension && (
|
||||||
<AsyncButton type="button" className="btn btn-primary btn-block" onClick={loginNip7}>
|
<>
|
||||||
<FormattedMessage defaultMessage="Nostr Extension" />
|
<AsyncButton type="button" className="btn btn-primary btn-block" onClick={loginNip7}>
|
||||||
</AsyncButton>
|
<FormattedMessage defaultMessage="Nostr Extension" />
|
||||||
</>}
|
</AsyncButton>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
<button type="button" className="btn btn-primary btn-block" onClick={() => setStage(Stage.LoginInput)}>
|
<button type="button" className="btn btn-primary btn-block" onClick={() => setStage(Stage.LoginInput)}>
|
||||||
<FormattedMessage defaultMessage="Login with Private Key (insecure)" />
|
<FormattedMessage defaultMessage="Login with Private Key (insecure)" />
|
||||||
</button>
|
</button>
|
||||||
@ -184,22 +188,35 @@ export function LoginSignup({ close }: { close: () => void }) {
|
|||||||
<FormattedMessage defaultMessage="Login with private key" />
|
<FormattedMessage defaultMessage="Login with private key" />
|
||||||
</h2>
|
</h2>
|
||||||
<p>
|
<p>
|
||||||
<FormattedMessage defaultMessage="This method is insecure. We recommend using a {nostrlink}" values={{
|
<FormattedMessage
|
||||||
nostrlink: <a href="">
|
defaultMessage="This method is insecure. We recommend using a {nostrlink}"
|
||||||
<FormattedMessage defaultMessage="nostr signer extension" />
|
values={{
|
||||||
</a>
|
nostrlink: (
|
||||||
}} />
|
<a href="">
|
||||||
|
<FormattedMessage defaultMessage="nostr signer extension" />
|
||||||
|
</a>
|
||||||
|
),
|
||||||
|
}}
|
||||||
|
/>
|
||||||
</p>
|
</p>
|
||||||
<div className="paper">
|
<div className="paper">
|
||||||
<input type="text" value={key} onChange={e => setNewKey(e.target.value)} placeholder={formatMessage({ defaultMessage: "eg. nsec1xyz" })} />
|
<input
|
||||||
|
type="text"
|
||||||
|
value={key}
|
||||||
|
onChange={e => setNewKey(e.target.value)}
|
||||||
|
placeholder={formatMessage({ defaultMessage: "eg. nsec1xyz" })}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex f-space">
|
<div className="flex f-space">
|
||||||
<div></div>
|
<div></div>
|
||||||
<div className="flex g8">
|
<div className="flex g8">
|
||||||
<button type="button" className="btn btn-secondary" onClick={() => {
|
<button
|
||||||
setNewKey("");
|
type="button"
|
||||||
setStage(Stage.Login)
|
className="btn btn-secondary"
|
||||||
}}>
|
onClick={() => {
|
||||||
|
setNewKey("");
|
||||||
|
setStage(Stage.Login);
|
||||||
|
}}>
|
||||||
<FormattedMessage defaultMessage="Cancel" />
|
<FormattedMessage defaultMessage="Cancel" />
|
||||||
</button>
|
</button>
|
||||||
<AsyncButton onClick={doLoginNsec} className="btn btn-primary">
|
<AsyncButton onClick={doLoginNsec} className="btn btn-primary">
|
||||||
@ -210,7 +227,7 @@ export function LoginSignup({ close }: { close: () => void }) {
|
|||||||
{error && <b className="error">{error}</b>}
|
{error && <b className="error">{error}</b>}
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
case Stage.Details: {
|
case Stage.Details: {
|
||||||
return (
|
return (
|
||||||
@ -234,7 +251,12 @@ export function LoginSignup({ close }: { close: () => void }) {
|
|||||||
</div>
|
</div>
|
||||||
<div className="username">
|
<div className="username">
|
||||||
<div className="paper">
|
<div className="paper">
|
||||||
<input type="text" placeholder="Username" value={username} onChange={e => setUsername(e.target.value)} />
|
<input
|
||||||
|
type="text"
|
||||||
|
placeholder="Username"
|
||||||
|
value={username}
|
||||||
|
onChange={e => setUsername(e.target.value)}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<small>
|
<small>
|
||||||
<FormattedMessage defaultMessage="You can change this later" />
|
<FormattedMessage defaultMessage="You can change this later" />
|
||||||
@ -258,14 +280,24 @@ export function LoginSignup({ close }: { close: () => void }) {
|
|||||||
<p>
|
<p>
|
||||||
<FormattedMessage defaultMessage="We hooked you up with a lightning wallet so you can get paid by viewers right away!" />
|
<FormattedMessage defaultMessage="We hooked you up with a lightning wallet so you can get paid by viewers right away!" />
|
||||||
</p>
|
</p>
|
||||||
{providerInfo?.balance && <p>
|
{providerInfo?.balance && (
|
||||||
<FormattedMessage defaultMessage="Oh, and you have {n} sats of free streaming on us! 💜" values={{
|
<p>
|
||||||
n: <FormattedNumber value={providerInfo.balance} />
|
<FormattedMessage
|
||||||
}} />
|
defaultMessage="Oh, and you have {n} sats of free streaming on us! 💜"
|
||||||
</p>}
|
values={{
|
||||||
|
n: <FormattedNumber value={providerInfo.balance} />,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
<div className="username">
|
<div className="username">
|
||||||
<div className="paper">
|
<div className="paper">
|
||||||
<input type="text" placeholder={formatMessage({ defaultMessage: "eg. name@wallet.com" })} value={lnAddress} onChange={e => setLnAddress(e.target.value)} />
|
<input
|
||||||
|
type="text"
|
||||||
|
placeholder={formatMessage({ defaultMessage: "eg. name@wallet.com" })}
|
||||||
|
value={lnAddress}
|
||||||
|
onChange={e => setLnAddress(e.target.value)}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<small>
|
<small>
|
||||||
<FormattedMessage defaultMessage="You can always replace it with your own address later." />
|
<FormattedMessage defaultMessage="You can always replace it with your own address later." />
|
||||||
@ -277,7 +309,7 @@ export function LoginSignup({ close }: { close: () => void }) {
|
|||||||
</AsyncButton>
|
</AsyncButton>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
case Stage.SaveKey: {
|
case Stage.SaveKey: {
|
||||||
return (
|
return (
|
||||||
|
@ -89,9 +89,18 @@
|
|||||||
"BGxpTN": {
|
"BGxpTN": {
|
||||||
"defaultMessage": "Stream Chat"
|
"defaultMessage": "Stream Chat"
|
||||||
},
|
},
|
||||||
|
"Bep/gA": {
|
||||||
|
"defaultMessage": "Private key"
|
||||||
|
},
|
||||||
"C81/uG": {
|
"C81/uG": {
|
||||||
"defaultMessage": "Logout"
|
"defaultMessage": "Logout"
|
||||||
},
|
},
|
||||||
|
"D3idYv": {
|
||||||
|
"defaultMessage": "Settings"
|
||||||
|
},
|
||||||
|
"DZKuuP": {
|
||||||
|
"defaultMessage": "Logged in as"
|
||||||
|
},
|
||||||
"Dn82AL": {
|
"Dn82AL": {
|
||||||
"defaultMessage": "Live"
|
"defaultMessage": "Live"
|
||||||
},
|
},
|
||||||
@ -155,6 +164,9 @@
|
|||||||
"O2Cy6m": {
|
"O2Cy6m": {
|
||||||
"defaultMessage": "Yes, I am over 18"
|
"defaultMessage": "Yes, I am over 18"
|
||||||
},
|
},
|
||||||
|
"OEW7yJ": {
|
||||||
|
"defaultMessage": "Zaps"
|
||||||
|
},
|
||||||
"OKhRC6": {
|
"OKhRC6": {
|
||||||
"defaultMessage": "Share"
|
"defaultMessage": "Share"
|
||||||
},
|
},
|
||||||
@ -194,6 +206,9 @@
|
|||||||
"TaTRKo": {
|
"TaTRKo": {
|
||||||
"defaultMessage": "Start Stream"
|
"defaultMessage": "Start Stream"
|
||||||
},
|
},
|
||||||
|
"TwyMau": {
|
||||||
|
"defaultMessage": "Account"
|
||||||
|
},
|
||||||
"UJBFYK": {
|
"UJBFYK": {
|
||||||
"defaultMessage": "Add Card"
|
"defaultMessage": "Add Card"
|
||||||
},
|
},
|
||||||
|
@ -10,7 +10,7 @@ import Copy from "element/copy";
|
|||||||
|
|
||||||
const enum Tab {
|
const enum Tab {
|
||||||
Account,
|
Account,
|
||||||
Notifications
|
Notifications,
|
||||||
}
|
}
|
||||||
|
|
||||||
export function SettingsPage() {
|
export function SettingsPage() {
|
||||||
@ -53,7 +53,7 @@ export function SettingsPage() {
|
|||||||
</h1>
|
</h1>
|
||||||
<AlbyZapsButton />
|
<AlbyZapsButton />
|
||||||
</>
|
</>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -69,12 +69,9 @@ export function SettingsPage() {
|
|||||||
<FormattedMessage defaultMessage="Account" />
|
<FormattedMessage defaultMessage="Account" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="tab-content">
|
<div className="tab-content">{tabContent()}</div>
|
||||||
{tabContent()}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,10 @@
|
|||||||
"Atr2p4": "NSFW Content",
|
"Atr2p4": "NSFW Content",
|
||||||
"AyGauy": "Login",
|
"AyGauy": "Login",
|
||||||
"BGxpTN": "Stream Chat",
|
"BGxpTN": "Stream Chat",
|
||||||
|
"Bep/gA": "Private key",
|
||||||
"C81/uG": "Logout",
|
"C81/uG": "Logout",
|
||||||
|
"D3idYv": "Settings",
|
||||||
|
"DZKuuP": "Logged in as",
|
||||||
"Dn82AL": "Live",
|
"Dn82AL": "Live",
|
||||||
"ESyhzp": "Your comment for {name}",
|
"ESyhzp": "Your comment for {name}",
|
||||||
"FjDlus": "You can always replace it with your own address later.",
|
"FjDlus": "You can always replace it with your own address later.",
|
||||||
@ -51,6 +54,7 @@
|
|||||||
"LknBsU": "Stream Key",
|
"LknBsU": "Stream Key",
|
||||||
"My6HwN": "Ok, it's safe",
|
"My6HwN": "Ok, it's safe",
|
||||||
"O2Cy6m": "Yes, I am over 18",
|
"O2Cy6m": "Yes, I am over 18",
|
||||||
|
"OEW7yJ": "Zaps",
|
||||||
"OKhRC6": "Share",
|
"OKhRC6": "Share",
|
||||||
"OWgHbg": "Edit card",
|
"OWgHbg": "Edit card",
|
||||||
"Oxqtyf": "We hooked you up with a lightning wallet so you can get paid by viewers right away!",
|
"Oxqtyf": "We hooked you up with a lightning wallet so you can get paid by viewers right away!",
|
||||||
@ -64,6 +68,7 @@
|
|||||||
"RrCui3": "Summary",
|
"RrCui3": "Summary",
|
||||||
"TP/cMX": "Ended",
|
"TP/cMX": "Ended",
|
||||||
"TaTRKo": "Start Stream",
|
"TaTRKo": "Start Stream",
|
||||||
|
"TwyMau": "Account",
|
||||||
"UJBFYK": "Add Card",
|
"UJBFYK": "Add Card",
|
||||||
"UfSot5": "Past Streams",
|
"UfSot5": "Past Streams",
|
||||||
"VA/Z1S": "Hide",
|
"VA/Z1S": "Hide",
|
||||||
@ -121,4 +126,4 @@
|
|||||||
"x82IOl": "Mute",
|
"x82IOl": "Mute",
|
||||||
"yzKwBQ": "eg. nsec1xyz",
|
"yzKwBQ": "eg. nsec1xyz",
|
||||||
"zVDHAu": "Zap Alert"
|
"zVDHAu": "Zap Alert"
|
||||||
}
|
}
|
||||||
|
@ -366,4 +366,3 @@
|
|||||||
"defaultMessage": "هشدار زپ"
|
"defaultMessage": "هشدار زپ"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -366,4 +366,3 @@
|
|||||||
"defaultMessage": "Tahadhari ya Zap"
|
"defaultMessage": "Tahadhari ya Zap"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user