feat: login key / create account

closes #4
This commit is contained in:
2025-05-12 10:46:46 +01:00
parent a304182e55
commit 658bddbef0
17 changed files with 445 additions and 72 deletions

View File

@ -207,6 +207,7 @@ class _WriteMessageWidget extends State<WriteMessageWidget> {
@override
Widget build(BuildContext context) {
final canSign = ndk.accounts.canSign;
final isLogin = ndk.accounts.isLoggedIn;
return Container(
@ -214,7 +215,7 @@ class _WriteMessageWidget extends State<WriteMessageWidget> {
padding: EdgeInsets.symmetric(horizontal: 8),
decoration: BoxDecoration(color: LAYER_2, borderRadius: DEFAULT_BR),
child:
isLogin
canSign
? Row(
children: [
Expanded(
@ -240,7 +241,15 @@ class _WriteMessageWidget extends State<WriteMessageWidget> {
)
: Container(
padding: EdgeInsets.symmetric(vertical: 12),
child: Row(children: [Text("Please login to send messages")]),
child: Row(
children: [
Text(
isLogin
? "Can't write messages with npub login"
: "Please login to send messages",
),
],
),
),
);
}

View File

@ -23,8 +23,8 @@ class StreamGrid extends StatelessWidget {
Widget build(BuildContext context) {
final streams = events
.map((e) => StreamEvent(e))
.where((e) => e.info.stream?.isNotEmpty ?? false)
.sortedBy((a) => a.info.starts ?? a.event.createdAt);
.sortedBy((a) => a.info.starts ?? a.event.createdAt)
.reversed;
final live = streams.where((s) => s.info.status == StreamStatus.live);
final ended = streams.where((s) => s.info.status == StreamStatus.ended);
final planned = streams.where((s) => s.info.status == StreamStatus.planned);