Skip to content

Commit

Permalink
feat: putting theme in fontWeight bold and normal (#1061)
Browse files Browse the repository at this point in the history
Signed-off-by: Caroline Lucas Calheirani <[email protected]>
  • Loading branch information
CarolineLCa authored Jan 29, 2024
1 parent 966fedf commit 4bbf7c6
Show file tree
Hide file tree
Showing 40 changed files with 119 additions and 222 deletions.
3 changes: 1 addition & 2 deletions packages/legacy/core/App/components/chat/ActionSlider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ const ActionSlider: React.FC<Props> = ({ actions, onDismiss }) => {
elevation: 5,
},
drawerTitleText: {
...TextTheme.normal,
fontWeight: 'bold',
...TextTheme.bold,
textAlign: 'center',
marginVertical: 10,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,8 @@ const NotificationListItem: React.FC<NotificationListItemProps> = ({ notificatio
paddingBottom: 5,
},
headerText: {
...TextTheme.normal,
...TextTheme.bold,
flexGrow: 1,
fontWeight: 'bold',
alignSelf: 'center',
flex: 1,
},
Expand Down
11 changes: 4 additions & 7 deletions packages/legacy/core/App/components/misc/CredentialCard11.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ const CredentialCard11: React.FC<CredentialCard11Props> = ({
},
credActionText: {
fontSize: 20,
fontWeight: 'bold',
fontWeight: TextTheme.bold.fontWeight,
color: ColorPallet.brand.link,
},
})
Expand Down Expand Up @@ -298,10 +298,9 @@ const CredentialCard11: React.FC<CredentialCard11Props> = ({
) : (
<Text
style={[
TextTheme.normal,
TextTheme.bold,
{
fontSize: 0.5 * logoHeight,
fontWeight: 'bold',
alignSelf: 'center',
color: '#000',
},
Expand Down Expand Up @@ -346,11 +345,10 @@ const CredentialCard11: React.FC<CredentialCard11Props> = ({
) : (
<Text
style={[
TextTheme.normal,
TextTheme.bold,
styles.textContainer,
{
lineHeight: 24,
fontWeight: 'bold',
},
{ color: warn ? ColorPallet.notification.warnText : styles.textContainer.color },
]}
Expand Down Expand Up @@ -432,10 +430,9 @@ const CredentialCard11: React.FC<CredentialCard11Props> = ({
<Text
testID={testIdWithKey('CredentialName')}
style={[
TextTheme.normal,
TextTheme.bold,
styles.textContainer,
{
fontWeight: 'bold',
lineHeight: 24,
flex: 1,
flexWrap: 'wrap',
Expand Down
5 changes: 2 additions & 3 deletions packages/legacy/core/App/components/misc/InfoBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,9 @@ const InfoBox: React.FC<BifoldErrorProps> = ({
flexGrow: 0,
},
headerText: {
...TextTheme.normal,
...TextTheme.bold,
marginLeft: 7,
flexShrink: 1,
fontWeight: 'bold',
alignSelf: 'center',
color: ColorPallet.notification.infoText,
},
Expand All @@ -91,7 +90,7 @@ const InfoBox: React.FC<BifoldErrorProps> = ({
},
showDetailsText: {
...TextTheme.title,
fontWeight: 'normal',
fontWeight: TextTheme.normal.fontWeight,
color: ColorPallet.brand.link,
},
})
Expand Down
4 changes: 2 additions & 2 deletions packages/legacy/core/App/components/misc/ScanTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interface ScanTabProps {
}

const ScanTab: React.FC<ScanTabProps> = ({ onPress, active, iconName, title }) => {
const { TabTheme } = useTheme()
const { TabTheme, TextTheme } = useTheme()
const { fontScale } = useWindowDimensions()
const showLabels = fontScale * TabTheme.tabBarTextStyle.fontSize < 18

Expand All @@ -24,7 +24,7 @@ const ScanTab: React.FC<ScanTabProps> = ({ onPress, active, iconName, title }) =
text: {
...TabTheme.tabBarTextStyle,
color: active ? TabTheme.tabBarActiveTintColor : TabTheme.tabBarInactiveTintColor,
fontWeight: active ? 'bold' : 'normal',
fontWeight: active ? TextTheme.bold.fontWeight : TextTheme.normal.fontWeight,
},
})
return (
Expand Down
7 changes: 3 additions & 4 deletions packages/legacy/core/App/components/misc/SharedProofData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ const SharedDataCard: React.FC<{ sharedData: GroupedSharedProofDataItem }> = ({
},
attributeName: {
fontSize: 16,
fontWeight: 'normal',
fontWeight: TextTheme.normal.fontWeight,
color: ColorPallet.grayscale.black,
},
attributeValue: {
fontSize: 18,
fontWeight: 'bold',
fontWeight: TextTheme.bold.fontWeight,
color: ColorPallet.grayscale.black,
},
})
Expand Down Expand Up @@ -161,10 +161,9 @@ const SharedDataCard: React.FC<{ sharedData: GroupedSharedProofDataItem }> = ({
) : (
<Text
style={[
TextTheme.normal,
TextTheme.bold,
{
fontSize: 0.5 * logoHeight,
fontWeight: 'bold',
alignSelf: 'center',
color: ColorPallet.grayscale.black,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ const AppGuideModal: React.FC<AppGuideModalProps> = ({
},
headerText: {
...TextTheme.headingThree,
fontWeight: 'bold',
alignSelf: 'flex-start',
flexWrap: 'wrap',
color: ColorPallet.notification.infoText,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const Dropdown: React.FC<RemoveProps> = ({ title, content }) => {
},
]}
>
<Text style={[TextTheme.modalNormal, { fontWeight: 'bold' }]}>{title}</Text>
<Text style={[TextTheme.modalNormal, { fontWeight: TextTheme.bold.fontWeight }]}>{title}</Text>
<Icon name={isCollapsed ? 'expand-more' : 'expand-less'} size={24} color={TextTheme.modalNormal.color} />
</TouchableOpacity>
<Collapsible collapsed={isCollapsed} enablePointerEvents={true}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ const DismissiblePopupModal: React.FC<DismissiblePopupModalProps> = ({
flexGrow: 1,
},
headerText: {
...TextTheme.normal,
fontWeight: 'bold',
...TextTheme.bold,
alignSelf: 'flex-start',
color: ColorPallet.notification.infoText,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ const NotificationModal: React.FC<NotificationModalProps> = ({
</View>
) : null}
<View style={styles.childContainer}>
<Text style={[TextTheme.headingThree, { fontWeight: 'normal', textAlign: 'center' }]}>{title}</Text>
<Text style={[TextTheme.headingThree, { fontWeight: TextTheme.normal.fontWeight, textAlign: 'center' }]}>
{title}
</Text>
{children}
</View>
{doneVisible ? (
Expand Down
5 changes: 1 addition & 4 deletions packages/legacy/core/App/components/record/RecordField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,7 @@ const RecordField: React.FC<RecordFieldProps> = ({
{fieldLabel ? (
fieldLabel(field)
) : (
<Text
style={[ListItems.recordAttributeLabel, { fontWeight: 'bold' }]}
testID={testIdWithKey('AttributeName')}
>
<Text style={[ListItems.recordAttributeLabel]} testID={testIdWithKey('AttributeName')}>
{field.label ?? startCase(field.name || '')}
</Text>
)}
Expand Down
3 changes: 1 addition & 2 deletions packages/legacy/core/App/components/texts/InfoTextBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ const InfoTextBox: React.FC<TextBoxProps> = ({ children }) => {
alignItems: 'center',
},
textContainer: {
...TextTheme.normal,
...TextTheme.bold,
color: ColorPallet.notification.infoText,
fontWeight: 'bold',
alignSelf: 'center',
flexShrink: 1,
},
Expand Down
2 changes: 1 addition & 1 deletion packages/legacy/core/App/components/toast/BaseToast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const BaseToast: React.FC<BaseToastProps> = ({ title, body, toastType, onPress =
marginHorizontal: 15,
},
title: {
fontWeight: 'bold',
fontWeight: TextTheme.bold.fontWeight,
},
body: {
marginTop: 10,
Expand Down
4 changes: 1 addition & 3 deletions packages/legacy/core/App/components/tour/TourBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ export function TourBox(props: TourBoxProps): ReactElement {
},
headerText: {
...TextTheme.headingThree,
fontWeight: 'bold',
alignSelf: 'flex-start',
color: ColorPallet.notification.infoText,
},
Expand All @@ -116,9 +115,8 @@ export function TourBox(props: TourBoxProps): ReactElement {
justifyContent: 'space-around',
},
navText: {
...TextTheme.normal,
...TextTheme.bold,
color: ColorPallet.brand.primary,
fontWeight: 'bold',
},
pagerContainer: {
flexDirection: 'row',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@ const FauxNavigationBar: React.FC<FauxNavigationBarProps> = ({ title, onHomeTouc
justifyContent: 'space-between',
},
label: {
...TextTheme.normal,
...TextTheme.bold,
color: ColorPallet.brand.headerText,
fontSize: 17,
fontWeight: 'bold',
flexGrow: 1,
textAlign: 'center',
paddingBottom: 12,
Expand Down
10 changes: 5 additions & 5 deletions packages/legacy/core/App/components/views/HomeFooterView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const HomeFooterView: React.FC<HomeFooterViewProps> = ({ children }) => {
...useCredentialByState(CredentialState.Done),
]
const notifications = useNotifications()
const { HomeTheme } = useTheme()
const { HomeTheme, TextTheme } = useTheme()
const { t } = useTranslation()
const styles = StyleSheet.create({
container: {
Expand All @@ -45,15 +45,15 @@ const HomeFooterView: React.FC<HomeFooterViewProps> = ({ children }) => {
if (credentialCount === 1) {
credentialMsg = (
<Text>
{t('Home.YouHave')} <Text style={{ fontWeight: 'bold' }}>{credentialCount}</Text> {t('Home.Credential')}{' '}
{t('Home.InYourWallet')}
{t('Home.YouHave')} <Text style={{ fontWeight: TextTheme.bold.fontWeight }}>{credentialCount}</Text>{' '}
{t('Home.Credential')} {t('Home.InYourWallet')}
</Text>
)
} else if (credentialCount > 1) {
credentialMsg = (
<Text>
{t('Home.YouHave')} <Text style={{ fontWeight: 'bold' }}>{credentialCount}</Text> {t('Home.Credentials')}{' '}
{t('Home.InYourWallet')}
{t('Home.YouHave')} <Text style={{ fontWeight: TextTheme.bold.fontWeight }}>{credentialCount}</Text>{' '}
{t('Home.Credentials')} {t('Home.InYourWallet')}
</Text>
)
} else {
Expand Down
6 changes: 3 additions & 3 deletions packages/legacy/core/App/navigators/TabStack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const TabStack: React.FC = () => {
const { t } = useTranslation()
const Tab = createBottomTabNavigator<TabStackParams>()
const { assertConnectedNetwork } = useNetwork()
const { ColorPallet, TabTheme } = useTheme()
const { ColorPallet, TabTheme, TextTheme } = useTheme()
const [orientation, setOrientation] = useState(OrientationType.PORTRAIT)
const showLabels = fontScale * TabTheme.tabBarTextStyle.fontSize < 18
const styles = StyleSheet.create({
Expand Down Expand Up @@ -74,7 +74,7 @@ const TabStack: React.FC = () => {
style={{
...TabTheme.tabBarTextStyle,
color: focused ? TabTheme.tabBarActiveTintColor : TabTheme.tabBarInactiveTintColor,
fontWeight: focused ? 'bold' : 'normal',
fontWeight: focused ? TextTheme.bold.fontWeight : TextTheme.normal.fontWeight,
}}
>
{t('TabStack.Home')}
Expand Down Expand Up @@ -189,7 +189,7 @@ const TabStack: React.FC = () => {
style={{
...TabTheme.tabBarTextStyle,
color: focused ? TabTheme.tabBarActiveTintColor : TabTheme.tabBarInactiveTintColor,
fontWeight: focused ? 'bold' : 'normal',
fontWeight: focused ? TextTheme.bold.fontWeight : TextTheme.normal.fontWeight,
}}
>
{t('TabStack.Credentials')}
Expand Down
3 changes: 1 addition & 2 deletions packages/legacy/core/App/screens/AttemptLockout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,8 @@ const AttemptLockout: React.FC = () => {
textAlign: 'center',
},
countDown: {
...TextTheme.normal,
...TextTheme.bold,
textAlign: 'center',
fontWeight: 'bold',
},
image: {
width: 150,
Expand Down
2 changes: 1 addition & 1 deletion packages/legacy/core/App/screens/Connection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const Connection: React.FC<ConnectionProps> = ({ navigation, route }) => {
alignItems: 'center',
},
messageText: {
fontWeight: 'normal',
fontWeight: TextTheme.normal.fontWeight,
textAlign: 'center',
marginTop: 30,
},
Expand Down
4 changes: 2 additions & 2 deletions packages/legacy/core/App/screens/CredentialOffer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const CredentialOffer: React.FC<CredentialOfferProps> = ({ navigation, route })

const { agent } = useAppAgent()
const { t, i18n } = useTranslation()
const { ListItems, ColorPallet } = useTheme()
const { TextTheme, ColorPallet } = useTheme()
const { RecordLoading } = useAnimatedComponents()
const { assertConnectedNetwork } = useNetwork()
const { OCABundleResolver, enableTours: enableToursConfig } = useConfiguration()
Expand All @@ -71,7 +71,7 @@ const CredentialOffer: React.FC<CredentialOfferProps> = ({ navigation, route })
paddingVertical: 16,
},
headerText: {
...ListItems.recordAttributeLabel,
...TextTheme.normal,
flexShrink: 1,
},
footerButton: {
Expand Down
1 change: 0 additions & 1 deletion packages/legacy/core/App/screens/CredentialOfferAccept.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ const CredentialOfferAccept: React.FC<CredentialOfferAcceptProps> = ({ visible,
alignItems: 'center',
},
messageText: {
fontWeight: 'normal',
textAlign: 'center',
marginTop: 30,
},
Expand Down
3 changes: 1 addition & 2 deletions packages/legacy/core/App/screens/Developer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@ const Developer: React.FC = () => {
alignItems: 'center',
},
settingLabelText: {
...TextTheme.normal,
...TextTheme.bold,
marginRight: 10,
textAlign: 'left',
fontWeight: 'bold',
},
settingSwitchContainer: {
justifyContent: 'center',
Expand Down
2 changes: 0 additions & 2 deletions packages/legacy/core/App/screens/OnboardingPages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ export const createCarouselStyle = (OnboardingTheme: any): OnboardingStyleSheet
},
pagerNavigationButton: {
...OnboardingTheme.pagerNavigationButton,
fontSize: 18,
fontWeight: 'bold',
},
})
}
Expand Down
2 changes: 1 addition & 1 deletion packages/legacy/core/App/screens/PINCreate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ const PINCreate: React.FC<PINCreateProps> = ({ setAuthenticated, route }) => {
<View style={style.screenContainer}>
<View style={style.contentContainer}>
<Text style={[TextTheme.normal, { marginBottom: 16 }]}>
<Text style={{ fontWeight: 'bold' }}>
<Text style={{ fontWeight: TextTheme.bold.fontWeight }}>
{updatePin ? t('PINCreate.RememberChangePIN') : t('PINCreate.RememberPIN')}
</Text>{' '}
{t('PINCreate.PINDisclaimer')}
Expand Down
Loading

0 comments on commit 4bbf7c6

Please sign in to comment.