Skip to content

Commit 6801386

Browse files
committed
Bump expensify-common and update styling for short-mentions
1 parent 573c331 commit 6801386

File tree

7 files changed

+22
-86
lines changed

7 files changed

+22
-86
lines changed

ios/Podfile.lock

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2522,7 +2522,7 @@ PODS:
25222522
- RNGoogleSignin (10.0.1):
25232523
- GoogleSignIn (~> 7.0)
25242524
- React-Core
2525-
- RNLiveMarkdown (0.1.233):
2525+
- RNLiveMarkdown (0.1.234):
25262526
- DoubleConversion
25272527
- glog
25282528
- hermes-engine
@@ -2542,10 +2542,10 @@ PODS:
25422542
- ReactCodegen
25432543
- ReactCommon/turbomodule/bridging
25442544
- ReactCommon/turbomodule/core
2545-
- RNLiveMarkdown/newarch (= 0.1.233)
2545+
- RNLiveMarkdown/newarch (= 0.1.234)
25462546
- RNReanimated/worklets
25472547
- Yoga
2548-
- RNLiveMarkdown/newarch (0.1.233):
2548+
- RNLiveMarkdown/newarch (0.1.234):
25492549
- DoubleConversion
25502550
- glog
25512551
- hermes-engine
@@ -3292,8 +3292,8 @@ SPEC CHECKSUMS:
32923292
AirshipServiceExtension: 9c73369f426396d9fb9ff222d86d842fac76ba46
32933293
AppAuth: 501c04eda8a8d11f179dbe8637b7a91bb7e5d2fa
32943294
AppLogs: 3bc4e9b141dbf265b9464409caaa40416a9ee0e0
3295-
boost: 26992d1adf73c1c7676360643e687aee6dda994b
3296-
DoubleConversion: 76ab83afb40bddeeee456813d9c04f67f78771b5
3295+
boost: d7090b1a93a9798c029277a8288114f2948f471c
3296+
DoubleConversion: f16ae600a246532c4020132d54af21d0ddb2a385
32973297
EXAV: 9773c9799767c9925547b05e41a26a0240bb8ef2
32983298
EXImageLoader: 759063a65ab016b836f73972d3bb25404888713d
32993299
expensify-react-native-background-task: 6f797cf470b627912c246514b1631a205794775d
@@ -3313,11 +3313,11 @@ SPEC CHECKSUMS:
33133313
FirebaseInstallations: 40bd9054049b2eae9a2c38ef1c3dd213df3605cd
33143314
FirebasePerformance: 0c01a7a496657d7cea86d40c0b1725259d164c6c
33153315
FirebaseRemoteConfig: 2d6e2cfdb49af79535c8af8a80a4a5009038ec2b
3316-
fmt: 4c2741a687cc09f0634a2e2c72a838b99f1ff120
3316+
fmt: 10c6e61f4be25dc963c36bd73fc7b1705fe975be
33173317
ForkInputMask: 55e3fbab504b22da98483e9f9a6514b98fdd2f3c
33183318
FullStory: c8a10b2358c0d33c57be84d16e4c440b0434b33d
33193319
fullstory_react-native: 63a803cca04b0447a71daa73e4df3f7b56e1919d
3320-
glog: 69ef571f3de08433d766d614c73a9838a06bf7eb
3320+
glog: 08b301085f15bcbb6ff8632a8ebaf239aae04e6a
33213321
GoogleAppMeasurement: 5ba1164e3c844ba84272555e916d0a6d3d977e91
33223322
GoogleDataTransport: 6c09b596d841063d76d4288cc2d2f42cc36e1e2a
33233323
GoogleSignIn: d4281ab6cf21542b1cfaff85c191f230b399d2db
@@ -3343,7 +3343,7 @@ SPEC CHECKSUMS:
33433343
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
33443344
pusher-websocket-react-native: e40c49a1e4ec96d4157375aebcf44943f0f8f62f
33453345
PusherSwift: cad631bad86cfff4b8458dce1310a7774e469b1f
3346-
RCT-Folly: 4464f4d875961fce86008d45f4ecf6cef6de0740
3346+
RCT-Folly: bf5c0376ffe4dd2cf438dcf86db385df9fdce648
33473347
RCTDeprecation: 2c5e1000b04ab70b53956aa498bf7442c3c6e497
33483348
RCTRequired: 5f785a001cf68a551c5f5040fb4c415672dbb481
33493349
RCTTypeSafety: 6b98db8965005d32449605c0d005ecb4fee8a0f7
@@ -3433,7 +3433,7 @@ SPEC CHECKSUMS:
34333433
RNFS: 4ac0f0ea233904cb798630b3c077808c06931688
34343434
RNGestureHandler: 364e6862a112045bb5c5d35601f0bdb0304af979
34353435
RNGoogleSignin: ccaa4a81582cf713eea562c5dd9dc1961a715fd0
3436-
RNLiveMarkdown: 763a9c03a90435770c2d49f9e99a7fc72ea49552
3436+
RNLiveMarkdown: 79e0b13fd3d058a715d31e7ef65afa7287cdcae4
34373437
RNLocalize: d4b8af4e442d4bcca54e68fc687a2129b4d71a81
34383438
rnmapbox-maps: d184c8d3213acf4c97ec71fbbb6f9d4954552d80
34393439
RNPermissions: 0b1429b55af59d1d08b75a8be2459f65a8ac3f28

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
"date-fns-tz": "^3.2.0",
122122
"dom-serializer": "^0.2.2",
123123
"domhandler": "^4.3.0",
124-
"expensify-common": "2.0.115",
124+
"expensify-common": "2.0.124",
125125
"expo": "52.0.14",
126126
"expo-asset": "^11.0.1",
127127
"expo-av": "^15.0.1",

