Skip to content

Commit

Permalink
Merge branch 'pdelfan:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
pdelfan authored Sep 12, 2024
2 parents 90e9b4e + 7c24c45 commit 63da2b2
Show file tree
Hide file tree
Showing 23 changed files with 1,188 additions and 1,975 deletions.
2,710 changes: 854 additions & 1,856 deletions package-lock.json

Large diffs are not rendered by default.

61 changes: 30 additions & 31 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@
"lint": "next lint"
},
"dependencies": {
"@atproto/api": "^0.12.24",
"@emoji-mart/data": "^1.1.2",
"@atproto/api": "^0.13.5",
"@emoji-mart/data": "^1.2.1",
"@emoji-mart/react": "^1.1.1",
"@radix-ui/react-dialog": "^1.0.5",
"@radix-ui/react-dropdown-menu": "^2.0.6",
"@radix-ui/react-hover-card": "^1.0.7",
"@radix-ui/react-dialog": "^1.1.1",
"@radix-ui/react-dropdown-menu": "^2.1.1",
"@radix-ui/react-hover-card": "^1.1.1",
"@radix-ui/react-popover": "^1.1.1",
"@radix-ui/react-radio-group": "^1.1.3",
"@radix-ui/react-scroll-area": "^1.0.5",
"@radix-ui/react-switch": "^1.0.3",
"@radix-ui/react-toggle-group": "^1.0.4",
"@radix-ui/react-radio-group": "^1.2.0",
"@radix-ui/react-scroll-area": "^1.1.0",
"@radix-ui/react-switch": "^1.1.0",
"@radix-ui/react-toggle-group": "^1.1.0",
"@radix-ui/react-tooltip": "^1.1.2",
"@tanstack/react-query": "^5.29.2",
"@tanstack/react-query": "^5.55.4",
"@tiptap/extension-character-count": "2.1.16",
"@tiptap/extension-link": "2.1.16",
"@tiptap/extension-mention": "2.1.16",
Expand All @@ -31,40 +31,39 @@
"@tiptap/starter-kit": "2.1.16",
"@tiptap/suggestion": "2.1.16",
"@uidotdev/usehooks": "^2.4.1",
"@vercel/analytics": "^1.1.2",
"@vercel/speed-insights": "^1.0.7",
"0g": "^0.0.9",
"@vercel/analytics": "^1.3.1",
"@vercel/speed-insights": "^1.0.12",
"@vidstack/react": "^1.12.9",
"browser-image-compression": "^2.0.2",
"emoji-mart": "^5.5.2",
"emoji-mart": "^5.6.0",
"jwt-decode": "^4.0.0",
"next": "14.1.3",
"next": "14.2.9",
"next-auth": "^4.24.5",
"next-themes": "^0.2.1",
"npm": "^10.6.0",
"react": "^18",
"next-themes": "^0.3.0",
"npm": "^10.8.3",
"react": "^18.3.1",
"react-circular-progressbar": "^2.1.0",
"react-dom": "^18",
"react-dom": "^18.3.1",
"react-dropzone": "^14.2.3",
"react-hot-toast": "^2.4.1",
"react-icons": "^5.1.0",
"react-icons": "^5.3.0",
"react-infinite-scroll-component": "^6.1.0",
"sharp": "^0.33.3",
"sharp": "^0.33.5",
"tailwindcss-animate": "^1.0.7",
"tinyld": "^1.3.4",
"use-clipboard-copy": "^0.2.0",
"use-debounce": "^10.0.0"
"use-debounce": "^10.0.3"
},
"devDependencies": {
"@tailwindcss/typography": "^0.5.12",
"@types/node": "^20.12.7",
"@types/react": "^18.2.78",
"@types/react-dom": "^18.2.25",
"autoprefixer": "^10.4.19",
"@types/node": "^22.5.4",
"@types/react": "^18.3.5",
"@types/react-dom": "^18.3.0",
"autoprefixer": "^10.4.20",
"eslint": "^8",
"eslint-config-next": "14.1.3",
"postcss": "^8.4.38",
"tailwindcss": "3.4.1",
"tailwindcss-animated": "^1.0.1",
"typescript": "^5.4.5"
"postcss": "^8.4.45",
"tailwindcss": "3.4.11",
"tailwindcss-animated": "^1.1.2",
"typescript": "^5.6.2"
}
}
10 changes: 8 additions & 2 deletions src/app/(site)/about/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,14 @@ export default function Page() {
>
Discussions
</Link>
. If you are not on GitHub, you can also mention me on Bluesky (my
handle is @contrapunctus.bsky.social).
. If you are not on GitHub, you can also{" "}
<Link
href="https://bsky.app/profile/did:plc:3sapfnszmvjc6wa4ml3ybkwb"
className="underline underline-offset-2"
>
mention me on Bluesky
</Link>
.
</p>

<h3 className="text-skin-base mb-1 mt-6 text-lg font-semibold">
Expand Down
15 changes: 15 additions & 0 deletions src/app/dashboard/user/[handle]/(post)/post/[id]/quotes/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import Layout from "@/containers/Layout";
import type { Metadata } from "next";

export const metadata: Metadata = {
title: "Ouranos — Quotes",
description: "Quotes for this post",
};

export default function RepostedByLayout({
children,
}: {
children: React.ReactNode;
}) {
return <Layout>{children}</Layout>;
}
21 changes: 21 additions & 0 deletions src/app/dashboard/user/[handle]/(post)/post/[id]/quotes/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import QuotesContainer from "@/containers/thread/QuotesContainer";

interface Props {
params: {
id: string;
handle: string;
};
}

export default function Page(props: Props) {
const { id, handle } = props.params;

return (
<section>
<h2 className="text-skin-base mb-2 px-3 text-2xl font-semibold md:px-0">
Quotes
</h2>
<QuotesContainer handle={handle} id={id} />
</section>
);
}
2 changes: 1 addition & 1 deletion src/components/actions/composePrompt/ComposePrompt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface Props {

export default function ComposePrompt(props: Props) {
const { avatar, post } = props;
const canReply = !post.viewer?.replyDisabled ?? false;
const canReply = !post.viewer?.replyDisabled || false;
const { openComposer } = useComposerControls();

if (!canReply) return null;
Expand Down
2 changes: 1 addition & 1 deletion src/components/actions/editProfile/EditProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export default function EditProfile(props: Props) {
}}
disabled={updateProfile.isPending}
className={`bg-primary hover:bg-primary-dark text-skin-icon-inverted rounded-full px-4 py-2 text-sm font-semibold ${
updateProfile.isPending && "animate-pulse"
updateProfile.isPending && "animate-pulse animate-duration-1000"
}`}
>
{updateProfile.isPending ? "Saving..." : "Save"}
Expand Down
18 changes: 16 additions & 2 deletions src/components/dataDisplay/postActions/PostActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export default function PostActions(props: Props) {
const { deletePost } = useDeletePost({ post: post });
const { liked, toggleLike, likeCount } = useLike({ post: post });
const { reposted, toggleRepost, repostCount } = useRepost({ post: post });
const quoteCount = post.quoteCount ?? 0;
const { muted, toggleMuteUser } = useMuteUser({ author: post.author });
const clipboard = useClipboard({ copiedTimeout: 3500 });
const { openComposer } = useComposerControls();
Expand Down Expand Up @@ -72,7 +73,7 @@ export default function PostActions(props: Props) {
{repostCount > 0 && (
<Link
href={`/dashboard/user/${post.author.handle}/post/${getPostId(
post.uri,
post.uri
)}/reposted-by`}
className="text-skin-base flex gap-1 font-semibold"
>
Expand All @@ -82,10 +83,23 @@ export default function PostActions(props: Props) {
</span>
</Link>
)}
{quoteCount > 0 && (
<Link
href={`/dashboard/user/${post.author.handle}/post/${getPostId(
post.uri
)}/quotes`}
className="text-skin-base flex gap-1 font-semibold"
>
{abbreviateNumber(quoteCount)}
<span className="text-skin-tertiary font-medium">
Quote{quoteCount > 1 && "s"}
</span>
</Link>
)}
{likeCount > 0 && (
<Link
href={`/dashboard/user/${post.author.handle}/post/${getPostId(
post.uri,
post.uri
)}/liked-by`}
className="text-skin-base flex gap-1 font-semibold"
>
Expand Down
11 changes: 11 additions & 0 deletions src/components/dataDisplay/postEmbed/PostEmbed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ import {
AppBskyEmbedRecordWithMedia,
AppBskyGraphDefs,
AppBskyFeedDefs,
AppBskyEmbedVideo,
} from "@atproto/api";
import RecordEmbed from "./RecordEmbed";
import ListEmbed from "./ListEmbed";
import FeedEmbed from "./FeedEmbed";
import VideoEmbed from "./VideoEmbed";

interface Props {
content: AppBskyFeedDefs.FeedViewPost["post"]["embed"];
Expand Down Expand Up @@ -54,6 +56,15 @@ export default function PostEmbed(props: Props) {
depth={depth}
/>
);
} else if (AppBskyEmbedVideo.isView(content)) {
return (
<VideoEmbed
aspectRatio={`${content.aspectRatio?.width}/${content.aspectRatio?.height}`}
playlist={content.playlist}
thumbnail={content.thumbnail}
alt={content.alt}
/>
);
}
};

Expand Down
46 changes: 46 additions & 0 deletions src/components/dataDisplay/postEmbed/VideoEmbed.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { memo } from "react";
import { MediaPlayer, MediaProvider, Poster } from "@vidstack/react";
import {
defaultLayoutIcons,
DefaultVideoLayout,
} from "@vidstack/react/player/layouts/default";
import "@vidstack/react/player/styles/default/theme.css";
import "@vidstack/react/player/styles/default/layouts/video.css";

interface Props {
aspectRatio: string;
playlist: string;
thumbnail?: string;
alt?: string;
}

const VideoEmbed = memo(function VideoEmbed(props: Props) {
const { aspectRatio, playlist, thumbnail, alt } = props;

return (
<div className="aspect-video mt-2 rounded-md hover:brightness-90 hover:cursor-pointer overflow-hidden">
<MediaPlayer
crossOrigin
playsInline
viewType="video"
className="w-full h-full object-cover"
src={playlist}
poster={thumbnail ?? ""}
onClick={(e) => e.stopPropagation()}
>
<MediaProvider>
{alt && (
<Poster
src={thumbnail}
alt={alt}
className="absolute inset-0 block bg-skin-overlay opacity-0 transition-opacity data-[visible]:opacity-100 [&>img]:w-full [&>img]:object-contain"
/>
)}
</MediaProvider>
<DefaultVideoLayout thumbnails={thumbnail} icons={defaultLayoutIcons} />
</MediaPlayer>
</div>
);
});

export default VideoEmbed;
5 changes: 2 additions & 3 deletions src/components/feedback/WhoCanReply/WhoCanReply.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ interface Props {

export default function WhoCanReply(props: Props) {
const { post } = props;
const canReply = !post.viewer?.replyDisabled ?? false;
const rounded = !canReply && post.replyCount === 0;
const canReply = !post.viewer?.replyDisabled || false;
const record =
post.threadgate &&
AppBskyFeedThreadgate.isRecord(post.threadgate.record) &&
Expand Down Expand Up @@ -102,7 +101,7 @@ export default function WhoCanReply(props: Props) {

return (
<section
className={`border-t-skin-base md:border-x-skin-base w-full border-x-0 border-t p-2 md:border-x ${rounded && "border-y-skin-base border-y md:rounded-b-2xl"}`}
className="border-t-skin-base md:border-x-skin-base w-full border-x-0 border-t p-2 md:border-x"
>
<div className="bg-primary/20 flex items-center gap-3 rounded-xl p-2">
<div className="bg-primary rounded-2xl p-1.5">
Expand Down
2 changes: 1 addition & 1 deletion src/components/forms/loginForm/LoginForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export default function LoginForm() {
<Button
type="submit"
className={`text-skin-inverted bg-skin-inverted hover:bg-skin-inverted ml-auto mt-5 flex w-full items-center justify-center gap-2 rounded-lg px-3 py-3 font-semibold disabled:cursor-not-allowed ${
loading && "animate-pulse"
loading && "animate-pulse animate-duration-1000"
}`}
disabled={loading}
aria-disabled={loading}
Expand Down
2 changes: 1 addition & 1 deletion src/components/inputs/editor/TopEditorBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export default function TopEditorBar(props: Props) {
});
}}
className={`bg-primary hover:bg-primary-dark rounded-full px-4 py-2 text-sm font-semibold text-white ${
onPublish.isPending && "animate-pulse"
onPublish.isPending && "animate-pulse animate-duration-1000"
}`}
disabled={onPublish.isPending}
>
Expand Down
Loading

0 comments on commit 63da2b2

Please sign in to comment.