Skip to content

Commit

Permalink
add subtitle
Browse files Browse the repository at this point in the history
  • Loading branch information
OmerGery committed Jan 4, 2024
1 parent c2d94b9 commit ac5be57
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
3 changes: 1 addition & 2 deletions examples/client/Locomotion/src/Components/CardRow/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,7 @@ const CardRow = (paymentMethod: any) => {
if (isOfflinePaymentMethod(paymentMethod)) {
return offlinePaymentText;
}
return paymentMethod.doNotCapitalizeName ? paymentMethod.name
: capitalizeFirstLetter(paymentMethod.name);
return paymentMethod.name;
};

useEffect(() => {
Expand Down
4 changes: 3 additions & 1 deletion examples/client/Locomotion/src/Components/RideCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
import StopPointsVerticalView from '../StopPointsVerticalView';
import { getFormattedPrice, isPriceEstimated, convertTimezoneByLocation } from '../../context/newRideContext/utils';
import cashIcon from '../../assets/cash.svg';
import offlineIcon from '../../assets/offline.svg';
import { PAYMENT_METHODS } from '../../pages/Payments/consts';
import PaymentContext from '../../context/payments';
import SettingsContext from '../../context/settings';
Expand Down Expand Up @@ -56,12 +57,13 @@ const CardComponent = ({ paymentMethod, businessAccountId }: CardComponentProps)
return cashIcon;
}
if (isOffline) {
return null;
return offlineIcon;
}
};
return (
<TextRowWithIcon
text={getText() || ''}
subTitle={businessAccountId ? offlinePaymentText : ''}
Image={() => !isCash && !isOffline && <PaymentIcon type={paymentMethod.brand} />}
icon={getIcon()}
style={{ marginTop: 10, marginBottom: 10 }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useContext } from 'react';
import { Text, View } from 'react-native';
import styled, { ThemeContext } from 'styled-components';
import BusinessAccountText from '../BusinessAccountText';
import { FONT_SIZES } from '../../context/theme';
import SvgIcon from '../SvgIcon';

Expand Down Expand Up @@ -31,7 +32,7 @@ interface TextRowWithIconProps {
}

const TextRowWithIcon = ({
text, icon, style, Image, iconWidth, iconHeight,
subTitle, text, icon, style, Image, iconWidth, iconHeight,
}: TextRowWithIconProps) => {
const theme = useContext(ThemeContext);
const getImage = () => {
Expand All @@ -56,7 +57,13 @@ const TextRowWithIcon = ({
...((Image || icon) && { marginLeft: 10 }),
}}
>
{text}
{subTitle ? (
<BusinessAccountText
title={text}
subTitle={subTitle}
/>
)
: text}
</BasicText>
</Container>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import React from 'react';
import { View } from 'react-native';
import styled from 'styled-components';
import moment from 'moment';

import i18n from '../../../../I18n';
import Button from '../../../../Components/Button';
Expand Down

0 comments on commit ac5be57

Please sign in to comment.