Skip to content

Commit

Permalink
Merge pull request #8 from scheduler-SoHwaGi/dev
Browse files Browse the repository at this point in the history
feat: swift와의 iOS 통신 브릿지 연결
  • Loading branch information
urimeee authored Dec 29, 2024
2 parents d518171 + 87e3c8f commit 266eb52
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
11 changes: 11 additions & 0 deletions src/custom.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,14 @@ declare module '*.png' {
const content: any;
export default content;
}
declare global {
interface Window {
receiveUserInfo?: (userInfo: userInfo) => void;
}
}

export interface UserInfo {
fullName?: string;
email?: string;
userIdentifier?: string;
}
11 changes: 10 additions & 1 deletion src/pages/PlusPage/PlusPage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import React, { useEffect, useState } from 'react';

// import css
import * as S from './PlusPage.style';
Expand All @@ -7,10 +7,19 @@ import * as S from './PlusPage.style';
import UserProfile from '../../components/UserProfile/UserProfile';
import AddPageContainer from '../../components/AddPageContainer/AddPageContainer';
import VersionInfo from '../../components/VersionInfo/VersionInfo';
import { UserInfo } from '../../custom';

const PlusPage = () => {
const addPageInfoTitles = ['서비스 이용약관', '개인정보 처리방침'];
const addPageSettingTitles = ['로그아웃', '회원탈퇴'];
const [userInfo, setUserInfo] = useState<UserInfo>({});

useEffect(() => {
window.receiveUserInfo = (info: UserInfo) => {
setUserInfo(info);
console.log(userInfo);
};
}, []);

return (
<S.AddPageContainer>
Expand Down

0 comments on commit 266eb52

Please sign in to comment.