@outerjoyn/react-native 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@outerjoyn/react-native",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "Drop-in loyalty SDK for React Native. Works in Expo Go.",
5
5
  "main": "src/index.ts",
6
6
  "react-native": "src/index.ts",
@@ -625,6 +625,40 @@ export const ConnectScreen: React.FC<ConnectScreenProps> = ({
625
625
  );
626
626
  };
627
627
 
628
+ // Plaid-style grid tile — default (no-search) picker view. Mirrors the web
629
+ // SDK ConnectWidget's institution-select grid; searching switches to the
630
+ // detailed renderInstitutionItem rows where linked/portable state helps
631
+ // disambiguate near-matches.
632
+ const renderGridItem = ({ item }: { item: Institution }) => {
633
+ const isLinked = linkedIds.has(item.institution_id) || providerLinkedNames.has(item.name.toLowerCase());
634
+ const isPortable = portableNames.has(item.name.toLowerCase());
635
+ return (
636
+ <Pressable
637
+ style={[s.gridTile, isLinked && s.gridTileLinked]}
638
+ onPress={() => handleSelectInstitution(item)}
639
+ accessibilityRole="button"
640
+ accessibilityLabel={isLinked ? `${item.name} (already connected)` : `Connect ${item.name}`}
641
+ >
642
+ {item.logo_url ? (
643
+ <Image source={{ uri: item.logo_url }} style={s.institutionLogo} resizeMode="contain" />
644
+ ) : (
645
+ <View style={[s.institutionLogoFallback, { backgroundColor: C.primary }]}>
646
+ <Text style={s.logoFallbackText}>{item.name.charAt(0).toUpperCase()}</Text>
647
+ </View>
648
+ )}
649
+ <Text style={s.gridTileName} numberOfLines={1}>
650
+ {item.name}
651
+ </Text>
652
+ {isLinked && (
653
+ <View style={[s.linkedBadge, { marginLeft: 0, marginTop: 6 }]}>
654
+ <Text style={s.linkedBadgeCheck}>{'✓'}</Text>
655
+ <Text style={s.linkedBadgeText}>{isPortable ? 'Portable' : t('connect.connected')}</Text>
656
+ </View>
657
+ )}
658
+ </Pressable>
659
+ );
660
+ };
661
+
628
662
  const renderSearch = () => (
629
663
  <View style={s.flex1}>
630
664
  {/* Header */}
@@ -684,11 +718,16 @@ export const ConnectScreen: React.FC<ConnectScreenProps> = ({
684
718
  </View>
685
719
  )}
686
720
 
687
- {/* Institution List */}
721
+ {/* Institution List — Plaid-style: 2-column brand grid by default,
722
+ detailed rows once the user types. `key` forces the remount
723
+ FlatList requires when numColumns changes. */}
688
724
  <FlatList
725
+ key={search.trim() === '' ? 'grid' : 'list'}
689
726
  data={filteredInstitutions}
690
727
  keyExtractor={(item) => item.institution_id}
691
- renderItem={renderInstitutionItem}
728
+ renderItem={search.trim() === '' ? renderGridItem : renderInstitutionItem}
729
+ numColumns={search.trim() === '' ? 2 : 1}
730
+ columnWrapperStyle={search.trim() === '' ? s.gridColumnWrapper : undefined}
692
731
  contentContainerStyle={s.listContent}
693
732
  showsVerticalScrollIndicator={false}
694
733
  keyboardShouldPersistTaps="handled"
@@ -1080,7 +1119,9 @@ const s = StyleSheet.create({
1080
1119
  paddingHorizontal: 14,
1081
1120
  height: 48,
1082
1121
  backgroundColor: '#F1F5F9',
1083
- borderRadius: 12,
1122
+ // Pill search — Plaid-style picker (parity with the web SDK ConnectWidget
1123
+ // + wallet-web ConnectModal, 2026-07-21).
1124
+ borderRadius: 999,
1084
1125
  borderWidth: 1,
1085
1126
  borderColor: C.border,
1086
1127
  },
@@ -1102,6 +1143,34 @@ const s = StyleSheet.create({
1102
1143
  paddingTop: 8,
1103
1144
  paddingBottom: 24,
1104
1145
  },
1146
+ // Plaid-style 2-column brand grid — the default (no-search) picker view;
1147
+ // typing a query switches to the detailed rows. Parity with the web SDK
1148
+ // ConnectWidget + wallet-web ConnectModal (2026-07-21).
1149
+ gridColumnWrapper: {
1150
+ gap: 10,
1151
+ },
1152
+ gridTile: {
1153
+ flex: 1,
1154
+ alignItems: 'center',
1155
+ paddingVertical: 16,
1156
+ paddingHorizontal: 10,
1157
+ marginBottom: 10,
1158
+ borderRadius: 16,
1159
+ borderWidth: 1,
1160
+ borderColor: C.border,
1161
+ backgroundColor: C.bg,
1162
+ },
1163
+ gridTileLinked: {
1164
+ borderColor: `${C.success}60`,
1165
+ backgroundColor: `${C.success}06`,
1166
+ },
1167
+ gridTileName: {
1168
+ fontSize: 12.5,
1169
+ fontWeight: '700',
1170
+ color: C.text,
1171
+ marginTop: 8,
1172
+ textAlign: 'center',
1173
+ },
1105
1174
  institutionRow: {
1106
1175
  flexDirection: 'row',
1107
1176
  alignItems: 'center',