Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/analyzing screen #2 #48

Open
wants to merge 67 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
0da2676
[feat]api호출 키수정해야함
zeeun Dec 29, 2023
3ceaa5f
[feat]중간저장
zeeun Jan 5, 2024
52f52cd
[feat]fromdata이미지전송
zeeun Jan 5, 2024
f6a78f8
[feat]onboarding화면
zeeun Jan 16, 2024
17b0e75
Merge pull request #1 from Regular-Pharmasist/feat/APIconnecting-#1
zeeun Jan 16, 2024
e852bf7
[feat]카메라기능추가
zeeun Jan 16, 2024
91b7bfe
[feat]메뉴,카카오연결(수정필요), 홈화면 버튼 및 카메라 추가
zeeun Jan 17, 2024
41e88d8
[feat]카카오 소셜로그인 성공
zeeun Jan 19, 2024
d92a230
Merge pull request #2 from Regular-Pharmasist/feat/APIconnecting-#1
zeeun Jan 19, 2024
08096b5
[fix]오류해결
zeeun Jan 24, 2024
97f8c6b
Merge pull request #3 from Regular-Pharmasist/feat/APIconnecting-#1
zeeun Jan 24, 2024
cb665e5
[feat]navigation수정
zeeun Jan 26, 2024
99f16b8
[fix]온보딩화면 수정
zeeun Jan 31, 2024
762a1c0
Merge pull request #4 from Regular-Pharmasist/feat/APIconnecting-#1
zeeun Jan 31, 2024
7960294
[feat]스택화면추가
zeeun Feb 5, 2024
6df46cd
Merge pull request #5 from Regular-Pharmasist/feat/APIconnecting-#1
zeeun Feb 5, 2024
c80f600
[feat] 이미지피커 스택화면 구성완료
zeeun Feb 5, 2024
9462763
[fix]스택및 헤더수정
zeeun Feb 5, 2024
c9bc211
Merge pull request #6 from Regular-Pharmasist/feat/AnalyzingScreen-#2
zeeun Feb 5, 2024
37f2782
[feat]카드,블록 뉴스택스크린적용
zeeun Feb 12, 2024
e86b57d
[fix]홈화면 버튼 style 수정
zeeun Feb 12, 2024
a92e0d3
[style]홈화면 UI 중간완성
zeeun Feb 12, 2024
56dccef
Merge pull request #7 from Regular-Pharmasist/feat/AnalyzingScreen-#2
zeeun Feb 12, 2024
d4c3889
[style]온보딩화면수정 및 폰트적용
zeeun Feb 12, 2024
f0c7964
Merge pull request #8 from Regular-Pharmasist/feat/AnalyzingScreen-#2
zeeun Feb 12, 2024
d9cc826
[feat]약물분석기록추가
zeeun Feb 15, 2024
a3b7afe
Merge pull request #9 from Regular-Pharmasist/feat/AnalyzingScreen-#2
zeeun Feb 15, 2024
e56f0c7
[feat]복용기록확인 페이지생성
zeeun Feb 21, 2024
1420153
Merge pull request #10 from Regular-Pharmasist/feat/AnalyzingScreen-#2
zeeun Feb 21, 2024
3a8fcd3
[feat]로그인후화면전환
zeeun Feb 21, 2024
25b9be4
[feat]레전드분석결과출력
zeeun Feb 24, 2024
785f7d0
Merge pull request #11 from Regular-Pharmasist/feat/AnalyzingScreen-#2
zeeun Feb 24, 2024
64b9527
[feat]약물분석기능완성
zeeun Feb 29, 2024
f371f28
Merge pull request #12 from Regular-Pharmasist/feat/AnalyzingScreen-#2
zeeun Feb 29, 2024
0b6330e
[Feat] 복용 기록
h2st0n Mar 11, 2024
158a6c0
[Design] UI 디자인 수정 #1
h2st0n Mar 11, 2024
2015259
[Design] UI 수정
h2st0n Mar 11, 2024
3c59c34
Merge pull request #14 from Regular-Pharmasist/UIDesign
h2st0n Mar 11, 2024
b46d2ce
[fix]리다이렉트 uri 수정
zeeun Mar 12, 2024
e785c3e
Merge pull request #15 from Regular-Pharmasist/feat/AnalyzingScreen-#2
zeeun Mar 12, 2024
a10a339
[fix] UI 오류 수정
h2st0n Mar 14, 2024
b54a6eb
Merge pull request #16 from Regular-Pharmasist/UIDesign-#2
h2st0n Mar 14, 2024
b9fdd7a
[feat]모달창 drugcard로옮기고 프로필작업
zeeun Mar 16, 2024
3ed206d
Merge branch 'master' into feat/AnalyzingScreen-#2
zeeun Mar 16, 2024
5120841
Merge pull request #17 from Regular-Pharmasist/feat/AnalyzingScreen-#2
zeeun Mar 16, 2024
f44a767
[Design] UI 디자인 수정 #2
h2st0n Mar 17, 2024
66a0519
Merge pull request #18 from Regular-Pharmasist/UIDesign-#3
h2st0n Mar 17, 2024
52c3ac5
[Design] UI 디자인 수정 #3
h2st0n Mar 17, 2024
e0abe1c
[feat] 프로필완성
zeeun Mar 18, 2024
0d7f581
Merge branch 'master' into feat/AnalyzingScreen-#2
zeeun Mar 18, 2024
a2341ea
[feat]복용기록기능완성
zeeun Mar 18, 2024
5bda595
Merge pull request #19 from Regular-Pharmasist/feat/AnalyzingScreen-#2
zeeun Mar 18, 2024
b838758
[feat]기록수정
zeeun Mar 18, 2024
fc9090e
Merge pull request #20 from Regular-Pharmasist/feat/AnalyzingScreen-#2
zeeun Mar 18, 2024
4f94801
[feat]상세약물기능완료
zeeun Mar 18, 2024
b1eb702
[Design] UI 디자인 수정 #3
h2st0n Mar 18, 2024
2b26f5f
[feat]경고카드작성
zeeun Mar 18, 2024
c3b6488
[feat]디스크립션, 경고 완성
zeeun Mar 18, 2024
f02b683
Merge branch 'master' into feat/AnalyzingScreen-#2
zeeun Mar 18, 2024
798455d
Merge pull request #21 from Regular-Pharmasist/feat/AnalyzingScreen-#2
zeeun Mar 18, 2024
6f479c9
Merge branch 'master' into feat/AnalyzingScreen-#2
zeeun Mar 18, 2024
ba2943a
Merge branch 'feat/AnalyzingScreen-#2' of https://github.com/Regular-…
zeeun Mar 18, 2024
91686b4
[Design] UI 디자인 수정 #4
h2st0n Mar 18, 2024
ed5a2eb
[feat]카메라이상한거 교정
zeeun Mar 18, 2024
8a357d2
Merge branch 'master' into feat/AnalyzingScreen-#2
zeeun Mar 18, 2024
f98698e
[FIX]완성
zeeun Mar 19, 2024
63346e5
[fix]디버깅완성
zeeun Mar 19, 2024
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
29 changes: 20 additions & 9 deletions App.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import React, { useCallback, useEffect, useState } from "react";
import { Image } from "react-native";
import { Image, View } from "react-native";
import * as SplashScreen from "expo-splash-screen";
import * as Font from "expo-font";
import { Asset } from "expo-asset";
import { Block, GalioProvider } from "galio-framework";
import { NavigationContainer } from "@react-navigation/native";
import { Provider } from 'react-redux';
import store from './store/store'; // 스토어 파일의 위치에 맞게 경로를 조정하세요.

