Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,12 @@ const GroupModal = ({
);
case "awaiting_payment_confirmation":
return (
<Button type="primary" disabled icon={<HiCash />}>
در حال پرداخت
<Button
type="primary"
icon={<HiCash />}
onClick={() => handlePayment(teamId)}
>
پرداخت
</Button>
);
case "active":
Expand Down
7 changes: 3 additions & 4 deletions apps/ssc/app/dashboard/edit-account/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -370,18 +370,17 @@ const Page = () => {
/>
</div>

<div className="flex justify-center py-6 md:px-32">
{/* <div className="flex justify-center py-6 md:px-32">
<Button
className=" w-full"
size={ButtonSize.SMALL}
variant={ButtonVariant.PRIMARY}
label={isSubmitting ? "در حال آپدیت..." : "ویرایش اطلاعات"}
type="submit"
disable={true}
// disable={isSubmitting}
disable={isSubmitting}
loading={isSubmitting}
/>
</div>
</div> */}
</form>

<ImageCropModal
Expand Down
1 change: 1 addition & 0 deletions apps/ssc/app/dashboard/teams/components/MyTeams.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const MyTeams = () => {
isOpen={isCreateModalOpen}
onClose={() => setIsCreateModalOpen(false)}
onTeamCreated={fetchTeams}
teamNames={teams.map((team) => team.name)}
/>
</>
);
Expand Down
10 changes: 9 additions & 1 deletion apps/ssc/app/dashboard/teams/components/createTeamModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ interface CreateTeamModalProps {
isOpen: boolean;
onClose: () => void;
onTeamCreated?: () => void;
teamNames: string[];
}

const emailSchema = z.object({
Expand All @@ -31,6 +32,7 @@ const CreateTeamModal: React.FC<CreateTeamModalProps> = ({
isOpen,
onClose,
onTeamCreated,
teamNames,
}) => {
const [currentStep, setCurrentStep] = useState(1);
const [teamName, setTeamName] = useState("");
Expand Down Expand Up @@ -94,7 +96,13 @@ const CreateTeamModal: React.FC<CreateTeamModalProps> = ({
handleClose();
} catch (error) {
if (error.status === 400) {
toast.error("تیم با این نام قبلا ایجاد شده است");
console.log(error);
if (teamNames?.includes(teamName))
toast.error("تیم با این نام قبلا ایجاد شده است");
else
toast.error(
"همه ی اعضا با ایمیل وارد شده باید در سایت انجمن اکانت داشته باشند"
);
return;
}
toast.error(error.response.data?.message || "خطا در ایجاد تیم");
Expand Down
1 change: 1 addition & 0 deletions apps/ssc/app/dashboard/teams/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ const Page = () => {
isOpen={isCreateModalOpen}
onClose={() => setIsCreateModalOpen(false)}
onTeamCreated={fetchTeams}
teamNames={teamsList.map((team) => team.name)}
/>
</>
);
Expand Down
Loading