Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remaining features #14

Merged
merged 4 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions app/postPage2/[postTitle]/page.tsx → app/[postTitle]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ const PostPage = ({ params: { postTitle } }: Props) => {
const [imageUpload, setImageUpload] = useState<File | null>(null);
const [imageUrl, setImageUrl] = useState<string | null>(null);
const [progress , setProgress] = useState<number | null>(0);
const [ansLoading, setAnsLoading] = useState(false);

//need the actual postId of the question to send to the PostVoteClient
const [postId , setPostId] = useState<string>("");
Expand Down Expand Up @@ -227,6 +228,7 @@ const PostPage = ({ params: { postTitle } }: Props) => {
console.log(data);

createAnswerPost(data);
setIsCommentBoxOpen(true);
// form.reset(); //won't reset from here
}

Expand Down Expand Up @@ -266,13 +268,15 @@ const PostPage = ({ params: { postTitle } }: Props) => {
const [description, setDescription] = useState("");

return (

<div className="grid md:grid-cols-2 lg:grid-cols-7 gap-y-4 md:gap-x-4 pb-6">
<div className=" md:col-span-5 col-span-2 ">
<div className=" md:col-span-5 col-span-2">
<div className={`${ansLoading?"overflow-auto":""} max-h-screen`}>
<div>
<QuePost post={queObject} />
</div>

<div className=" mt-7">
<div className=" mt-3">
{isCommentBoxOpen ? (
<div
className="rounded-3xl border border-gray-300 p-4 cursor-pointer"
Expand Down Expand Up @@ -354,8 +358,8 @@ const PostPage = ({ params: { postTitle } }: Props) => {
<AnsPost answers={answers} postTitleWithSpaces={postTitleWithSpaces} postId={queObject.id} />
</div>
</div>

<div className=" col-span-2 overflow-hidden h-fit rounded-lg border border-gray-300 ">
</div>
<div className=" col-span-2 sticky overflow-hidden h-fit rounded-lg border border-gray-300 ">
<RecentFeed />
</div>
</div>
Expand Down
124 changes: 55 additions & 69 deletions app/globals.css
Original file line number Diff line number Diff line change
@@ -1,76 +1,62 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
:root {
--background: 0 0% 100%;
--foreground: 224 71.4% 4.1%;

--card: 0 0% 100%;
--card-foreground: 224 71.4% 4.1%;

--popover: 0 0% 100%;
--popover-foreground: 224 71.4% 4.1%;

--primary: 220.9 39.3% 11%;
--primary-foreground: 210 20% 98%;

--secondary: 220 14.3% 95.9%;
--secondary-foreground: 220.9 39.3% 11%;

--muted: 220 14.3% 95.9%;
--muted-foreground: 220 8.9% 46.1%;

--accent: 220 14.3% 95.9%;
--accent-foreground: 220.9 39.3% 11%;

--destructive: 0 84.2% 60.2%;
--destructive-foreground: 210 20% 98%;

--border: 220 13% 91%;
--input: 220 13% 91%;
--ring: 224 71.4% 4.1%;

--radius: 0.5rem;
}

.dark {
--background: 224 71.4% 4.1%;
--foreground: 210 20% 98%;

--card: 224 71.4% 4.1%;
--card-foreground: 210 20% 98%;

--popover: 224 71.4% 4.1%;
--popover-foreground: 210 20% 98%;

--primary: 210 20% 98%;
--primary-foreground: 220.9 39.3% 11%;

--secondary: 215 27.9% 16.9%;
--secondary-foreground: 210 20% 98%;

--muted: 215 27.9% 16.9%;
--muted-foreground: 217.9 10.6% 64.9%;

--accent: 215 27.9% 16.9%;
--accent-foreground: 210 20% 98%;

--destructive: 0 62.8% 30.6%;
--destructive-foreground: 210 20% 98%;

--border: 215 27.9% 16.9%;
--input: 215 27.9% 16.9%;
--ring: 216 12.2% 83.9%;
}
:root {
--background: 0 0% 100%;
--foreground: 224 71.4% 4.1%;
--card: 0 0% 100%;
--card-foreground: 224 71.4% 4.1%;
--popover: 0 0% 100%;
--popover-foreground: 224 71.4% 4.1%;
--primary: 220.9 39.3% 11%;
--primary-foreground: 210 20% 98%;
--secondary: 220 14.3% 95.9%;
--secondary-foreground: 220.9 39.3% 11%;
--muted: 220 14.3% 95.9%;
--muted-foreground: 220 8.9% 46.1%;
--accent: 220 14.3% 95.9%;
--accent-foreground: 220.9 39.3% 11%;
--destructive: 0 84.2% 60.2%;
--destructive-foreground: 210 20% 98%;
--border: 220 13% 91%;
--input: 220 13% 91%;
--ring: 224 71.4% 4.1%;
--radius: 0.5rem;
}
.dark {
--background: 224 71.4% 4.1%;
--foreground: 210 20% 98%;
--card: 224 71.4% 4.1%;
--card-foreground: 210 20% 98%;
--popover: 224 71.4% 4.1%;
--popover-foreground: 210 20% 98%;
--primary: 210 20% 98%;
--primary-foreground: 220.9 39.3% 11%;
--secondary: 215 27.9% 16.9%;
--secondary-foreground: 210 20% 98%;
--muted: 215 27.9% 16.9%;
--muted-foreground: 217.9 10.6% 64.9%;
--accent: 215 27.9% 16.9%;
--accent-foreground: 210 20% 98%;
--destructive: 0 62.8% 30.6%;
--destructive-foreground: 210 20% 98%;
--border: 215 27.9% 16.9%;
--input: 215 27.9% 16.9%;
--ring: 216 12.2% 83.9%;
}
}

@layer base {
* {
@apply border-border;
}
body {
@apply bg-background text-foreground;
}
* {
@apply border-border;
}
body {
@apply bg-background text-foreground;
}
}

.dropdown-container {
overflow: visible;
/* or overflow: auto; */
}
8 changes: 4 additions & 4 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,8 @@ export default function Home() {
Home
</p>
</div> */}
<dl className='rounded-md divide-y divide-gray-100 border bg-[#FFFFFF] dark:bg-[#262626] border-gray-100 px-6 py-4 text-sm leading-6'>
<div className='flex rounded-md justify-between md:min-h-[7.5rem] gap-x-4 py-3'>
<dl className='rounded-md divide-y divide-gray-100 border bg-[#FFFFFF] dark:bg-[#262626] border-gray-100 px-6 py-3 text-sm leading-6'>
<div className='flex rounded-md justify-between md:min-h-[5rem] gap-x-4 py-3'>
{
isGuest === 'true' ? (
<p className=" text-zinc-500">
Expand Down Expand Up @@ -342,8 +342,8 @@ export default function Home() {
)}
/>

{(progress||1)>0&&<span className='pt-3'>{`${Math.ceil((progress||0))} % Uploaded`}</span>}

{(progress||0)>0&&<span className='pt-3'>{`${Math.ceil((progress||0))} % Uploaded`}</span>}
{/* "0" to make upload percentage invisible when no image is selected */}
{/* anonymity toggle */}
<FormField
control={form.control}
Expand Down
Loading
Loading