@planningcenter/chat-react-native 4.6.2-qa-1076.0 → 4.6.2-rc.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/build/components/display/version_footer.d.ts.map +1 -1
- package/build/components/display/version_footer.js +36 -6
- package/build/components/display/version_footer.js.map +1 -1
- package/package.json +3 -3
- package/src/components/display/__tests__/version_footer.test.tsx +12 -1
- package/src/components/display/version_footer.tsx +17 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version_footer.d.ts","sourceRoot":"","sources":["../../../src/components/display/version_footer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"version_footer.d.ts","sourceRoot":"","sources":["../../../src/components/display/version_footer.tsx"],"names":[],"mappings":"AAOA,wBAAgB,aAAa,4CAkB5B"}
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { StyleSheet, View } from 'react-native';
|
|
2
|
+
import React, { useState } from 'react';
|
|
3
|
+
import { Pressable, StyleSheet, View } from 'react-native';
|
|
4
4
|
import { chatReactNativeVersion } from '../../utils/package_version';
|
|
5
5
|
import { Text } from './text';
|
|
6
6
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
const TAPS_TO_FIND = 5;
|
|
7
8
|
export function VersionFooter() {
|
|
8
|
-
const $ = _c(
|
|
9
|
+
const $ = _c(5);
|
|
10
|
+
const [taps, setTaps] = useState(0);
|
|
11
|
+
const found = taps >= TAPS_TO_FIND;
|
|
9
12
|
let t0;
|
|
10
13
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
11
|
-
t0 = /*#__PURE__*/_jsx(
|
|
12
|
-
|
|
14
|
+
t0 = /*#__PURE__*/_jsx(Pressable, {
|
|
15
|
+
accessible: false,
|
|
16
|
+
onPress: () => setTaps(_temp),
|
|
13
17
|
children: /*#__PURE__*/_jsxs(Text, {
|
|
14
18
|
variant: "footnote",
|
|
15
19
|
style: styles.text,
|
|
@@ -20,7 +24,33 @@ export function VersionFooter() {
|
|
|
20
24
|
} else {
|
|
21
25
|
t0 = $[0];
|
|
22
26
|
}
|
|
23
|
-
|
|
27
|
+
let t1;
|
|
28
|
+
if ($[1] !== found) {
|
|
29
|
+
t1 = found && /*#__PURE__*/_jsx(Text, {
|
|
30
|
+
variant: "footnote",
|
|
31
|
+
style: styles.text,
|
|
32
|
+
children: "\uD83C\uDF89 You found me! \uD83C\uDF89"
|
|
33
|
+
});
|
|
34
|
+
$[1] = found;
|
|
35
|
+
$[2] = t1;
|
|
36
|
+
} else {
|
|
37
|
+
t1 = $[2];
|
|
38
|
+
}
|
|
39
|
+
let t2;
|
|
40
|
+
if ($[3] !== t1) {
|
|
41
|
+
t2 = /*#__PURE__*/_jsxs(View, {
|
|
42
|
+
style: styles.container,
|
|
43
|
+
children: [t0, t1]
|
|
44
|
+
});
|
|
45
|
+
$[3] = t1;
|
|
46
|
+
$[4] = t2;
|
|
47
|
+
} else {
|
|
48
|
+
t2 = $[4];
|
|
49
|
+
}
|
|
50
|
+
return t2;
|
|
51
|
+
}
|
|
52
|
+
function _temp(count) {
|
|
53
|
+
return count + 1;
|
|
24
54
|
}
|
|
25
55
|
const styles = StyleSheet.create({
|
|
26
56
|
container: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version_footer.js","names":["React","StyleSheet","View","chatReactNativeVersion","Text","jsxs","_jsxs","jsx","_jsx","VersionFooter","$","_c","t0","Symbol","for","
|
|
1
|
+
{"version":3,"file":"version_footer.js","names":["React","useState","Pressable","StyleSheet","View","chatReactNativeVersion","Text","jsxs","_jsxs","jsx","_jsx","TAPS_TO_FIND","VersionFooter","$","_c","taps","setTaps","found","t0","Symbol","for","accessible","onPress","_temp","children","variant","style","styles","text","t1","t2","container","count","create","alignItems","paddingTop","paddingBottom","paddingHorizontal","textAlign"],"sources":["../../../src/components/display/version_footer.tsx"],"sourcesContent":["import React, { useState } from 'react'\nimport { Pressable, StyleSheet, View } from 'react-native'\nimport { chatReactNativeVersion } from '../../utils/package_version'\nimport { Text } from './text'\n\nconst TAPS_TO_FIND = 5\n\nexport function VersionFooter() {\n const [taps, setTaps] = useState(0)\n const found = taps >= TAPS_TO_FIND\n\n return (\n <View style={styles.container}>\n <Pressable accessible={false} onPress={() => setTaps(count => count + 1)}>\n <Text variant=\"footnote\" style={styles.text}>\n Chat v{chatReactNativeVersion}\n </Text>\n </Pressable>\n {found && (\n <Text variant=\"footnote\" style={styles.text}>\n 🎉 You found me! 🎉\n </Text>\n )}\n </View>\n )\n}\n\nconst styles = StyleSheet.create({\n container: {\n alignItems: 'center',\n paddingTop: 24,\n paddingBottom: 8,\n paddingHorizontal: 16,\n },\n text: {\n textAlign: 'center',\n },\n})\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,SAAS,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAC1D,SAASC,sBAAsB,QAAQ,6BAA6B;AACpE,SAASC,IAAI,QAAQ,QAAQ;AAAA,SAAAC,IAAA,IAAAC,KAAA,EAAAC,GAAA,IAAAC,IAAA;AAE7B,MAAMC,YAAY,GAAG,CAAC;AAEtB,OAAO,SAAAC,cAAA;EAAA,MAAAC,CAAA,GAAAC,EAAA;EACL,OAAAC,IAAA,EAAAC,OAAA,IAAwBf,QAAQ,CAAC,CAAC,CAAC;EACnC,MAAAgB,KAAA,GAAcF,IAAI,IAAIJ,YAAY;EAAA,IAAAO,EAAA;EAAA,IAAAL,CAAA,QAAAM,MAAA,CAAAC,GAAA;IAI9BF,EAAA,gBAAAR,IAAA,CAACR,SAAS;MAAamB,UAAK,EAAL,KAAK;MAAWC,OAAiC,EAAjCA,CAAA,KAAMN,OAAO,CAACO,KAAkB,CAAC;MAAAC,QAAA,eACtEhB,KAAA,CAACF,IAAI;QAASmB,OAAU,EAAV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-
"version": "4.6.2-
|
|
3
|
+
"version": "4.6.2-rc.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@fortawesome/fontawesome-svg-core": "^7.2.0",
|
|
35
35
|
"@fortawesome/react-native-fontawesome": "^0.3.2",
|
|
36
|
-
"@planningcenter/emoji-keyboard": "4.6.
|
|
36
|
+
"@planningcenter/emoji-keyboard": "4.6.0",
|
|
37
37
|
"lodash-inflection": "^1.5.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"sf-symbols-typescript": "^2.2.0",
|
|
85
85
|
"typescript": "~6.0.3"
|
|
86
86
|
},
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "db03d392fa89f3ec1bdbf7df0702dfadbd2ffdef"
|
|
88
88
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
|
|
2
|
-
import { render } from '@testing-library/react-native'
|
|
2
|
+
import { fireEvent, render } from '@testing-library/react-native'
|
|
3
3
|
import React from 'react'
|
|
4
4
|
import { buildTestQueryClient } from '../../../__utils__/query_client'
|
|
5
5
|
import { ChatProvider } from '../../../contexts/chat_context'
|
|
@@ -45,4 +45,15 @@ describe('VersionFooter', () => {
|
|
|
45
45
|
expect(packageVersion).toMatch(/^\d+\.\d+\.\d+/)
|
|
46
46
|
expect(getByText(`Chat v${packageVersion}`)).toBeTruthy()
|
|
47
47
|
})
|
|
48
|
+
|
|
49
|
+
it('says hello after five taps on the version', () => {
|
|
50
|
+
const { getByText, queryByText } = render(<VersionFooter />, { wrapper: Wrapper })
|
|
51
|
+
const version = getByText(`Chat v${packageVersion}`)
|
|
52
|
+
|
|
53
|
+
for (let i = 0; i < 4; i++) fireEvent.press(version)
|
|
54
|
+
expect(queryByText('🎉 You found me! 🎉')).toBeNull()
|
|
55
|
+
|
|
56
|
+
fireEvent.press(version)
|
|
57
|
+
expect(getByText('🎉 You found me! 🎉')).toBeTruthy()
|
|
58
|
+
})
|
|
48
59
|
})
|
|
@@ -1,14 +1,26 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { StyleSheet, View } from 'react-native'
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
import { Pressable, StyleSheet, View } from 'react-native'
|
|
3
3
|
import { chatReactNativeVersion } from '../../utils/package_version'
|
|
4
4
|
import { Text } from './text'
|
|
5
5
|
|
|
6
|
+
const TAPS_TO_FIND = 5
|
|
7
|
+
|
|
6
8
|
export function VersionFooter() {
|
|
9
|
+
const [taps, setTaps] = useState(0)
|
|
10
|
+
const found = taps >= TAPS_TO_FIND
|
|
11
|
+
|
|
7
12
|
return (
|
|
8
13
|
<View style={styles.container}>
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
14
|
+
<Pressable accessible={false} onPress={() => setTaps(count => count + 1)}>
|
|
15
|
+
<Text variant="footnote" style={styles.text}>
|
|
16
|
+
Chat v{chatReactNativeVersion}
|
|
17
|
+
</Text>
|
|
18
|
+
</Pressable>
|
|
19
|
+
{found && (
|
|
20
|
+
<Text variant="footnote" style={styles.text}>
|
|
21
|
+
🎉 You found me! 🎉
|
|
22
|
+
</Text>
|
|
23
|
+
)}
|
|
12
24
|
</View>
|
|
13
25
|
)
|
|
14
26
|
}
|