-
@{post.owner.displayName} |
-
-
0 yorum |
+
+
+
+ {post.site ?? ""}
+
+
+
+
+
@{post.owner.displayName}
·
+
+
+
+
+
+ {`${post.commentCount} yorum`}
+
+
+
+
+
{
postConnectionId={props.postConnectionId}
/>
-
-
+
+
);
};
diff --git a/apps/kampus/app/pano/features/post-list/PostUpvoteButton.tsx b/apps/kampus/app/pano/features/post-list/PostUpvoteButton.tsx
index 0e8c379c..464e1213 100644
--- a/apps/kampus/app/pano/features/post-list/PostUpvoteButton.tsx
+++ b/apps/kampus/app/pano/features/post-list/PostUpvoteButton.tsx
@@ -1,4 +1,4 @@
-import { Triangle } from "lucide-react";
+import { ArrowBigUp, Triangle, TriangleIcon } from "lucide-react";
import { graphql, useFragment, useMutation } from "react-relay";
import { Button } from "@kampus/ui";
@@ -53,8 +53,7 @@ export const UpvoteButton = (props: UpvoteProps) => {
const disabled = isCreating || isRemoving;
- const upvoteStyle = post?.isUpvotedByViewer ? "fill-primary" : "fill-none";
- const combinedStyle = cn(upvoteStyle);
+ const upvoteStyle = cn();
const onClick = () => {
if (!post) {
@@ -73,14 +72,15 @@ export const UpvoteButton = (props: UpvoteProps) => {
};
return (
-
+ <>
+
+
{post?.upvoteCount ?? 0}
+ >
);
};
diff --git a/apps/kampus/app/pano/features/post-list/__generated__/PostItem_post.graphql.ts b/apps/kampus/app/pano/features/post-list/__generated__/PostItem_post.graphql.ts
index d7bae815..71cfa397 100644
--- a/apps/kampus/app/pano/features/post-list/__generated__/PostItem_post.graphql.ts
+++ b/apps/kampus/app/pano/features/post-list/__generated__/PostItem_post.graphql.ts
@@ -1,5 +1,5 @@
/**
- * @generated SignedSource<
>
+ * @generated SignedSource<<5f75e5667edef9e6857b85ad1a46e63d>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -11,6 +11,7 @@
import { Fragment, ReaderFragment } from 'relay-runtime';
import { FragmentRefs } from "relay-runtime";
export type PostItem_post$data = {
+ readonly commentCount: number;
readonly content: string | null;
readonly createdAt: any;
readonly id: string;
@@ -76,6 +77,18 @@ const node: ReaderFragment = {
"name": "site",
"storageKey": null
},
+ {
+ "kind": "RequiredField",
+ "field": {
+ "alias": null,
+ "args": null,
+ "kind": "ScalarField",
+ "name": "commentCount",
+ "storageKey": null
+ },
+ "action": "LOG",
+ "path": "commentCount"
+ },
{
"args": null,
"kind": "FragmentSpread",
@@ -119,6 +132,6 @@ const node: ReaderFragment = {
"abstractKey": null
};
-(node as any).hash = "40952525253258c86b4d4320cf4279a0";
+(node as any).hash = "03c1325a353b031abe75c421b022ef9f";
export default node;
diff --git a/apps/kampus/app/pano/layout.tsx b/apps/kampus/app/pano/layout.tsx
index 60428b8c..4e3a7146 100644
--- a/apps/kampus/app/pano/layout.tsx
+++ b/apps/kampus/app/pano/layout.tsx
@@ -1,4 +1,10 @@
-export default function PanoLayout({ children }: { children: React.ReactNode }) {
+export default function PanoLayout({
+ children,
+ modal,
+}: {
+ children: React.ReactNode;
+ modal: React.ReactNode;
+}) {
return (
);
}
diff --git a/apps/kampus/app/pano/post/create/page.tsx b/apps/kampus/app/pano/post/create/page.tsx
index 035507a1..debd7258 100644
--- a/apps/kampus/app/pano/post/create/page.tsx
+++ b/apps/kampus/app/pano/post/create/page.tsx
@@ -1,3 +1,10 @@
+"use client";
+
+import { useRouter } from "next/navigation";
+
+import { CreatePanoPostForm } from "../../CreatePanoPostForm";
+
export default function CreatePost() {
- return CreatePost
+ const router = useRouter();
+ return router.push("/")} />;
}
diff --git a/apps/kampus/app/pano/post/default.tsx b/apps/kampus/app/pano/post/default.tsx
new file mode 100644
index 00000000..6ddf1b76
--- /dev/null
+++ b/apps/kampus/app/pano/post/default.tsx
@@ -0,0 +1,3 @@
+export default function Default() {
+ return null;
+}
diff --git a/package-lock.json b/package-lock.json
index 3fd1a928..a9565335 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -76,7 +76,7 @@
"dependencies": {
"@kampus/next-auth": "*",
"@kampus/relay": "*",
- "@kampus/ui": "^0.0.0",
+ "@kampus/ui": "*",
"react-relay": "15.0.0",
"relay-compiler": "15.0.0",
"znv": "0.3.2",
@@ -6242,6 +6242,24 @@
}
}
},
+ "node_modules/@radix-ui/react-id": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-id/-/react-id-1.0.1.tgz",
+ "integrity": "sha512-tI7sT/kqYp8p96yGWY1OAnLHrqDgzHefRBKQ2YAkBS5ja7QLcZ9Z/uY7bEjPUatf8RomoXM8/1sMj1IJaE5UzQ==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/react-use-layout-effect": "1.0.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
"node_modules/@radix-ui/react-presence": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@radix-ui/react-presence/-/react-presence-1.0.1.tgz",
@@ -6550,23 +6568,6 @@
}
}
},
- "node_modules/@radix-ui/react-select/node_modules/@radix-ui/react-id": {
- "version": "1.0.1",
- "license": "MIT",
- "dependencies": {
- "@babel/runtime": "^7.13.10",
- "@radix-ui/react-use-layout-effect": "1.0.1"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
"node_modules/@radix-ui/react-select/node_modules/@radix-ui/react-popper": {
"version": "1.1.2",
"license": "MIT",
@@ -25599,23 +25600,6 @@
}
}
},
- "packages/ui/node_modules/@radix-ui/react-id": {
- "version": "1.0.1",
- "license": "MIT",
- "dependencies": {
- "@babel/runtime": "^7.13.10",
- "@radix-ui/react-use-layout-effect": "1.0.1"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
"packages/ui/node_modules/@radix-ui/react-label": {
"version": "2.0.2",
"license": "MIT",
diff --git a/packages/ui/components/button.tsx b/packages/ui/components/button.tsx
index 2ada7f0d..f4aef727 100644
--- a/packages/ui/components/button.tsx
+++ b/packages/ui/components/button.tsx
@@ -2,16 +2,16 @@ import * as React from "react";
import { Slot } from "@radix-ui/react-slot";
import { cva, type VariantProps } from "class-variance-authority";
-import { cn } from "@kampus/ui/utils";
+import { cn } from "../utils";
const buttonVariants = cva(
- "focus-visible:ring-ring ring-offset-background inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
+ "ring-offset-background focus-visible:ring-ring inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
{
variants: {
variant: {
default: "bg-primary text-primary-foreground hover:bg-primary/90",
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
- outline: "border-input hover:bg-accent hover:text-accent-foreground border",
+ outline: "border-input bg-background hover:bg-accent hover:text-accent-foreground border",
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
ghost: "hover:bg-accent hover:text-accent-foreground",
link: "text-primary underline-offset-4 hover:underline",
@@ -20,6 +20,7 @@ const buttonVariants = cva(
default: "h-10 px-4 py-2",
sm: "h-9 rounded-md px-3",
lg: "h-11 rounded-md px-8",
+ icon: "h-10 w-10",
},
},
defaultVariants: {
diff --git a/packages/ui/components/dialog.tsx b/packages/ui/components/dialog.tsx
index c283d0a4..491d2215 100644
--- a/packages/ui/components/dialog.tsx
+++ b/packages/ui/components/dialog.tsx
@@ -10,6 +10,8 @@ const Dialog = DialogPrimitive.Root;
const DialogTrigger = DialogPrimitive.Trigger;
+const DialogClose = DialogPrimitive.Close;
+
const DialogPortal = ({ className, children, ...props }: DialogPrimitive.DialogPortalProps) => (
@@ -99,6 +101,7 @@ export {
Dialog,
DialogTrigger,
DialogContent,
+ DialogClose,
DialogHeader,
DialogFooter,
DialogTitle,