Skip to content

Commit

Permalink
chore: 버튼 roundness 10 전역 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
potados99 committed Oct 3, 2021
1 parent 8485541 commit a3fcf65
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 47 deletions.
14 changes: 10 additions & 4 deletions src/presentation/components/utils/PaperPresets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,24 @@ const wideButton: typeof Button.defaultProps = {

const wideThemedButton: typeof Button.defaultProps = {
contentStyle: {
paddingVertical: 4,
paddingVertical: 6,
},
theme: {
roundness: 10,
},
labelStyle: {color: 'white', fontSize: 18},
labelStyle: {color: 'white', fontSize: 16},
color: colors.mainTint,
mode: 'contained',
};

const wideNeutralButton: typeof Button.defaultProps = {
contentStyle: {
paddingVertical: 4,
paddingVertical: 6,
},
theme: {
roundness: 10,
},
labelStyle: {color: colors.textSecondary, fontSize: 18},
labelStyle: {color: colors.textSecondary, fontSize: 16},
color: colors.neutralGray,
mode: 'contained',
};
Expand Down
2 changes: 1 addition & 1 deletion src/presentation/features/booking/History/BookingItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

import React, {useEffect, useState} from 'react';
import palette from '../../../res/palette';
import CardView from '../../../components/CardView';
import {Button} from 'react-native-paper';
Expand All @@ -29,6 +28,7 @@ import handleApiError from '../../../../common/utils/handleApiError';
import useScreenBrightness from '../../../hooks/useScreenBrightness';
import {cancelBookingAlert} from '../../../components/utils/alert';
import {StyleSheet, Text, View} from 'react-native';
import React, {useEffect, useState} from 'react';

type Props = {
booking: BookingView;
Expand Down
3 changes: 3 additions & 0 deletions src/presentation/features/login/UserStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ export default class UserStore {

private _isAgreementRequired: boolean = false;
get isAgreementRequired() {
// Getter는 안 쓰지만,
// MainModal에서 _isAgreementRequired를 사용함.
// 지우면 안됨!
return this._isAgreementRequired;
}
set isAgreementRequired(value) {
Expand Down
78 changes: 36 additions & 42 deletions src/presentation/features/support/Contacts/ContactItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ import colors from '../../../res/colors';
import palette from '../../../res/palette';
import {Button} from 'react-native-paper';
import CardView from '../../../components/CardView';
import {Image, ImageSourcePropType, Text, ViewProps} from 'react-native';
import {Image, ImageSourcePropType, StyleSheet, Text, ViewProps} from 'react-native';
import PaperPresets from '../../../components/utils/PaperPresets';

type Props = ViewProps & {
imageSource: ImageSourcePropType;
Expand All @@ -32,50 +33,43 @@ type Props = ViewProps & {
action: () => void;
};

export default function ContactItem({
imageSource,
title,
body,
buttonText,
action,
}: Props) {
export default function ContactItem({imageSource, title, body, buttonText, action}: Props) {
return (
<CardView
style={{
marginHorizontal: 16,
marginTop: 21,
padding: 16,
flexDirection: 'column',
alignItems: 'center',
}}>
<Image
resizeMode="contain"
style={{height: 37, marginVertical: 8}}
source={imageSource}
/>
<Text style={[palette.textSubHeader, {marginTop: 12}]}>{title}</Text>
<Text
style={[
palette.textSecondary,
{
marginTop: 8,
textAlign: 'center',
marginHorizontal: 12,
},
]}>
{body}
</Text>
<Button
mode="contained"
labelStyle={[
palette.textPrimary,
{color: colors.white, paddingVertical: 4},
]}
color={colors.mainTint}
onPress={action}
style={{alignSelf: 'stretch', marginTop: 21}}>
<CardView style={styles.container}>
<Image resizeMode="contain" style={styles.image} source={imageSource} />
<Text style={styles.title}>{title}</Text>
<Text style={styles.body}>{body}</Text>
<Button {...PaperPresets.wideThemedButton} onPress={action} style={styles.button}>
{buttonText}
</Button>
</CardView>
);
}

const styles = StyleSheet.create({
container: {
marginHorizontal: 16,
marginTop: 21,
padding: 16,
flexDirection: 'column',
alignItems: 'center',
},
image: {
height: 37,
marginVertical: 8,
},
title: {
...palette.textSubHeader,
marginTop: 12,
},
body: {
...palette.textSecondary,
marginTop: 8,
textAlign: 'center',
marginHorizontal: 12,
},
button: {
alignSelf: 'stretch',
marginTop: 21,
},
});
1 change: 1 addition & 0 deletions src/presentation/features/support/Main/ContactsButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ const styles = StyleSheet.create({
justifyContent: 'center',
width: 36,
height: 36,
paddingTop: 2, // 미세한 높이 틀어짐 있음.
},
rightContainer: {
flex: 1,
Expand Down

0 comments on commit a3fcf65

Please sign in to comment.