// Before rendering any navigation stack
import { enableScreens } from "react-native-screens";
Expand Down Expand Up @@ -46,7 +48,14 @@ export default function App() {
await _loadResourcesAsync();
// Pre-load fonts, make any API calls you need to do here
await Font.loadAsync({
ArgonExtra: require("./assets/font/argon.ttf"),
ArgonExtra: require("./assets/font/Orbit-Regular.ttf"),
KoPubWorldBatang_Pro_Bold: require("./assets/font/KoPubWorld_Batang_Pro_Bold.otf"),
KoPubWorldBatang_Pro_Light: require("./assets/font/KoPubWorld_Batang_Pro_Light.otf"),
KoPubWorldBatang_Pro_Medium: require("./assets/font/KoPubWorld_Batang_Pro_Medium.otf"),
KoPubWorldDotum_Pro_Bold: require("./assets/font/KoPubWorld_Dotum_Pro_Bold.otf"),
KoPubWorldDotum_Pro_Light: require("./assets/font/KoPubWorld_Dotum_Pro_Light.otf"),
KoPubWorldDotum_Pro_Medium: require("./assets/font/KoPubWorld_Dotum_Pro_Medium.otf"),
Gugi: require("./assets/font/Gugi-Regular.ttf"),
});
} catch (e) {
console.warn(e);
Expand All @@ -73,12 +82,14 @@ export default function App() {
}

return (
<NavigationContainer onReady={onLayoutRootView}>
<GalioProvider theme={argonTheme}>
<Block flex>
<Screens />
</Block>
</GalioProvider>
</NavigationContainer>
<Provider store={store}>
<NavigationContainer onReady={onLayoutRootView}>
<GalioProvider theme={argonTheme}>
<Block flex>
<Screens />
</Block>
</GalioProvider>
</NavigationContainer>
</Provider>
);
}
9 changes: 2 additions & 7 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
"name": "Argon FREE React Native",
"slug": "argon-free-react-native",
"privacy": "public",
"platforms": [
"ios",
"android"
],
"platforms": ["ios", "android", "web"],
"version": "1.7.1",
"orientation": "portrait",
"icon": "./assets/icon.png",
Expand All @@ -18,9 +15,7 @@
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
"**/*"
],
"assetBundlePatterns": ["**/*"],
"ios": {
"supportsTablet": true
},
Expand Down
Binary file added assets/.DS_Store
Binary file not shown.
Binary file added assets/font/Gugi-Regular.ttf
Binary file not shown.
Binary file added assets/font/KoPubWorld_Batang_Pro_Bold.otf
Binary file not shown.
Binary file added assets/font/KoPubWorld_Batang_Pro_Light.otf
Binary file not shown.
Binary file added assets/font/KoPubWorld_Batang_Pro_Medium.otf
Binary file not shown.
Binary file added assets/font/KoPubWorld_Dotum_Pro_Bold.otf
Binary file not shown.
Binary file added assets/font/KoPubWorld_Dotum_Pro_Light.otf
Binary file not shown.
Binary file added assets/font/KoPubWorld_Dotum_Pro_Medium.otf
Binary file not shown.
Binary file added assets/font/Orbit-Regular.ttf
Binary file not shown.
Binary file removed assets/font/argon.ttf
Binary file not shown.
Binary file added assets/imgs/.DS_Store
Binary file not shown.
Binary file modified assets/imgs/argon-logo-onboarding.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/imgs/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/imgs/argon-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/imgs/[email protected]
Binary file not shown.
Binary file added assets/imgs/backg1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/imgs/backg2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/imgs/bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/imgs/bg2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/imgs/defaultpill.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/imgs/kakao.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/imgs/logo_sub.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/imgs/profile-screen-bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/imgs/profile-screen-bg2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = function (api) {
extensions: [".tsx", ".ts", ".js", ".json"],
},
],
"react-native-reanimated/plugin",
["react-native-reanimated/plugin"],
],
};
};
48 changes: 27 additions & 21 deletions components/DrawerItem.js
Original file line number Diff line number Diff line change
@@ -1,58 +1,64 @@
import React from "react";
import { StyleSheet, TouchableOpacity, Linking } from "react-native";
import { Block, Text, theme } from "galio-framework";
import { FontAwesome, MaterialIcons, Feather, MaterialCommunityIcons } from '@expo/vector-icons';

