Skip to content

Commit

Permalink
[#11] style: implement responsive UI
Browse files Browse the repository at this point in the history
  • Loading branch information
hee-suh committed Aug 15, 2022
1 parent 9f99cae commit 30a1408
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 47 deletions.
46 changes: 23 additions & 23 deletions react-native/components/BottomDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,23 +149,23 @@ function BottomDrawer(props: BottomDrawerProps) {

return (
<View style={styles.bottomDrawer}>
<View style={{ flex: 1 }}>
<View style={styles.horizontalLine} />
<View style={[styles.spaceBetween, { paddingBottom: 24 }]}>
<Text fontFamily="heading" fontWeight={700} fontStyle="normal" fontSize='2xl' color="primary.500">{props.showKorean ? i18n.t('korean') : i18n.t('translation')}</Text>
<HStack space={2}>
<TouchableOpacity onPress={props.handleKorean}>
<MaterialIcons name="translate" size={32} color="#000"/>
</TouchableOpacity>
<TouchableOpacity onPress={props.copyToClipboard}>
<MaterialIcons name="content-copy" size={32} color="black" />
</TouchableOpacity>
</HStack>
</View>
{/* <View style={{paddingBottom: 10, marginBottom: 10, flex: 1}}> */}
<ScrollView style={{ flex: 1 }}>
<TouchableWithoutFeedback>
<View style={styles.horizontalLine} />

<View style={[styles.spaceBetween, { paddingBottom: 24 }]}>
<Text fontFamily="heading" fontWeight={700} fontStyle="normal" fontSize='2xl' color="primary.500">{props.showKorean ? i18n.t('korean') : i18n.t('translation')}</Text>
<HStack space={2}>
<TouchableOpacity onPress={props.handleKorean}>
<MaterialIcons name="translate" size={32} color="#000"/>
</TouchableOpacity>
<TouchableOpacity onPress={props.copyToClipboard}>
<MaterialIcons name="content-copy" size={32} color="black" />
</TouchableOpacity>
</HStack>
</View>

{/* <View style={{paddingBottom: 10, marginBottom: 10, flex: 1}}> */}
<ScrollView style={{ flex: 1 }}>
<TouchableWithoutFeedback>
<Text fontFamily="body" fontWeight={500} fontStyle="normal" fontSize='md' lineHeight='xl'>
{!props.showKorean ? (
props.results?.fullText?.map((item, index) =>
Expand Down Expand Up @@ -309,10 +309,10 @@ function BottomDrawer(props: BottomDrawerProps) {
<Text>{props.results?.korean}</Text>
)}
</Text>
</TouchableWithoutFeedback>
</ScrollView>
{/* </View> */}
</View>
</TouchableWithoutFeedback>
</ScrollView>
{/* </View> */}

{props.isTranslateScreen &&
<View style={[styles.spaceBetween, props.isFullDrawer && styles.full ]}>
<TouchableHighlight style={[styles.regularButton, styles.grayBackground]} onPress={props.retakePicture}>
Expand Down Expand Up @@ -403,9 +403,9 @@ const styles = StyleSheet.create({
backgroundColor: theme.colors.gray
},
regularButton: {
marginTop: 20,
paddingVertical: 16,
flex: 0.9,
marginTop: 16,
alignItems: 'center',
borderRadius: 16
},
Expand All @@ -430,7 +430,7 @@ const styles = StyleSheet.create({
backgroundColor: theme.colors.primary,
},
full: {
paddingBottom: 96
paddingBottom: Dimensions.get('window').height / Dimensions.get('window').width > 2 ? 96: 40
},
dropdown: {
height: 32,
Expand Down
48 changes: 24 additions & 24 deletions react-native/screens/TranslateScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,30 +135,30 @@ export default function TranslateScreen({ navigation }: Navigation) {
}

// TEST: mockup data
// setResults({
// fullText: [
// {id: 1, eid: -1, content: "1. Schedule of the closing ceremony and diploma presentation ceremony: Friday, January 4, 2019 at 9 o'clock for students to go to school.\n1) ", date: "", highlight: false, registered: false},
// {id: 2, eid: -1, content: "Closing ceremony", date: "2022-01-04", highlight: true, registered: false},
// {id: 3, eid: -1, content: ": 1st and 2nd graders, each classroom, 9:00-10:50 (no meals)\n2) ", date: "", highlight: false, registered: false},
// {id: 4, eid: -1, content: "Diploma representation ceremony", date: "2022-01-04", highlight: true, registered: true},
// {id: 5, eid: -1, content: ": 3rd grade, multi-purpose auditorium (2nd floor), 10:30-12:20\n2. School opening and entrance ceremony for new students: March 4th (Mon), 2019 at 9 o'clock for students to go to school.", date: "", highlight: false, registered: false},
// {id: 6, eid: -1, content: ": 3rd grade, multi-purpose auditorium (2nd floor), 10:30-12:20\n2. School opening and entrance ceremony for new students: March 4th (Mon), 2019 at 9 o'clock for students to go to school.", date: "", highlight: false, registered: false},
// ],
// korean: "가정통신문\n예당중학교\n8053-8388\n꿈은 크게. 마음은 넘게·\n행동은 바르게\n학부모님께\n희망찬 새해를 맞이하며 학부모님 가정에 건강과 행운이 함께 하시기를 기원 드립니다.\n드릴 말씀은, 2018학년도 종업식 및 졸업장 수여식과 2019학년도 개학 및 신입생 입학식을 다음과 같이 안내드리오니, 이후 3월 개학 때까지 학생들이 자기주도 학습 능력을 배양하고 다양한 체험 활동을 통하여 심신이 건강해지며 각종 유해 환경에 노출되지 않고 안전하고 줄거운 시간이 되도록 지도해 주시기 바랍니다.\n드릴 말씀은, 2018학년도 종업식 및 졸업장 수여식과 2019학년도 개학 및 신입생 입학식을 다음과 같이 안내드리오니, 이후 3월 개학 때까지 학생들이 자기주도 학습 능력을 배양하고 다양한 체험 활동을 통하여 심신이 건강해지며 각종 유해 환경에 노출되지 않고 안전하고 줄거운 시간이 되도록 지도해 주시기 바랍니다.",
// trans_full: "hello",
// event_num: 2,
// events: [
// {
// title: "opening ceremony",
// date: "2022-03-24"
// },
// {
// title: "closing ceremony",
// date: "2022-03-24"
// }
// ],
// title: "closing ceremony"
// });
setResults({
fullText: [
{id: 1, eid: -1, content: "1. Schedule of the closing ceremony and diploma presentation ceremony: Friday, January 4, 2019 at 9 o'clock for students to go to school.\n1) ", date: "", highlight: false, registered: false},
{id: 2, eid: -1, content: "Closing ceremony", date: "2022-01-04", highlight: true, registered: false},
{id: 3, eid: -1, content: ": 1st and 2nd graders, each classroom, 9:00-10:50 (no meals)\n2) ", date: "", highlight: false, registered: false},
{id: 4, eid: -1, content: "Diploma representation ceremony", date: "2022-01-04", highlight: true, registered: true},
{id: 5, eid: -1, content: ": 3rd grade, multi-purpose auditorium (2nd floor), 10:30-12:20\n2. School opening and entrance ceremony for new students: March 4th (Mon), 2019 at 9 o'clock for students to go to school.", date: "", highlight: false, registered: false},
{id: 6, eid: -1, content: ": 3rd grade, multi-purpose auditorium (2nd floor), 10:30-12:20\n2. School opening and entrance ceremony for new students: March 4th (Mon), 2019 at 9 o'clock for students to go to school.", date: "", highlight: false, registered: false},
],
korean: "가정통신문\n예당중학교\n8053-8388\n꿈은 크게. 마음은 넘게·\n행동은 바르게\n학부모님께\n희망찬 새해를 맞이하며 학부모님 가정에 건강과 행운이 함께 하시기를 기원 드립니다.\n드릴 말씀은, 2018학년도 종업식 및 졸업장 수여식과 2019학년도 개학 및 신입생 입학식을 다음과 같이 안내드리오니, 이후 3월 개학 때까지 학생들이 자기주도 학습 능력을 배양하고 다양한 체험 활동을 통하여 심신이 건강해지며 각종 유해 환경에 노출되지 않고 안전하고 줄거운 시간이 되도록 지도해 주시기 바랍니다.\n드릴 말씀은, 2018학년도 종업식 및 졸업장 수여식과 2019학년도 개학 및 신입생 입학식을 다음과 같이 안내드리오니, 이후 3월 개학 때까지 학생들이 자기주도 학습 능력을 배양하고 다양한 체험 활동을 통하여 심신이 건강해지며 각종 유해 환경에 노출되지 않고 안전하고 줄거운 시간이 되도록 지도해 주시기 바랍니다.",
trans_full: "hello",
event_num: 2,
events: [
{
title: "opening ceremony",
date: "2022-03-24"
},
{
title: "closing ceremony",
date: "2022-03-24"
}
],
title: "closing ceremony"
});
};

const handleKorean = (): void => {
Expand Down

0 comments on commit 30a1408

Please sign in to comment.