Skip to content

Commit

Permalink
Merge pull request #470 from Gwasuwon-shot/feat#447=messageShare
Browse files Browse the repository at this point in the history
Feat#447=message share
  • Loading branch information
eunbeann authored May 19, 2024
2 parents 9767b12 + b0af672 commit 7c3a5fd
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 16 deletions.
15 changes: 3 additions & 12 deletions src/components/LessonConnect/LessonConnectNumber.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,17 @@
import { useState } from "react";
import { useMutation } from "react-query";
import { useNavigate } from "react-router-dom";
import { useRecoilState, useRecoilValue, useSetRecoilState } from "recoil";
import { useRecoilState, useRecoilValue } from "recoil";
import { styled } from "styled-components";
import { createLesson } from "../../api/createLesson";
import { studentNameState, subjectNameState } from "../../atom/common/datePicker";
import { updateLessonParents } from "../../api/manageLesson/updateLessonParents";
import { parentsPhoneState } from "../../atom/registerLesson/registerLesson";
import { cycleNumberState, dateState, dayState } from "../../atom/timePicker/timePicker";
import {
accountNumber,
bankName,
lessonCodeAndPaymentId,
moneyAmount,
paymentOrder,
} from "../../atom/tuitionPayment/tuitionPayment";
import { lessonCodeAndPaymentId } from "../../atom/tuitionPayment/tuitionPayment";
import { BUTTON_TEXT } from "../../core/signup/signUpTextLabels";
import useFormattedPhoneNumber from "../../hooks/signupLogin/usePhoneNumberFormat";
import useModal from "../../hooks/useModal";
import { BasicDoubleModal, BottomButton, CommonBackButton, ProgressBar } from "../common";
import InputLayout from "../signup/InputLayout";
import SignupTitleLayout from "../signup/SignupTitleLayout";
import { updateLessonParents } from "../../api/manageLesson/updateLessonParents";

interface scheduleListProps {
dayOfWeek: string;
Expand Down
4 changes: 2 additions & 2 deletions src/components/lessonRecord/LessonInfoList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ export default function LessonInfoList(props: LessonInfoListProp) {
)}

<LessonInfoMainCategory>์€ํ–‰</LessonInfoMainCategory>
{[accountInfo?.name, accountInfo?.bank, accountInfo?.number]?.map((info: string, idx: number) => {
{[accountInfo?.bank, accountInfo?.number]?.map((info: string, idx: number) => {
return (
<LessonInfoItemLayout isBankAccount={idx === 2} key={idx} detailCategory={BANK_INFO[idx]} content={info} />
<LessonInfoItemLayout isBankAccount={idx === 1} key={idx} detailCategory={BANK_INFO[idx]} content={info} />
);
})}
<LessonInfoMainCategory>์ˆ˜์—…์ง„ํ–‰</LessonInfoMainCategory>
Expand Down
8 changes: 7 additions & 1 deletion src/components/lessonShare/ShareMain.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default function ShareMain({ handleMoveToPage }: handleMoveToPageProps) {
icon: ShareViaMessage,
text: "๋ฉ”์‹œ์ง€",
onClick: () => {
alert("์ค€๋น„ ์ค‘์ธ ๊ธฐ๋Šฅ์ž…๋‹ˆ๋‹ค.");
handleShareViaMessage();
},
},
{
Expand Down Expand Up @@ -67,6 +67,12 @@ export default function ShareMain({ handleMoveToPage }: handleMoveToPageProps) {
}
}

function handleShareViaMessage() {
const message = `์•ˆ๋…•ํ•˜์„ธ์š”, ๊ณผ์™ธ ์ˆ˜์—… ๊ด€๋ฆฌ ํ•„์ˆ˜ ์•ฑ Tutice ์ž…๋‹ˆ๋‹ค. \n\n[${userName}]์„ ์ƒ๋‹˜์ด [${studentName}]ํ•™์ƒ์˜\nTutice ์ดˆ๋Œ€์žฅ์„ ๋ณด๋ƒˆ์Šต๋‹ˆ๋‹ค.\n\nTutice ๋งํฌ \n ${URL}`;
const smsLink = `sms:?body=${encodeURIComponent(message)}`;
window.location.href = smsLink;
}

function handleCopyLink() {
try {
navigator.clipboard.writeText(URL).then(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/core/Parents/lessonInfo.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export const BANK_INFO = ["์ž…๊ธˆ์ž๋ช…", "์€ํ–‰", "๊ณ„์ขŒ๋ฒˆํ˜ธ"];
export const BANK_INFO = ["์€ํ–‰", "๊ณ„์ขŒ๋ฒˆํ˜ธ"];
export const CLASS_INFO = ["์‹œ์ž‘๋‚ ์งœ", "์ž…๊ธˆ๋ฐฉ์‹", "์ˆ˜์—…๋น„"];

0 comments on commit 7c3a5fd

Please sign in to comment.