mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-10-05 00:51:14 +02:00
more small fixes
This commit is contained in:
@@ -123,6 +123,7 @@ export default function DrawerSubViewProvider({
|
|||||||
log("Updating parent state from Router");
|
log("Updating parent state from Router");
|
||||||
direction.current = "up";
|
direction.current = "up";
|
||||||
parentRouter.navigate(".", {
|
parentRouter.navigate(".", {
|
||||||
|
preventScrollReset: true,
|
||||||
state: { ...parentRouter.state.location.state, subRouterPath: e.location.pathname },
|
state: { ...parentRouter.state.location.state, subRouterPath: e.location.pathname },
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -144,7 +145,10 @@ export default function DrawerSubViewProvider({
|
|||||||
const openDrawer = useCallback(
|
const openDrawer = useCallback(
|
||||||
(to: To) => {
|
(to: To) => {
|
||||||
marker.current = 0;
|
marker.current = 0;
|
||||||
parentRouter.navigate(".", { state: { ...parentRouter.state.location.state, subRouterPath: to } });
|
parentRouter.navigate(".", {
|
||||||
|
preventScrollReset: true,
|
||||||
|
state: { ...parentRouter.state.location.state, subRouterPath: to },
|
||||||
|
});
|
||||||
},
|
},
|
||||||
[parentRouter],
|
[parentRouter],
|
||||||
);
|
);
|
||||||
@@ -156,7 +160,10 @@ export default function DrawerSubViewProvider({
|
|||||||
parentRouter.navigate(-i);
|
parentRouter.navigate(-i);
|
||||||
} else {
|
} else {
|
||||||
log(`Failed to navigate back, clearing state`);
|
log(`Failed to navigate back, clearing state`);
|
||||||
parentRouter.navigate(".", { state: { ...parentRouter.state.location.state, subRouterPath: undefined } });
|
parentRouter.navigate(".", {
|
||||||
|
preventScrollReset: true,
|
||||||
|
state: { ...parentRouter.state.location.state, subRouterPath: undefined },
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// reset marker
|
// reset marker
|
||||||
|
@@ -6,6 +6,7 @@ import {
|
|||||||
CardFooter,
|
CardFooter,
|
||||||
CardHeader,
|
CardHeader,
|
||||||
CardProps,
|
CardProps,
|
||||||
|
Flex,
|
||||||
Heading,
|
Heading,
|
||||||
LinkBox,
|
LinkBox,
|
||||||
Text,
|
Text,
|
||||||
@@ -70,9 +71,7 @@ function PostSubject({ event }: { event: NostrEvent }) {
|
|||||||
function Approvals({ approvals }: { approvals: NostrEvent[] }) {
|
function Approvals({ approvals }: { approvals: NostrEvent[] }) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Text fontSize="sm" ml="auto">
|
<Text fontSize="sm">Approved by</Text>
|
||||||
Approved by
|
|
||||||
</Text>
|
|
||||||
<AvatarGroup>
|
<AvatarGroup>
|
||||||
{approvals.map((approval) => (
|
{approvals.map((approval) => (
|
||||||
<ApprovalIcon key={approval.id} approval={approval} />
|
<ApprovalIcon key={approval.id} approval={approval} />
|
||||||
@@ -97,19 +96,21 @@ export function CommunityTextPost({
|
|||||||
<CardBody p="2">
|
<CardBody p="2">
|
||||||
<InlineNoteContent event={event} maxLength={96} />
|
<InlineNoteContent event={event} maxLength={96} />
|
||||||
</CardBody>
|
</CardBody>
|
||||||
<CardFooter display="flex" gap="2" alignItems="center" p="2">
|
<CardFooter display="flex" gap="2" alignItems="center" p="2" flexWrap="wrap">
|
||||||
<Text>
|
<Text>
|
||||||
Posted {dayjs.unix(event.created_at).fromNow()} by <UserLink pubkey={event.pubkey} fontWeight="bold" />
|
Posted {dayjs.unix(event.created_at).fromNow()} by <UserLink pubkey={event.pubkey} fontWeight="bold" />
|
||||||
</Text>
|
</Text>
|
||||||
{approvals.length > 0 && <Approvals approvals={approvals} />}
|
<Flex gap="2" alignItems="center" ml="auto">
|
||||||
<CommunityPostMenu
|
{approvals.length > 0 && <Approvals approvals={approvals} />}
|
||||||
event={event}
|
<CommunityPostMenu
|
||||||
community={community}
|
event={event}
|
||||||
approvals={approvals}
|
community={community}
|
||||||
aria-label="More Options"
|
approvals={approvals}
|
||||||
size="xs"
|
aria-label="More Options"
|
||||||
variant="ghost"
|
size="xs"
|
||||||
/>
|
variant="ghost"
|
||||||
|
/>
|
||||||
|
</Flex>
|
||||||
</CardFooter>
|
</CardFooter>
|
||||||
</Card>
|
</Card>
|
||||||
);
|
);
|
||||||
@@ -145,19 +146,21 @@ export function CommunityRepostPost({
|
|||||||
</CardBody>
|
</CardBody>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
<CardFooter display="flex" gap="2" alignItems="center" p="2">
|
<CardFooter display="flex" gap="2" alignItems="center" p="2" flexWrap="wrap">
|
||||||
<Text>
|
<Text>
|
||||||
Shared {dayjs.unix(event.created_at).fromNow()} by <UserLink pubkey={event.pubkey} fontWeight="bold" />
|
Shared {dayjs.unix(event.created_at).fromNow()} by <UserLink pubkey={event.pubkey} fontWeight="bold" />
|
||||||
</Text>
|
</Text>
|
||||||
{approvals.length > 0 && <Approvals approvals={approvals} />}
|
<Flex gap="2" alignItems="center" ml="auto">
|
||||||
<CommunityPostMenu
|
{approvals.length > 0 && <Approvals approvals={approvals} />}
|
||||||
event={event}
|
<CommunityPostMenu
|
||||||
community={community}
|
event={event}
|
||||||
approvals={approvals}
|
community={community}
|
||||||
aria-label="More Options"
|
approvals={approvals}
|
||||||
size="xs"
|
aria-label="More Options"
|
||||||
variant="ghost"
|
size="xs"
|
||||||
/>
|
variant="ghost"
|
||||||
|
/>
|
||||||
|
</Flex>
|
||||||
</CardFooter>
|
</CardFooter>
|
||||||
</Card>
|
</Card>
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user