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

UI design #50

Open
wants to merge 37 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 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
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 10 additions & 9 deletions App.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
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";
Expand Down Expand Up @@ -46,7 +46,7 @@ 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"),
});
} catch (e) {
console.warn(e);
Expand All @@ -73,12 +73,13 @@ export default function App() {
}

return (
<NavigationContainer onReady={onLayoutRootView}>
<GalioProvider theme={argonTheme}>
<Block flex>
<Screens />
</Block>
</GalioProvider>
</NavigationContainer>
<NavigationContainer onReady={onLayoutRootView}>
<GalioProvider theme={argonTheme}>
<Block flex>
<Screens />
</Block>
</GalioProvider>
</NavigationContainer>

);
}
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/Orbit-Regular.ttf
Binary file not shown.
Binary file removed assets/font/argon.ttf
Binary file not shown.
Binary file modified assets/imgs/argon-logo-onboarding.png
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-onboarding@2x.png
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
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/argon-logo@2x.png
Binary file not shown.
Binary file added assets/imgs/backg1.png
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
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
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
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
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"],
],
};
};
10 changes: 5 additions & 5 deletions components/DrawerItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class DrawerItem extends React.Component {
const { title, focused } = this.props;

switch (title) {
case "Home":
case "":
return (
<Icon
name="shop"
Expand All @@ -19,7 +19,7 @@ class DrawerItem extends React.Component {
color={focused ? "white" : argonTheme.COLORS.PRIMARY}
/>
);
case "Elements":
case "복용기록확인":
return (
<Icon
name="map-big"
Expand All @@ -28,7 +28,7 @@ class DrawerItem extends React.Component {
color={focused ? "white" : argonTheme.COLORS.ERROR}
/>
);
case "Articles":
case "복용알람":
return (
<Icon
name="spaceship"
Expand All @@ -37,7 +37,7 @@ class DrawerItem extends React.Component {
color={focused ? "white" : argonTheme.COLORS.PRIMARY}
/>
);
case "Profile":
case "중독위험도":
return (
<Icon
name="chart-pie-35"
Expand All @@ -46,7 +46,7 @@ class DrawerItem extends React.Component {
color={focused ? "white" : argonTheme.COLORS.WARNING}
/>
);
case "Account":
case "프로필":
return (
<Icon
name="calendar-date"
Expand Down
112 changes: 112 additions & 0 deletions components/DrugCard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
import React from "react";
import { View, Text, Image, StyleSheet, ScrollView } from "react-native";

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;
}

const DrugCard = ({ item }) => {
const { itemName, efficiency, warn, sideEffect, image, typeName } = item;

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

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)}
</>
)}
</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;
104 changes: 104 additions & 0 deletions components/DrugRecordCard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
import React from "react";
import { View, Text, Image, StyleSheet } from "react-native";
import { FontAwesome } from '@expo/vector-icons';

const DrugRecordCard = ({ item }) => {
const { medicineName, dailyFrequency, duration, startDate, endDate, isActive, image, typeName } = item;

const calculateDrugIntakeDates = (startDate, duration) => {
const intakeDates = [];
const start = new Date(startDate);

for (let day = 0; day < duration; day++) {
const date = new Date(start);
date.setDate(start.getDate() + day);

intakeDates.push(date.toLocaleDateString("ko-KR"));
}

return intakeDates;
};

const drugIntakeDates = calculateDrugIntakeDates(startDate, duration);

return (
<View style={styles.card}>
<View style={styles.contentContainer}>
<View style={styles.imageContainer}>
{image && <Image source={{ uri: image }} style={styles.image} />}
</View>
<View style={styles.textContainer}>
<Text style={styles.title}>이름 {medicineName}</Text>
<View style={styles.periodContainer}>
<FontAwesome name="calendar" size={12} color="#6a6c6c" style={styles.calendarIcon} />
<Text style={styles.period}> <Text style={styles.lightText}>{startDate} ~ {endDate}</Text> | <Text style={styles.boldText}>총{duration}일</Text></Text>
</View>
<Text style={styles.boldText}>위험 분류 {typeName}</Text>
</View>
</View>
</View>
);
};

const styles = StyleSheet.create({
card: {
padding: 20,
elevation: 5,
flexDirection: 'row',
alignItems: 'center',
},
contentContainer: {
flexDirection: 'row',
alignItems: 'flex-start'
},
imageContainer: {
marginRight: 10,
alignItems: 'center',
justifyContent: 'center',
},
image: {
width: 80,
height: 60,
resizeMode: "cover",
borderRadius: 5
},
icon: {
width: 68,
height: 19,
marginTop: 5
},
statusText: {
marginTop: 8,
},
textContainer: {
flex: 1,
alignItems: 'flex-start'
},
title: {
fontSize: 18,
fontWeight: "bold",
marginBottom: 5,
},
periodContainer: {
flexDirection: 'row',
alignItems: 'center',
marginBottom: 5,
},
calendarIcon: {
marginRight: 5,
},
period: {
fontSize: 12,
marginBottom: 5,
},
lightText: {
color: '#6a6c6c',
fontSize: 12,
},
boldText: {
fontWeight: 'bold',
color: '#171717',
}
});

export default DrugRecordCard;