Skip to content

Commit 695bd2c

Browse files
author
Rajat Saxena
committed
Added share button
1 parent 146289b commit 695bd2c

File tree

3 files changed

+32
-6
lines changed

3 files changed

+32
-6
lines changed

apps/web/components/community/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1538,6 +1538,7 @@ export function CommunityForum({
15381538
)!
15391539
}
15401540
joiningReasonText={community?.joiningReasonText}
1541+
pageId={community?.pageId}
15411542
onJoin={handleJoin}
15421543
onLeave={handleLeave}
15431544
/>

apps/web/components/community/info.tsx

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,13 @@ import {
1515
getSymbolFromCurrency,
1616
Link,
1717
TextRenderer,
18+
useToast,
1819
} from "@courselit/components-library";
19-
import { ProfileContext, SiteInfoContext } from "@components/contexts";
20+
import {
21+
AddressContext,
22+
ProfileContext,
23+
SiteInfoContext,
24+
} from "@components/contexts";
2025
import {
2126
Dialog,
2227
DialogContent,
@@ -27,7 +32,8 @@ import {
2732
DialogTrigger,
2833
} from "@components/ui/dialog";
2934
import { checkPermission } from "@courselit/utils";
30-
import { COMMUNITY_SETTINGS } from "@ui-config/strings";
35+
import { COMMUNITY_SETTINGS, TOAST_TITLE_SUCCESS } from "@ui-config/strings";
36+
import { Share2 } from "lucide-react";
3137
const { permissions } = UIConstants;
3238

3339
interface CommunityInfoProps {
@@ -40,6 +46,7 @@ interface CommunityInfoProps {
4046
rejectionReason?: string;
4147
paymentPlan: PaymentPlan;
4248
joiningReasonText?: string;
49+
pageId: string;
4350
onJoin: (joiningReason?: string) => void;
4451
onLeave: () => void;
4552
}
@@ -54,17 +61,20 @@ export function CommunityInfo({
5461
rejectionReason,
5562
paymentPlan,
5663
joiningReasonText,
64+
pageId,
5765
onJoin,
5866
onLeave,
5967
}: CommunityInfoProps) {
6068
const [showLeaveConfirmation, setShowLeaveConfirmation] = useState(false);
6169
const [isJoinDialogOpen, setIsJoinDialogOpen] = useState(false);
6270
const [joiningReason, setJoiningReason] = useState("");
6371
const { amount, period } = getPlanPrice(paymentPlan);
72+
const address = useContext(AddressContext);
6473
const siteinfo = useContext(SiteInfoContext);
6574
const { profile } = useContext(ProfileContext);
6675
const currencySymbol =
6776
getSymbolFromCurrency(siteinfo.currencyISOCode || "USD") || "$";
77+
const { toast } = useToast();
6878

6979
const handleJoinSubmit = async (e: FormEvent) => {
7080
e.preventDefault();
@@ -80,10 +90,25 @@ export function CommunityInfo({
8090
setShowLeaveConfirmation(false);
8191
};
8292

93+
const handleShareClick = () => {
94+
navigator.clipboard.writeText(`${address.frontend}/p/${pageId}`);
95+
toast({
96+
title: TOAST_TITLE_SUCCESS,
97+
description: "Page ID copied to clipboard!",
98+
});
99+
};
100+
83101
return (
84102
<Card>
85-
<CardHeader>
86-
<CardTitle>{name}</CardTitle>
103+
<CardHeader className="flex justify-between items-center w-full">
104+
<CardTitle className="w-full">
105+
<div class="flex justify-between items-center w-full">
106+
<p>{name}</p>
107+
<Button variant="ghost" onClick={handleShareClick}>
108+
<Share2 className="h-5 w-5" />
109+
</Button>
110+
</div>
111+
</CardTitle>
87112
</CardHeader>
88113
<CardContent className="space-y-4">
89114
<img

services/queue/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:20-alpine AS builder
1+
FROM node:22-alpine AS builder
22
WORKDIR /app
33

44
# copy yarn specific files
@@ -20,7 +20,7 @@ RUN yarn rebuild
2020
RUN yarn build
2121

2222
# Production image
23-
FROM node:20-alpine as runner
23+
FROM node:20-alpine AS runner
2424

2525
ENV NODE_ENV production
2626
WORKDIR /app

0 commit comments

Comments
 (0)