import Icon from "./Icon";
import argonTheme from "../constants/Theme";

class DrawerItem extends React.Component {

iconColor = "#67B779";

renderIcon = () => {
const { title, focused } = this.props;

const iconColor = focused ? "white" : this.iconColor;

switch (title) {
case "Home":
case "":
return (
<Icon
name="shop"
family="ArgonExtra"
name="home"
family="FontAwesome"
size={14}
color={focused ? "white" : argonTheme.COLORS.PRIMARY}
color={iconColor}
/>
);
case "Elements":
case "복용 기록 확인":
return (
<Icon
name="map-big"
family="ArgonExtra"
name="history"
family="MaterialIcons"
size={14}
color={focused ? "white" : argonTheme.COLORS.ERROR}
color={iconColor}
/>
);
case "Articles":
case "복용 알람":
return (
<Icon
name="spaceship"
family="ArgonExtra"
name="bell"
family="Feather"
size={14}
color={focused ? "white" : argonTheme.COLORS.PRIMARY}
color={iconColor}
/>
);
case "Profile":
case "중독 위험도":
return (
<Icon
name="chart-pie-35"
family="ArgonExtra"
name="warning"
family="MaterialIcons"
size={14}
color={focused ? "white" : argonTheme.COLORS.WARNING}
color={iconColor}
/>
);
case "Account":
case "프로필":
return (
<Icon
name="calendar-date"
family="ArgonExtra"
name="account-circle"
family="MaterialIcons"
size={14}
color={focused ? "white" : argonTheme.COLORS.INFO}
color={iconColor}
/>
);
case "Getting Started":
Expand Down Expand Up @@ -113,7 +119,7 @@ const styles = StyleSheet.create({
paddingHorizontal: 16
},
activeStyle: {
backgroundColor: argonTheme.COLORS.ACTIVE,
backgroundColor: "#67B779",
borderRadius: 4
},
shadow: {
Expand Down
162 changes: 162 additions & 0 deletions components/DrugCard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
import React, { useState } from "react";
import { useDispatch, useSelector } from "react-redux";
import {
ScrollView,
StyleSheet,
Text,
View,
Image,
Button,
} from "react-native";
import ModalComponent from "./ModalComponent";
import { addRecord } from "../store/actions/recordActions";

// decodeHtmlEntity 함수를 적용하여 출력
const renderTextWithNewLines = (text) => {
const formattedText = decodeHtmlEntity(text);
return formattedText.split("\n").map((line, index) => (
<Text key={index} style={styles.text}>
{line}
</Text>
));
};

function decodeHtmlEntity(str) {
const entities = {
"&lt;": "<",
"&gt;": ">",
"&amp;": "&",
"&quot;": '"',
"&apos;": "'",
"&nbsp;": " ",
"&copy;": "©",
"&reg;": "®",
// 필요한 추가 HTML 엔티티를 여기에 추가하세요.
};

let decodedString = Object.keys(entities).reduce((acc, entity) => {
const regex = new RegExp(entity, "g");
return acc.replace(regex, entities[entity]);
}, str);

// 문자열의 시작과 끝에 있는 따옴표 제거
decodedString = decodedString.replace(/^"|"$/g, "");
// 이스케이프된 줄바꿈 문자 처리
decodedString = decodedString.replace(/\\n/g, "\n");

return decodedString;
}


// 컴포넌트의 props에서 item을 받아오도록 수정
const DrugCard = ({ item }) => {
const { itemName, image, efficiency, warn, sideEffect, typeName } = item; // item 객체에서 필요한 데이터 추출
const accessToken = useSelector((state) => state.auth.accessToken); // Redux 스토어에서 accessToken 가져오기

const [modalVisible, setModalVisible] = useState(false);
const [startDate, setStartDate] = useState(new Date());
const [endDate, setEndDate] = useState(new Date());
const [isTaking, setIsTaking] = useState(true);
const [timesPerDay, setTimesPerDay] = useState(1);

const dispatch = useDispatch();

const onSubmit = (newRecord) => {
// newRecord 객체 구조를 확인하고 적절히 구성해야 함
dispatch(addRecord({ ...newRecord, accessToken })); // Redux 액션 디스패치
setModalVisible(false);
};

// 모달을 열고 닫는 함수
const toggleModal = () => setModalVisible(!modalVisible);

return (
<ScrollView style={styles.card}>
<Text style={styles.title}>{itemName}</Text>
{image && <Image source={{ uri: image }} style={styles.image} />}
{efficiency && (
<>
<Text style={styles.subtitle}>효능</Text>
{renderTextWithNewLines(efficiency)}
</>
)}
{warn && (
<>
<Text style={styles.subtitle}>주의</Text>
{renderTextWithNewLines(warn)}
</>
)}
{sideEffect && (
<>
<Text style={styles.subtitle}>부작용</Text>
{renderTextWithNewLines(sideEffect)}
</>
)}
{typeName && (
<>
<Text style={styles.subtitle}>위험분류</Text>
{renderTextWithNewLines(typeName)}
</>
)}
<Button title="저장하기" onPress={toggleModal} />

<ModalComponent
modalVisible={modalVisible}
onRequestClose={toggleModal}
drugName={itemName}
startDate={startDate}
endDate={endDate}
isTaking={isTaking}
onSubmit={onSubmit}
timesPerDay={timesPerDay}
onStartDateChange={setStartDate}
onEndDateChange={setEndDate}
onTakingPress={() => setIsTaking(true)}
offTakingPress={() => setIsTaking(false)}
onTimesPerDayChange={setTimesPerDay}
// accessToken을 ModalComponent에 전달할 필요 없음
/>
</ScrollView>
);
};



const styles = StyleSheet.create({
card: {
backgroundColor: "#fff",
borderRadius: 8,
padding: 20,
marginBottom: 20,
shadowColor: "#000",
shadowOffset: {
width: 0,
height: 2,
},
shadowOpacity: 0.25,
shadowRadius: 3.84,
elevation: 5,
},
title: {
fontSize: 18,
fontWeight: "bold",
marginBottom: 10,
},
subtitle: {
fontSize: 16,
fontWeight: "bold",
marginTop: 10,
},
text: {
fontSize: 14,
marginTop: 5,
},
image: {
width: 100,
height: 100,
resizeMode: "cover",
marginBottom: 10,
},
});

export default DrugCard;
Loading