mirror of
https://github.com/luminous-devs/lume.git
synced 2024-09-18 11:13:30 +00:00
small fixes and support $ boost sign
This commit is contained in:
parent
7cef6efa6f
commit
c80414a72d
@ -16,7 +16,7 @@ tauri-build = { version = "1.4", features = [] }
|
||||
[dependencies]
|
||||
serde_json = "1.0"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
tauri = { version = "1.4", features = [
|
||||
tauri = { version = "1.4", features = [ "macos-private-api",
|
||||
"window-close",
|
||||
"window-print",
|
||||
"window-create",
|
||||
|
@ -80,8 +80,8 @@ export function ImportStep3Screen() {
|
||||
)}
|
||||
</button>
|
||||
<span className="text-center text-sm text-white/50">
|
||||
By clicking 'Continue', Lume will sync your old relay list and
|
||||
metadata.<br/>It may take a bit, please be patient.
|
||||
By clicking 'Continue', Lume will download your old relay list and
|
||||
metadata. It may take a bit
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,34 +1,10 @@
|
||||
import { LogicalSize, getCurrent } from '@tauri-apps/api/window';
|
||||
import { useEffect } from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
import { ArrowRightCircleIcon } from '@shared/icons/arrowRightCircle';
|
||||
|
||||
export function WelcomeScreen() {
|
||||
const appWindow = getCurrent();
|
||||
|
||||
async function setWindow() {
|
||||
await appWindow.setSize(new LogicalSize(400, 500));
|
||||
await appWindow.setResizable(false);
|
||||
await appWindow.center();
|
||||
}
|
||||
|
||||
async function resetWindow() {
|
||||
await appWindow.setSize(new LogicalSize(1080, 800));
|
||||
await appWindow.setResizable(true);
|
||||
await appWindow.center();
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
setWindow();
|
||||
|
||||
return () => {
|
||||
resetWindow();
|
||||
};
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div className="flex h-screen w-full flex-col justify-between">
|
||||
<div className="mx-auto flex h-screen w-full max-w-md flex-col justify-center">
|
||||
<div className="flex flex-col gap-10 pt-16">
|
||||
<div className="flex flex-col gap-1.5 text-center">
|
||||
<h1 className="text-3xl font-semibold text-white">Welcome to Lume</h1>
|
||||
@ -54,8 +30,8 @@ export function WelcomeScreen() {
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex flex-1 items-end justify-center pb-6">
|
||||
<img src="/lume.png" alt="lume" className="h-auto w-1/4" />
|
||||
<div className="absolute bottom-6 left-1/2 -translate-x-1/2 transform">
|
||||
<img src="/lume.png" alt="lume" className="mx-auto h-auto w-1/4" />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
@ -22,5 +22,6 @@ export * from './child';
|
||||
export * from './skeleton';
|
||||
export * from './actions';
|
||||
export * from './mentions/hashtag';
|
||||
export * from './mentions/boost';
|
||||
export * from './stats';
|
||||
export * from './wrapper';
|
||||
|
@ -3,6 +3,7 @@ import { Link } from 'react-router-dom';
|
||||
import remarkGfm from 'remark-gfm';
|
||||
|
||||
import {
|
||||
Boost,
|
||||
Hashtag,
|
||||
ImagePreview,
|
||||
LinkPreview,
|
||||
@ -56,6 +57,9 @@ export function TextNote(props: { content?: string }) {
|
||||
if (key.startsWith('tag')) {
|
||||
return <Hashtag tag={key.replace('tag-', '')} />;
|
||||
}
|
||||
if (key.startsWith('boost')) {
|
||||
return <Boost boost={key.replace('boost-', '')} />;
|
||||
}
|
||||
},
|
||||
}}
|
||||
disallowedElements={['h1', 'h2', 'h3', 'h4', 'h5', 'h6']}
|
||||
|
5
src/shared/notes/mentions/boost.tsx
Normal file
5
src/shared/notes/mentions/boost.tsx
Normal file
@ -0,0 +1,5 @@
|
||||
export function Boost({ boost }: { boost: string }) {
|
||||
return (
|
||||
<span className="break-words text-fuchsia-400 hover:text-fuchsia-500">{boost}</span>
|
||||
);
|
||||
}
|
@ -1,11 +1,12 @@
|
||||
import { memo } from 'react';
|
||||
|
||||
import { useStorage } from '@libs/storage/provider';
|
||||
|
||||
import { WidgetKinds, useWidgets } from '@stores/widgets';
|
||||
|
||||
import { useProfile } from '@utils/hooks/useProfile';
|
||||
import { displayNpub } from '@utils/shortenKey';
|
||||
|
||||
export function MentionUser({ pubkey }: { pubkey: string }) {
|
||||
export const MentionUser = memo(function MentionUser({ pubkey }: { pubkey: string }) {
|
||||
const { db } = useStorage();
|
||||
const { user } = useProfile(pubkey);
|
||||
|
||||
@ -31,11 +32,12 @@ export function MentionUser({ pubkey }: { pubkey: string }) {
|
||||
}
|
||||
className="break-words text-fuchsia-400 hover:text-fuchsia-500"
|
||||
>
|
||||
{user?.name ||
|
||||
{'@' +
|
||||
(user?.name ||
|
||||
user?.display_name ||
|
||||
user?.displayName ||
|
||||
user?.username ||
|
||||
displayNpub(pubkey, 16)}
|
||||
'unknown')}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
});
|
||||
|
@ -57,6 +57,11 @@ export function parser(eventContent: string) {
|
||||
return word.replace(word, `~tag-${word}~`);
|
||||
}
|
||||
|
||||
// boost
|
||||
if (word.startsWith('$') && word.length > 1) {
|
||||
return word.replace(word, `~boost-${word}~`);
|
||||
}
|
||||
|
||||
// nostr account references
|
||||
if (word.startsWith('nostr:npub1') || word.startsWith('npub1')) {
|
||||
const npub = word.replace('nostr:', '').replace(/[^a-zA-Z0-9 ]/g, '');
|
||||
|
Loading…
Reference in New Issue
Block a user