Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
tyler-whitman committed Oct 28, 2024
1 parent 2a289a8 commit 6c232e2
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 16 deletions.
3 changes: 0 additions & 3 deletions jestSetup.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import mockRNDeviceInfo from 'react-native-device-info/jest/react-native-device-info-mock'
import { setUpTests } from './node_modules/react-native-reanimated/src/reanimated2/jestUtils'

setUpTests()

global.window = {}
global.window = global
Expand Down
2 changes: 1 addition & 1 deletion src/components/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const Button = ({
}

return (
<Box style={{ opacity: disabled ? 0.2 : 1 }} {...rest} height={height}>
<Box opacity={disabled ? 0.2 : 1} {...rest} height={height}>
<TouchableOpacityBox
height={height}
backgroundColor={getBackground()}
Expand Down
1 change: 0 additions & 1 deletion src/components/WordList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const WordList = ({ words, onPressWord }: Props) => {
duration: 300,
useNativeDriver: true,
}).start()
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [words])

return (
Expand Down
9 changes: 7 additions & 2 deletions src/features/hotspots/setup/HotspotLocationPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import React, {
import MapboxGL from '@rnmapbox/maps'
import Config from 'react-native-config'
import LocationIcon from '@assets/images/location-icon.svg'
import { StyleSheet } from 'react-native'
import { StyleProp, StyleSheet, ViewStyle } from 'react-native'
import Box from '../../../components/Box'
import Text from '../../../components/Text'
import ActivityIndicator from '../../../components/ActivityIndicator'
Expand Down Expand Up @@ -87,11 +87,16 @@ const HotspotLocationPreview = ({
[geocode, hasLocationName, locationName],
)

const mapStyles: StyleProp<ViewStyle> = useMemo(
() => ({ height: hasLocationName ? '75%' : '100%' }),
[hasLocationName],
)

return (
<Box borderRadius="l" overflow="hidden" height="100%">
<MapboxGL.MapView
ref={map}
style={{ height: hasLocationName ? '75%' : '100%' }}
style={mapStyles}
styleURL={Config.MAPBOX_STYLE_URL}
logoEnabled={false}
rotateEnabled={movable}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ const HotspotSetupBluetoothSuccess = () => {

const handleError = useCallback(
async (error: unknown) => {
// eslint-disable-next-line no-console
console.error(error)
let titleKey = 'generic.error'
let messageKey = 'generic.something_went_wrong'
Expand Down
22 changes: 14 additions & 8 deletions src/features/hotspots/setup/HotspotSetupEducationScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React, { useState, useRef, useCallback } from 'react'
import React, { useState, useRef, useCallback, useMemo } from 'react'
import { RouteProp, useNavigation, useRoute } from '@react-navigation/native'
import { useTranslation } from 'react-i18next'
import Carousel, { Pagination } from 'react-native-snap-carousel'
import { StyleProp, ViewStyle } from 'react-native'
import BackScreen from '../../../components/BackScreen'
import Box from '../../../components/Box'
import Text from '../../../components/Text'
Expand Down Expand Up @@ -73,6 +74,17 @@ const HotspotSetupEducationScreen = () => {
<CarouselItem item={item} />
)

const dotStyles: StyleProp<ViewStyle> = useMemo(
() => ({
width: 6,
height: 6,
borderRadius: 3,
marginHorizontal: spacing.s,
backgroundColor: colors.secondaryText,
}),
[colors.secondaryText, spacing.s],
)

return (
<BackScreen
hideBack
Expand Down Expand Up @@ -107,13 +119,7 @@ const HotspotSetupEducationScreen = () => {
<Pagination
dotsLength={slides.length}
activeDotIndex={slideIndex}
dotStyle={{
width: 6,
height: 6,
borderRadius: 3,
marginHorizontal: spacing.s,
backgroundColor: colors.secondaryText,
}}
dotStyle={dotStyles}
inactiveDotOpacity={0.4}
inactiveDotScale={1}
/>
Expand Down

0 comments on commit 6c232e2

Please sign in to comment.