patches/expensify-common+2.0.115+001+TEMP-add-short-mentions.patch

Lines changed: 0 additions & 27 deletions
This file was deleted.

src/components/Search/SearchAutocompleteInput.tsx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -174,14 +174,6 @@ function SearchAutocompleteInput(
174174
[currentUserPersonalDetails.displayName, substitutionMap, currencySharedValue, categorySharedValue, tagSharedValue, emailListSharedValue],
175175
);
176176

177-
const additionalMarkdownStyle = useMemo(
178-
() => ({
179-
mentionHere: styles.br1,
180-
mentionUser: styles.br1,
181-
}),
182-
[styles.br1],
183-
);
184-
185177
const inputWidth = isFullWidth ? styles.w100 : {width: variables.popoverWidth};
186178

187179
// Parse Fullstory attributes on initial render
@@ -214,7 +206,6 @@ function SearchAutocompleteInput(
214206
enterKeyHint="search"
215207
accessibilityLabel={translate('search.searchPlaceholder')}
216208
disabled={disabled}
217-
markdownStyle={additionalMarkdownStyle}
218209
maxLength={CONST.SEARCH_QUERY_LIMIT}
219210
onSubmitEditing={onSubmit}
220211
shouldUseDisabledStyles={false}

src/components/TextInput/BaseTextInput/index.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,15 @@ function BaseTextInput(
8484
const InputComponent = InputComponentMap.get(type) ?? RNTextInput;
8585
const isMarkdownEnabled = type === 'markdown';
8686
const isAutoGrowHeightMarkdown = isMarkdownEnabled && autoGrowHeight;
87+
8788
const theme = useTheme();
8889
const styles = useThemeStyles();
89-
const {hasError = false, markdownStyle: propsMarkdownStyle} = inputProps;
90-
const markdownStyle = useMarkdownStyle(undefined, excludedMarkdownStyles, propsMarkdownStyle);
90+
const markdownStyle = useMarkdownStyle(undefined, excludedMarkdownStyles);
91+
const {hasError = false} = inputProps;
9192
const StyleUtils = useStyleUtils();
9293
const {translate} = useLocalize();
9394

94-
// Disabling this line for saftiness as nullish coalescing works only if value is undefined or null
95+
// Disabling this line for safeness as nullish coalescing works only if value is undefined or null
9596
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
9697
const initialValue = value || defaultValue || '';
9798
const initialActiveLabel = !!forceActiveLabel || initialValue.length > 0 || !!prefixCharacter || !!suffixCharacter;

src/hooks/useMarkdownStyle.ts

Lines changed: 4 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import useTheme from './useTheme';
77

88
const defaultEmptyArray: Array<keyof MarkdownStyle> = [];
99

10-
function useMarkdownStyle(message: string | null = null, excludeStyles: Array<keyof MarkdownStyle> = defaultEmptyArray, additionalStyles?: MarkdownStyle): MarkdownStyle {
10+
function useMarkdownStyle(message: string | null = null, excludeStyles: Array<keyof MarkdownStyle> = defaultEmptyArray): MarkdownStyle {
1111
const theme = useTheme();
1212
const hasMessageOnlyEmojis = message != null && message.length > 0 && containsOnlyEmojis(message);
1313
const emojiFontSize = hasMessageOnlyEmojis ? variables.fontSizeOnlyEmojis : variables.fontSizeEmojisWithinText;
@@ -67,10 +67,12 @@ function useMarkdownStyle(message: string | null = null, excludeStyles: Array<ke
6767
mentionHere: {
6868
color: theme.ourMentionText,
6969
backgroundColor: theme.ourMentionBG,
70+
borderRadius: variables.componentBorderRadiusSmall,
7071
},
7172
mentionUser: {
7273
color: theme.mentionText,
7374
backgroundColor: theme.mentionBG,
75+
borderRadius: variables.componentBorderRadiusSmall,
7476
},
7577
mentionReport: {
7678
color: theme.mentionText,
@@ -102,41 +104,10 @@ function useMarkdownStyle(message: string | null = null, excludeStyles: Array<ke
102104
});
103105
}
104106

105-
if (additionalStyles) {
106-
Object.keys(additionalStyles).forEach((key) => {
107-
if (!isValidStyleKey(styling, key)) {
108-
return;
109-
}
110-
111-
const style = getStyle(styling, key);
112-
const additionalStyle = getStyle(additionalStyles, key);
113-
114-
if (!style || !additionalStyle) {
115-
return;
116-
}
117-
118-
Object.keys(additionalStyle).forEach((styleKey) => {
119-
if (!isValidStyleKey(additionalStyle, styleKey)) {
120-
return;
121-
}
122-
123-
style[styleKey] = additionalStyle[styleKey];
124-
});
125-
});
126-
}
127-
128107
return styling;
129-
}, [theme, emojiFontSize, excludeStyles, nonStylingDefaultValues, additionalStyles]);
108+
}, [theme, emojiFontSize, excludeStyles, nonStylingDefaultValues]);
130109

131110
return markdownStyle;
132111
}
133112

134-
function isValidStyleKey<T extends MarkdownStyle>(obj: T, key: PropertyKey): key is keyof T {
135-
return key in obj;
136-
}
137-
138-
function getStyle<T extends MarkdownStyle, K extends keyof T>(obj: T, key: K): Record<string, unknown> | undefined {
139-
return obj[key] as Record<string, unknown> | undefined;
140-
}
141-
142113
export default useMarkdownStyle;

0 commit comments

Comments
 (0)