Skip to content

Commit

Permalink
Merge pull request #34 from siinghd/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
siinghd authored Jan 9, 2024
2 parents 83c836b + b97087b commit aa56b80
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 12 deletions.
1 change: 1 addition & 0 deletions frontend/components/Loading.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Skeleton } from '@/components/ui/skeleton';

const Loading = () => {
return (
<div className="flex items-center justify-center h-screen">
Expand Down
26 changes: 14 additions & 12 deletions frontend/components/PostCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,19 +99,21 @@ const PostCard: React.FC<IProps> = ({
className="h-10 w-10 rounded-full"
src={post?.author?.image || ''}
/>
<AvatarFallback>CN</AvatarFallback>
<AvatarFallback>DP</AvatarFallback>
</Avatar>
<TextSnippet className="font-medium">
{post?.author?.name}
</TextSnippet>
<TextSnippet className="text-sm text-gray-500">
{dayjs(post.createdAt).fromNow()}
</TextSnippet>
<TextSnippet className="w-[10px] h-[10px] bg-blue-500 rounded-full"></TextSnippet>
<TextSnippet className="text-sm text-gray-500 -ml-2">
Edited on&nbsp;
{dayjs(post.updatedAt).fromNow()}
</TextSnippet>
<div className="flex flex-col">
<TextSnippet className="font-medium mb-1">
{post?.author?.name}
</TextSnippet>
<div className="flex items-center">
<TextSnippet className="text-xs text-gray-500">
{dayjs(post.createdAt).fromNow()}
</TextSnippet>
<TextSnippet className="text-xs text-gray-500 ml-1">
• Updated {dayjs(post.updatedAt).fromNow()}
</TextSnippet>
</div>
</div>
</div>
<DropdownMenu>
<DropdownMenuTrigger>
Expand Down
26 changes: 26 additions & 0 deletions frontend/components/ui/loading-spinner.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { cn } from '@/lib/utils';

export interface ISVGProps extends React.SVGProps<SVGSVGElement> {
size?: number;
className?: string;
}

const LoadingSpinner = ({ size = 24, className, ...props }: ISVGProps) => {
<svg
xmlns="http://www.w3.org/2000/svg"
width={size}
height={size}
{...props}
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
className={cn('animate-spin', className)}
>
<path d="M21 12a9 9 0 1 1-6.219-8.56" />
</svg>;
};

export default LoadingSpinner;

0 comments on commit aa56b80

Please sign in to comment.