Lines Matching refs:state
32 function reducer(state: State, action: Partial<State>): State {
34 ...state,
61 const [state, dispatch] = React.useReducer(reducer, initialState);
66 dispatch({ alerting: !state.alerting });
85 state.type === BarCodeScanner.Constants.Type.back
92 if (state.alerting) {
105 const toggleText = () => dispatch({ showText: !state.showText });
107 const toggleBoundingBox = () => dispatch({ showBoundingBox: !state.showBoundingBox });
116 const circles = (state.cornerPoints || []).map((point, index) => (
139 type={state.type}
143 {state.haveDimensions && (
144 <Svg.Svg height={state.canvasHeight} width={state.canvasWidth} style={styles.svg}>
146 cx={state.canvasWidth! / 2}
147 cy={state.canvasHeight! / 2}
153 {state.showBoundingBox && state.cornerPointsString && (
155 points={state.cornerPointsString}
161 {state.showText && state.boundingBox && (
166 x={state.boundingBox.origin.x}
167 y={state.boundingBox.origin.y - 8}>
168 {state.data}
182 color={state.showBoundingBox ? undefined : BUTTON_COLOR}
187 color={state.showText ? undefined : BUTTON_COLOR}
192 color={state.alerting ? undefined : BUTTON_COLOR}