MishaConfig + Refactoring
8 unresolved threads
8 unresolved threads
Merge request reports
Activity
Filter activity
20 20 load: flow(function* (deviceId: number) { 21 21 self.setStatus('pending') 22 22 const result: GetVehicleResult = yield self.environment.api.getVehicle(deviceId) 23 console.log('result',result) changed this line in version 3 of the diff
150 {item.Icon && <Forward />} 151 </View> 152 </TouchableHighlight> 153 ); 154 }} 155 ItemSeparatorComponent={Separator} 156 contentContainerStyle={styles.contentContainer} 157 ListFooterComponent={Footer} 158 showsVerticalScrollIndicator={false} 159 /> 160 <ExitConfirmationModal isVisible={exitConfirmModalVisible} hide={() => setExitConfirmModalVisible(false)} /> 161 </View> 162 ); 163 }); 144 164 145 165 function Separator() { 44 45 45 return () => { 46 if (timer) { 47 console.debug("unsubscribe device state", device?.id) 48 clearInterval(timer) 49 } 50 } 51 }, [device?.id]) 46 console.debug("Unsubscribe device state", deviceId); 47 clearInterval(interval); 48 }; 49 }, [deviceId]); 52 50 const isBeacon = device?.isBeacon 53 51 54 const deviceState:IDeviceState|undefined = id ? deviceStateStore.getItem(id) : undefined 52 const deviceState:IDeviceState|undefined = deviceId ? deviceStateStore.getItem(deviceId) : undefined 81 79 ].flat() 82 80 83 81 console.debug("features", features) 84 const cards = arrangeCards(features) ?? [] 85 console.debug("cards", cards) 86 const rowA = cards?.length > 0 ? cards[0] : undefined 87 const rowB = cards?.length > 1 ? cards[1] : undefined 88 const rowC = cards?.length > 2 ? cards[2] : undefined 89 90 const shift = rowA && !rowB && rowLoss1(rowA, 0) > rowLoss1(rowA, 1) 82 const cards = React.useMemo(() => arrangeCards(features) ?? [], [features]); 83 const [row0, row1, row2] = cards; changed this line in version 4 of the diff
34 34 useEffect(() => {rollAngleRef.current = rollAngle}, [rollAngle]) 35 35 const sensorSubscriptionRef = useRef<Subscription>() 36 36 useEffect(() => { 37 const sensor = sensors.accelerometer 38 sensorSubscriptionRef.current = sensor.subscribe({next: (values) => { 39 const sum = Math.sqrt([values.x, values.y, values.z].reduce((s, v) => s + v*v, 0)) 40 const sign = Platform.OS === 'ios' ? -1 : 1 41 const newVal = sign * Math.asin(values.x / sum) / Math.PI * 180 42 const weight = 0.1 43 const ra = rollAngleRef.current * (1 - weight) + newVal * weight 44 setRollAngle(Math.round(ra)) 45 // setError(`${Math.round(values.x)}, ${Math.round(values.y)}, ${Math.round(newVal)}, ${Math.round(rollAngleRef.current)}, ${ra}`) 46 }, error: (error) => setError(error)}) 37 const sensor = sensors.accelerometer; 38 sensorSubscriptionRef.current = sensor.subscribe({ 70 73 </Svg> 71 74 <Text style={{fontSize: getSize(13), fontWeight: '500', marginEnd: getSize(7), color: colors.contrastText[colorScheme]}}>{`${fuelLeft} / ${formatFuel(props.fuelTankCapacity)}`}</Text> 72 75 </View> 73 <Text style={{fontSize: getSize(13), fontWeight: '500', marginEnd: getSize(7), color: 'red', position: 'absolute'}}>{error}</Text> 76 <Text style={{fontSize: getSize(13), fontWeight: '500', marginEnd: getSize(7), color: 'red', position: 'absolute', top: '40%', textAlign: 'center', left: '5%'}}>{error}</Text> 81 months={MONTHS} 82 weekdays={dayNamesShortM} 83 allowRangeSelection={true} 84 maxRangeDuration={90} 85 selectedDayColor={colors.skyBlue} 86 selectedDayTextColor={'white'} 87 textStyle={[styles.calendarText, {color: colors.lighterContrastText[colorScheme]}]} 88 monthTitleStyle={[styles.calendarHeader, {color: colors.lighterContrastText[colorScheme]}]} 89 yearTitleStyle={[styles.calendarHeader, {color: colors.lighterContrastText[colorScheme]}]} 90 dayLabelsWrapper={styles.dayLabelsWrapper} 91 customDayHeaderStyles={()=>{return {textStyle: styles.dayOfWeek}}} 92 previousComponent={<Prev style={{color: colors.contrastText[colorScheme]}}/>} 93 nextComponent={<Next style={{color: colors.contrastText[colorScheme]}}/>} 94 /> 46 return ( 47 <View style={[styles.container, { paddingBottom: getSize(24) + insets.bottom, backgroundColor: colors.contrast[colorScheme] }]}> 51 <View style={styles.column}> 52 <View style={styles.titleContainer}> 53 {cost !== undefined && <Text style={[textStyles.cardTitle, {color: colors.contrastText[colorScheme]}]}>{`${Math.round(cost)} ₽`}</Text>} 54 {litres !== undefined && <Text style={[styles.litres]}>{formatFuel(litres)}</Text>} 55 <View style={styles.flex}/> 56 <TouchableOpacity style={styles.price} onPress={()=>setFuelPriceModalVisible(true)}> 57 <Edit style={{color: colors.journeyIcon}}/> 58 <Text style={styles.priceText}>{priceText}</Text> 59 </TouchableOpacity> 47 const firstDay = props.reports.startDate.getDay(); 48 const days = WEEK_DAYS.map(day => day.toUpperCase()); 49 50 const [fuelPriceModalVisible, setFuelPriceModalVisible] = React.useState(false); 51 52 return ( 53 <View style={[styles.card, { backgroundColor: colors.cardBackground[colorScheme] }]}> То же самое, как будто можно декомпозировать на более мелкие компоненты
Edited by Родион Хорошев
added 8 commits
-
78b7b1f9...1f9933f2 - 6 commits from branch
task#57528
- 3ec613e2 - Merge branch 'task#57528' into mishaConfig
- afbbeda7 - commit
-
78b7b1f9...1f9933f2 - 6 commits from branch
mentioned in commit 2841869c
Please register or sign in to reply