From 0c6c706274b5ba94ec771ae977ac28c507e5601e Mon Sep 17 00:00:00 2001 From: MariaZ Date: Mon, 19 Sep 2022 20:52:44 +0200 Subject: [PATCH] Add AppHelp component --- components/common/AppHelp.js | 33 +++++++++++++++++++++++++++++++++ styles/typography.js | 34 +++++++++++++++++++--------------- 2 files changed, 52 insertions(+), 15 deletions(-) create mode 100644 components/common/AppHelp.js diff --git a/components/common/AppHelp.js b/components/common/AppHelp.js new file mode 100644 index 0000000..4312483 --- /dev/null +++ b/components/common/AppHelp.js @@ -0,0 +1,33 @@ +import React from 'react' +import PropTypes from 'prop-types' +import { StyleSheet, View } from 'react-native' + +import AppText from '../common/app-text' + +import { Containers, Spacing, Typography } from '../../styles' + +const AppHelp = ({ text }) => ( + + * + {text} + +) + +AppHelp.propTypes = { + onClose: PropTypes.func.isRequired, + text: PropTypes.string.isRequired, +} + +const styles = StyleSheet.create({ + accentPurple: { + ...Typography.accentPurple, + alignSelf: 'flex-start', + paddingRight: Spacing.base, + }, + container: { + ...Containers.rowContainer, + padding: Spacing.base, + }, +}) + +export default AppHelp diff --git a/styles/typography.js b/styles/typography.js index 726b08b..628fc30 100644 --- a/styles/typography.js +++ b/styles/typography.js @@ -6,7 +6,7 @@ import Spacing from './spacing' export const fonts = { main: Platform.OS === 'ios' ? 'Jost-Book' : 'Jost-400-Book', - bold : Platform.OS === 'ios' ? 'Jost-Bold' : 'Jost-700-Bold', + bold: Platform.OS === 'ios' ? 'Jost-Bold' : 'Jost-700-Bold', } export const sizes = { @@ -23,7 +23,7 @@ export const sizes = { const accentText = { fontFamily: fonts.bold, textAlignVertical: 'center', - textTransform: 'uppercase' + textTransform: 'uppercase', } const accentTextBig = { @@ -43,47 +43,51 @@ const accentTextHuge = { const accentTextSmall = { ...accentText, - fontSize: sizes.small + fontSize: sizes.small, } const title = { color: Colors.purple, - marginVertical: Spacing.large + marginVertical: Spacing.large, } const label = { fontSize: sizes.small, - textTransform: 'uppercase' + textTransform: 'uppercase', } export default { accentOrange: { ...accentTextSmall, - color: Colors.orange + color: Colors.orange, + }, + accentPurple: { + ...accentTextSmall, + color: Colors.purple, }, accentPurpleBig: { ...accentTextBig, - color: Colors.purple + color: Colors.purple, }, accentPurpleGiant: { ...accentTextGiant, - color: Colors.purple + color: Colors.purple, }, accentPurpleHuge: { ...accentTextHuge, - color: Colors.purple + color: Colors.purple, }, mainText: { fontFamily: fonts.main, - fontSize: sizes.base + fontSize: sizes.base, }, label: { - ...label + ...label, }, labelBold: { color: Colors.greyDark, fontWeight: 'bold', - ...label + ...label, }, labelLight: { color: Colors.grey, @@ -91,7 +95,7 @@ export default { }, subtitle: { fontSize: sizes.subtitle, - ...title + ...title, }, title: { alignSelf: 'center', @@ -99,7 +103,7 @@ export default { fontWeight: '700', fontSize: sizes.title, marginHorizontal: Spacing.base, - ...title + ...title, }, titleWithoutMargin: { alignSelf: 'center', @@ -107,5 +111,5 @@ export default { fontFamily: fonts.bold, fontWeight: '700', fontSize: sizes.title, - } + }, }