Skip to content

Commit

Permalink
feat: emojito fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
verbiricha committed Dec 30, 2023
1 parent 6a7b36d commit 1e6b048
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 49 deletions.
34 changes: 10 additions & 24 deletions apps/emojis/app/browse/page.tsx
Original file line number Diff line number Diff line change
@@ -1,36 +1,22 @@
"use client"
"use client";

import { SimpleGrid } from "@chakra-ui/react";
import { NDKKind, NDKSubscriptionCacheUsage } from "@nostr-dev-kit/ndk";
import { useEvents } from "@ngine/core";
import { NDKKind } from "@nostr-dev-kit/ndk";
import { Feed } from "@ngine/core";

import Layout from "@ui/layout";
import EmojiSet from "@ui/emoji-set";

export default function Browse() {
const { events: emojiSets } = useEvents(
{
kinds: [NDKKind.EmojiSet],
},
{
closeOnEose: true,
cacheUsage: NDKSubscriptionCacheUsage.PARALLEL,
},
["wss://relay.nostr.band"]
);
return (
<Layout>
<SimpleGrid
columns={{
base: 1,
md: 2,
<Feed
closeOnEose
pageSize={20}
filter={{
kinds: [NDKKind.EmojiSet],
}}
spacing={6}
>
{emojiSets.map((e) => (
<EmojiSet key={e.id} event={e} />
))}
</SimpleGrid>
components={{ [NDKKind.EmojiSet]: EmojiSet }}
/>
</Layout>
);
}
2 changes: 1 addition & 1 deletion apps/emojis/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export const metadata = {
metadataBase: new URL("https://emojito.meme"),
title: "emojito",
description: "Stirr up your reactions with custom emoji",
description: "Stir up your reactions with custom emoji",
};

export default function RootLayout({
Expand Down
9 changes: 7 additions & 2 deletions apps/emojis/ui/emoji-set.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ export default function EmojiSet({ event }: EventProps) {
size="xs"
variant="outline"
colorScheme="brand"
isDisabled={!canSign}
rightIcon={<Icon as={ChevronDownIcon} />}
>
Options
Expand All @@ -125,18 +124,24 @@ export default function EmojiSet({ event }: EventProps) {
</MenuItem>
{isBookmarked ? (
<MenuItem
isDisabled={!canSign}
icon={<Icon as={DeleteIcon} />}
onClick={removeBookmark}
>
Unbookmark
</MenuItem>
) : (
<MenuItem icon={<Icon as={StarIcon} />} onClick={addBookmark}>
<MenuItem
isDisabled={!canSign}
icon={<Icon as={StarIcon} />}
onClick={addBookmark}
>
Bookmark
</MenuItem>
)}
{isMine && (
<MenuItem
isDisabled={!canSign}
icon={<Icon as={EditIcon} />}
onClick={() => router.push(`/a/${event.encode()}/edit`)}
>
Expand Down
12 changes: 7 additions & 5 deletions apps/emojis/ui/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@ export default function Header() {
px={4}
>
<Flex flexDirection="column">
<Link href="/" sx={{ _hover: { textDecoration: "none" } }}>
<HStack gap={0}>
<Image alt="emojito logo" src="/logo.png" boxSize={20} style={{ transform: "scale(1.2)" }} />
<Heading fontSize="3xl">emojito</Heading>
</HStack>
<Link href="/">
<Image
alt="emojito logo"
src="/logo.png"
boxSize={20}
style={{ transform: "scale(1.5)" }}
/>
</Link>
</Flex>
<HStack>
Expand Down
2 changes: 1 addition & 1 deletion apps/emojis/ui/home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ function Hero() {
gap={6}
>
<Heading fontSize={{ base: "5xl", sm: "6xl" }}>
Stirr up your reactions with{" "}
Stir up your reactions with{" "}
<Box as="mark" color="chakra-body-text" background={bg}>
custom emoji
</Box>
Expand Down
34 changes: 18 additions & 16 deletions packages/core/src/components/RecommendedAppMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -223,22 +223,24 @@ export default function RecommendedAppMenu({
defaultMessage="Nostr link"
/>
</MenuItem>
<MenuGroup
title={formatMessage({
id: "ngine.open-nostr-app-title",
description: "Title of nostr app menu",
defaultMessage: "Apps",
})}
>
{recommended?.map(({ ev, recommenders }) => (
<AppMenuItem
key={ev.tagId()}
unknownEvent={event}
event={ev}
recommenders={recommenders}
/>
))}
</MenuGroup>
{recommended?.length > 0 && (
<MenuGroup
title={formatMessage({
id: "ngine.open-nostr-app-title",
description: "Title of nostr app menu",
defaultMessage: "Apps",
})}
>
{recommended?.map(({ ev, recommenders }) => (
<AppMenuItem
key={ev.tagId()}
unknownEvent={event}
event={ev}
recommenders={recommenders}
/>
))}
</MenuGroup>
)}
</MenuList>
</Menu>
);
Expand Down

0 comments on commit 1e6b048

Please sign in to comment.