11import React , { useEffect , useState , useContext } from 'react' ;
2- import {
3- View ,
4- StyleSheet ,
5- SafeAreaView ,
6- ScrollView ,
7- TouchableOpacity ,
8- } from 'react-native' ;
2+ import { View , StyleSheet , SafeAreaView , ScrollView , TouchableOpacity } from 'react-native' ;
93
104import styleBeck from '../../styles/beck' ;
115import Text from '../../components/MyText' ;
@@ -82,7 +76,7 @@ export default ({navigation, route}) => {
8276 } ) ;
8377 } ;
8478
85- const percentage = ( x ) => x && `${ x * 10 } %` ;
79+ const percentage = x => x && `${ x * 10 } %` ;
8680
8781 return (
8882 < SafeAreaView style = { styles . safe } >
@@ -99,9 +93,12 @@ export default ({navigation, route}) => {
9993 </ TouchableOpacity >
10094 </ View >
10195 </ View >
102- < ScrollView
103- style = { styles . container }
104- contentContainerStyle = { styles . scrollContainer } >
96+ { ! canEdit && (
97+ < View className = "bg-gray-100 p-3 mx-4 rounded-lg" >
98+ < Text className = "text-gray-600 text-center" > Les colonnes de Beck ne peuvent être modifiées après 30 jours</ Text >
99+ </ View >
100+ ) }
101+ < ScrollView style = { styles . container } contentContainerStyle = { styles . scrollContainer } >
105102 < View style = { styles . stepContainer } >
106103 < Text style = { styleBeck . sectionTitle } > { BeckStepTitles [ 0 ] } </ Text >
107104 { date && time ? (
@@ -118,58 +115,26 @@ export default ({navigation, route}) => {
118115 < ItemText title = "Description factuelle" value = { what } />
119116 < View style = { styleBeck . XSseparator } />
120117 < Text style = { styleBeck . sectionTitle } > { BeckStepTitles [ 2 ] } </ Text >
121- < ItemTag
122- title = "Émotion principale"
123- values = { mainEmotion }
124- intensity = { percentage ( mainEmotionIntensity ) }
125- />
118+ < ItemTag title = "Émotion principale" values = { mainEmotion } intensity = { percentage ( mainEmotionIntensity ) } />
126119 < ItemTag title = "Autres émotions" values = { otherEmotions } />
127120 < ItemTag title = "Sensations" values = { physicalSensations } />
128121 < View style = { styleBeck . XSseparator } />
129122 < Text style = { styleBeck . sectionTitle } > { BeckStepTitles [ 3 ] } </ Text >
130- < ItemText
131- title = "Pensée immédiate"
132- value = { thoughtsBeforeMainEmotion }
133- intensity = { percentage ( trustInThoughsThen ) }
134- />
123+ < ItemText title = "Pensée immédiate" value = { thoughtsBeforeMainEmotion } intensity = { percentage ( trustInThoughsThen ) } />
135124 < ItemText title = "Images et souvenirs" value = { memories } />
136125 < View style = { styleBeck . XSseparator } />
137126 < Text style = { styleBeck . sectionTitle } > { BeckStepTitles [ 4 ] } </ Text >
138- < ItemText title = "Qu’ avez vous fait ?" value = { actions } />
127+ < ItemText title = "Qu' avez vous fait ?" value = { actions } />
139128 < ItemText title = "Conséquences pour vous" value = { consequencesForYou } />
140- < ItemText
141- title = "Conséquences pour votre entourage"
142- value = { consequencesForRelatives }
143- />
129+ < ItemText title = "Conséquences pour votre entourage" value = { consequencesForRelatives } />
144130 < View style = { styleBeck . XSseparator } />
145131 < Text style = { styleBeck . sectionTitle } > { BeckStepTitles [ 5 ] } </ Text >
146- < ItemText
147- title = "Arguments en faveur de votre pensée"
148- value = { argumentPros }
149- />
150- < ItemText
151- title = "Arguments en défaveur de votre pensée"
152- value = { argumentCons }
153- />
154- < ItemText
155- title = "Pensée plus nuancée/adaptée"
156- value = { nuancedThoughts }
157- />
158- < ItemText
159- title = "Croyance dans la pensée principale"
160- value = { thoughtsBeforeMainEmotion }
161- intensity = { percentage ( trustInThoughsNow ) }
162- />
163- < ItemTag
164- title = "Émotions après coup"
165- values = { mainEmotion }
166- intensity = { percentage ( mainEmotionIntensityNuanced ) }
167- />
168- < Button
169- title = "Terminer"
170- onPress = { navigation . goBack }
171- buttonStyle = { styleBeck . submitButton }
172- />
132+ < ItemText title = "Arguments en faveur de votre pensée" value = { argumentPros } />
133+ < ItemText title = "Arguments en défaveur de votre pensée" value = { argumentCons } />
134+ < ItemText title = "Pensée plus nuancée/adaptée" value = { nuancedThoughts } />
135+ < ItemText title = "Croyance dans la pensée principale" value = { thoughtsBeforeMainEmotion } intensity = { percentage ( trustInThoughsNow ) } />
136+ < ItemTag title = "Émotions après coup" values = { mainEmotion } intensity = { percentage ( mainEmotionIntensityNuanced ) } />
137+ < Button title = "Terminer" onPress = { navigation . goBack } buttonStyle = { styleBeck . submitButton } />
173138 </ View >
174139 </ ScrollView >
175140 </ SafeAreaView >
@@ -187,11 +152,7 @@ const ItemText = ({title, value, intensity}) => {
187152 </ View >
188153 { intensity && (
189154 < View style = { styleBeck . listContainer } >
190- < TextTag
191- value = { intensity }
192- color = "#D3D7E4"
193- buttonStyle = { { marginBottom : 0 } }
194- />
155+ < TextTag value = { intensity } color = "#D3D7E4" buttonStyle = { { marginBottom : 0 } } />
195156 </ View >
196157 ) }
197158 </ View >
@@ -210,13 +171,7 @@ const ItemTag = ({title, values, intensity}) => {
210171 < TextTag key = { i } value = { e } color = "#D4F0F2" />
211172 ) ) }
212173 </ View >
213- { intensity && (
214- < TextTag
215- value = { intensity }
216- color = "#D3D7E4"
217- buttonStyle = { { marginBottom : 0 } }
218- />
219- ) }
174+ { intensity && < TextTag value = { intensity } color = "#D3D7E4" buttonStyle = { { marginBottom : 0 } } /> }
220175 </ View >
221176 </ View >
222177 ) ;
0 commit comments