Skip to content

Commit

Permalink
[Feat][link] 앱링크 기능 구현 (#209)
Browse files Browse the repository at this point in the history
* 앱링크 설정 추가

* report comment기능 수정
  • Loading branch information
ysh4296 authored Jul 19, 2023
1 parent fa8adcb commit b214d44
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 15 deletions.
26 changes: 21 additions & 5 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"expo": {
"name": "keewe",
"slug": "keewe",
"version": "1.0.8",
"version": "1.1.0",
"orientation": "portrait",
"icon": "./assets/images/icon.png",
"scheme": "myapp",
"scheme": "keewe",
"userInterfaceStyle": "automatic",
"splash": {
"image": "./assets/images/splash.png",
Expand All @@ -20,7 +20,9 @@
"assetBundlePatterns": ["**/*"],
"ios": {
"supportsTablet": true,
"bundleIdentifier": "com.CCCorg.keewe"
"bundleIdentifier": "com.CCCorg.keewe",
"buildNumber": "1.1",
"associatedDomains": ["applinks:d1m48degai0zet.cloudfront.net"]
},
"android": {
"jsEngine": "hermes",
Expand All @@ -29,7 +31,21 @@
"backgroundColor": "#ffffff"
},
"package": "com.akdlsz21.keewe",
"versionCode": 8
"versionCode": 8,
"intentFilters": [
{
"action": "VIEW",
"autoVerify": true,
"data": [
{
"scheme": "https",
"host": "*.d1m48degai0zet.cloudfront.net",
"pathPrefix": "/link"
}
],
"category": ["BROWSABLE", "DEFAULT"]
}
]
},
"web": {
"favicon": "./assets/images/favicon.png"
Expand All @@ -39,7 +55,7 @@
},
"extra": {
"eas": {
"projectId": "662b6040-56c8-42ea-9623-ec66e4cfd04f"
"projectId": "05f9153d-ab7a-4208-a465-60a60c8c4ade"
}
}
}
Expand Down
11 changes: 3 additions & 8 deletions src/components/comments/SheetOthersComment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import BottomSheetHeader from '../header/BottomSheetHeader';
import HeaderRightButton from '../header/HeaderRightButton';
import CountingTextArea from '../texts/CountingTextArea';
import TwoButtonModal from '../modal/TwoButtonModal';
import { reportInsight, reportType } from '../../utils/api/report/insight/insightReport';
import { Toast } from 'react-native-toast-message/lib/src/Toast';
import { blockApi } from '../../utils/api/block/block';
import { reportComment, reportType } from '../../utils/api/report/comment/commentReport';

interface BSPostOptionsProps {
modalRef: React.RefObject<BottomSheetModalMethods>;
Expand All @@ -19,12 +19,7 @@ interface BSPostOptionsProps {
userName: string;
}

const SheetOthersComment = ({
modalRef,
userId,
userName,
commentId: insightId,
}: BSPostOptionsProps) => {
const SheetOthersComment = ({ modalRef, userId, userName, commentId }: BSPostOptionsProps) => {
const { fonts } = useTheme();
const styles = createStyles(fonts);
const [isReport, setIsReport] = useState(false);
Expand Down Expand Up @@ -80,7 +75,7 @@ const SheetOthersComment = ({
reportOptions.find((option) => option.id === selectedReport)?.reportType ||
('OTHERS' as const);

reportInsight({ insightId, reason: reportText, reportType }).then((res) => {
reportComment({ commentId, reason: reportText, reportType }).then((res) => {
if (res?.code === 200) {
setSelectedReport(null);
setIsReport(false);
Expand Down
2 changes: 1 addition & 1 deletion src/components/texts/CountingTextArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ interface CountingTextAreaProps {
autoFocus?: boolean;
limitTextStyle?: any;
multiline?: boolean;
autoCapitalize: any;
autoCapitalize?: any;
}

const CountingTextArea = (props: CountingTextAreaProps) => {
Expand Down
36 changes: 36 additions & 0 deletions src/utils/api/report/comment/commentReport.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { getAccessToken } from '../../../hooks/asyncStorage/Login';
import httpClient from '../../BaseHttpClient';

export interface reportType {
reportType: 'SPAM' | 'INAPPROPRIATE_CONTENT' | 'ABUSE' | 'IMPERSONATION' | 'OTHERS';
reason: string;
commentId: number;
}

export async function reportComment(report: reportType) {
const token = await getAccessToken();

try {
const res = await httpClient.post<ReportResponse>(
'https://api-keewe.com/api/v1/report/comment',
report,
{
headers: {
Authorization: `Bearer ${token}`,
},
},
);

if (res.status !== 200) throw new Error('Report status is not 200');

return res.data;
} catch (error) {
console.error(error);
}
}

export interface ReportResponse {
message: string;
code: number;
data: null;
}
2 changes: 1 addition & 1 deletion src/utils/api/report/insight/insightReport.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getAccessToken } from '../../../hooks/asyncStorage/Login';
import httpClient from '../../BaseHttpClient';

export interface reportType {
interface reportType {
reportType: 'SPAM' | 'INAPPROPRIATE_CONTENT' | 'ABUSE' | 'IMPERSONATION' | 'OTHERS';
reason: string;
insightId: number;
Expand Down

0 comments on commit b214d44

Please sign in to comment.