Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

account settings, video thumbnail tweaks

ameer2468210778117b30
diff --git a/apps/web/app/dashboard/caps/components/CapCard.tsx b/apps/web/app/dashboard/caps/components/CapCard.tsx
index 6edda0065..80a616112 100644
--- a/apps/web/app/dashboard/caps/components/CapCard.tsx
+++ b/apps/web/app/dashboard/caps/components/CapCard.tsx
@@ -9,13 +9,11 @@ import { VideoMetadata } from "@cap/database/types";
import { clientEnv, NODE_ENV } from "@cap/env";
import { Button } from "@cap/ui";
import {
+ faChevronDown,
faLink,
faTrash,
- faUserPlus,
- faChevronDown,
} from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
-import { ChevronDown } from "lucide-react";
import moment from "moment";
import Link from "next/link";
import { useRouter } from "next/navigation";
@@ -101,31 +99,31 @@ export const CapCard: React.FC<CapCardProps> = ({
const renderSharedStatus = () => {
const baseClassName =
- "text-sm text-gray-400 hover:text-gray-500 cursor-pointer flex items-center mb-1";
+ "text-sm text-gray-400 transition-colors duration-300 hover:text-gray-500 cursor-pointer flex items-center mb-1";
if (isOwner) {
if (cap.sharedSpaces.length === 0) {
return (
- <span
- className={`${baseClassName}`}
+ <p
+ className={baseClassName}
onClick={() => setIsSharingDialogOpen(true)}
>
- <span>Not shared</span>{" "}
- <FontAwesomeIcon className="size-3 ml-1" icon={faChevronDown} />
- </span>
+ Not shared{" "}
+ <FontAwesomeIcon className="ml-2 size-2.5" icon={faChevronDown} />
+ </p>
);
} else {
return (
- <span
- className={`${baseClassName}`}
+ <p
+ className={baseClassName}
onClick={() => setIsSharingDialogOpen(true)}
>
- <span>Shared</span>{" "}
- <FontAwesomeIcon className="size-3 ml-1" icon={faChevronDown} />
- </span>
+ Shared{" "}
+ <FontAwesomeIcon className="ml-1 size-2.5" icon={faChevronDown} />
+ </p>
);
}
} else {
- return <span className={`${baseClassName} `}>Shared with you</span>;
+ return <p className={baseClassName}>Shared with you</p>;
}
};
@@ -216,21 +214,8 @@ export const CapCard: React.FC<CapCardProps> = ({
userSpaces={userSpaces}
onSharingUpdated={handleSharingUpdated}
/>
- <div className="flex relative flex-col gap-4 p-4 w-full h-full bg-gray-50 rounded-2xl border-gray-200 transition-colors duration-300 group hover:border-blue-300 border-[1px]">
- <div className="flex absolute duration-200 group-hover:opacity-100 opacity-0 top-6 right-6 z-[20] flex-col gap-2">
- <Tooltip disable={isSharingDialogOpen} content="Share to spaces">
- <Button
- onClick={() => setIsSharingDialogOpen(true)}
- className="!size-8 delay-0 hover:opacity-80 rounded-full min-w-fit !p-0"
- variant="white"
- size="sm"
- >
- <FontAwesomeIcon
- className="text-gray-400 size-3.5"
- icon={faUserPlus}
- />
- </Button>
- </Tooltip>
+ <div className="flex relative flex-col gap-4 w-full h-full bg-gray-50 rounded-2xl border-gray-200 transition-colors duration-300 group hover:border-blue-300 border-[1px]">
+ <div className="flex absolute duration-200 group-hover:opacity-100 opacity-0 top-2 right-2 z-[20] flex-col gap-2">
<Tooltip content="Copy link">
<Button
onClick={() =>
@@ -300,7 +285,7 @@ export const CapCard: React.FC<CapCardProps> = ({
alt={`${cap.name} Thumbnail`}
/>
</Link>
- <div className="flex flex-col flex-grow gap-3 w-full cursor-pointer">
+ <div className="flex flex-col flex-grow gap-3 px-4 pb-4 w-full cursor-pointer">
<div>
{isEditing ? (
<textarea
@@ -335,20 +320,20 @@ export const CapCard: React.FC<CapCardProps> = ({
onBlur={handleDateBlur}
onKeyDown={handleDateKeyDown}
autoFocus
- className="text-sm truncate leading-[1.25rem] text-gray-400 bg-transparent focus:outline-none"
+ className="text-sm truncate mt-2 leading-[1.25rem] text-gray-400 bg-transparent focus:outline-none"
placeholder="YYYY-MM-DD HH:mm:ss"
/>
</div>
) : (
<Tooltip content={`Cap created at ${effectiveDate}`}>
- <span
- className="text-sm truncate leading-[1.25rem] text-gray-400 cursor-pointer flex items-center"
+ <p
+ className="text-sm truncate mt-2 leading-[1.25rem] text-gray-400 cursor-pointer flex items-center"
onClick={handleDateClick}
>
{showFullDate
? moment(effectiveDate).format("YYYY-MM-DD HH:mm:ss")
: moment(effectiveDate).fromNow()}
- </span>
+ </p>
</Tooltip>
)}
</p>
diff --git a/apps/web/app/dashboard/caps/components/CapCardAnalytics.tsx b/apps/web/app/dashboard/caps/components/CapCardAnalytics.tsx
index 08ff8e056..9b44d2e32 100644
--- a/apps/web/app/dashboard/caps/components/CapCardAnalytics.tsx
+++ b/apps/web/app/dashboard/caps/components/CapCardAnalytics.tsx
@@ -16,7 +16,7 @@ export const CapCardAnalytics: React.FC<CapCardAnalyticsProps> = ({
totalReactions,
}) => {
return (
- <div className="flex flex-wrap gap-3 items-center text-sm text-gray-60">
+ <div className="flex flex-wrap gap-4 items-center text-sm text-gray-60">
<Tooltip content={`${displayCount} unique views`}>
<div className="flex gap-1 items-center">
<FontAwesomeIcon className="text-gray-400 size-4" icon={faEye} />
diff --git a/apps/web/app/dashboard/settings/Settings.tsx b/apps/web/app/dashboard/settings/Settings.tsx
index 269d838c1..e383cd5c3 100644
--- a/apps/web/app/dashboard/settings/Settings.tsx
+++ b/apps/web/app/dashboard/settings/Settings.tsx
@@ -1,15 +1,7 @@
"use client";
import { users } from "@cap/database/schema";
-import {
- Button,
- Card,
- CardDescription,
- CardFooter,
- CardTitle,
- Input,
- Label,
-} from "@cap/ui";
+import { Button, Card, CardDescription, CardTitle, Input } from "@cap/ui";
import { useRouter } from "next/navigation";
import toast from "react-hot-toast";
@@ -53,43 +45,41 @@ export const Settings = ({
return (
<form onSubmit={handleSubmit}>
- <Card>
- <CardTitle>Your name</CardTitle>
- <CardDescription>
- Changing your name below will update how your name appears when
- sharing a Cap, and in your profile.
- </CardDescription>
- </Card>
- <Card>
- <div className="space-y-3">
- <div>
- <Label htmlFor="firstName">First name</Label>
- <Input
- type="text"
- defaultValue={firstName as string}
- id="firstName"
- name="firstName"
- />
+ <div className="flex flex-col flex-wrap gap-4 w-full md:flex-row">
+ <Card className="flex-1 space-y-1">
+ <CardTitle>Your name</CardTitle>
+ <CardDescription>
+ Changing your name below will update how your name appears when
+ sharing a Cap, and in your profile.
+ </CardDescription>
+ <div className="flex flex-col flex-wrap gap-5 pt-4 w-full md:flex-row">
+ <div className="flex-1 space-y-2">
+ <Input
+ type="text"
+ placeholder="First name"
+ defaultValue={firstName as string}
+ id="firstName"
+ name="firstName"
+ />
+ </div>
+ <div className="flex-1 space-y-2">
+ <Input
+ type="text"
+ placeholder="Last name"
+ defaultValue={lastName as string}
+ id="lastName"
+ name="lastName"
+ />
+ </div>
</div>
- <div>
- <Label htmlFor="lastName">Last name</Label>
- <Input
- type="text"
- defaultValue={lastName as string}
- id="lastName"
- name="lastName"
- />
+ </Card>
+ <Card className="flex flex-col flex-1 gap-4 justify-between items-stretch">
+ <div className="space-y-1">
+ <CardTitle>Contact email address</CardTitle>
+ <CardDescription>
+ This is the email address you used to sign up to Cap with.
+ </CardDescription>
</div>
- </div>
- </Card>
- <Card>
- <CardTitle>Contact email address</CardTitle>
- <CardDescription>
- This is the email address you used to sign up to Cap with.
- </CardDescription>
- </Card>
- <Card>
- <div>
<Input
type="email"
value={email as string}
@@ -97,13 +87,11 @@ export const Settings = ({
name="contactEmail"
disabled
/>
- </div>
- </Card>
- <CardFooter className="px-6 py-4 border-t">
- <Button type="submit" size="sm" variant="gray">
- Save
- </Button>
- </CardFooter>
+ </Card>
+ </div>
+ <Button className="mt-6" type="submit" size="sm" variant="dark">
+ Save
+ </Button>
</form>
);
};
diff --git a/apps/web/components/VideoThumbnail.tsx b/apps/web/components/VideoThumbnail.tsx
index a3c087df2..54f381768 100644
--- a/apps/web/components/VideoThumbnail.tsx
+++ b/apps/web/components/VideoThumbnail.tsx
@@ -49,7 +49,7 @@ export const VideoThumbnail: React.FC<VideoThumbnailProps> = memo(
return (
<div
- className={`overflow-hidden relative mx-auto w-full bg-black rounded-2xl max-h-[175px] aspect-video`}
+ className={`overflow-hidden relative mx-auto w-full bg-black rounded-t-xl max-h-[175px] aspect-video`}
>
<div className="flex absolute top-0 left-0 z-10 justify-center items-center w-full h-full">
{failed ? (