11import { Fiber } from "react-reconciler" ;
2- import { QDial , NodeWidget } from "@nodegui/nodegui" ;
3- import { ViewProps , setProps as setViewProps } from "../View" ;
2+ import { NodeWidget } from "@nodegui/nodegui" ;
43import { registerComponent , ComponentConfig } from "../config" ;
5-
6- export interface DialProps extends ViewProps {
7- notchesVisible ?: boolean ;
8- wrapping ?: boolean ;
9- notchTarget ?: number ;
10- }
11-
12- export const setProps = (
13- widget : QDial ,
14- newProps : DialProps ,
15- oldProps : DialProps
16- ) => {
17- const setter : DialProps = {
18- set notchesVisible ( notchesVisible : boolean ) {
19- widget . setNotchesVisible ( notchesVisible ) ;
20- } ,
21- set wrapping ( wrapping : boolean ) {
22- widget . setWrapping ( wrapping ) ;
23- } ,
24- set notchTarget ( notchTarget : number ) {
25- widget . setNotchTarget ( notchTarget ) ;
26- }
27- } ;
28- Object . assign ( setter , newProps ) ;
29- setViewProps ( widget , newProps , oldProps ) ;
30- } ;
31-
4+ import { RNDial , setProps , DialProps } from "./RNDial" ;
325class DialConfig extends ComponentConfig {
33- id = "dial" ;
6+ tagName = RNDial . tagName ;
347 shouldSetTextContent ( nextProps : object ) : boolean {
358 return true ;
369 }
@@ -40,7 +13,7 @@ class DialConfig extends ComponentConfig {
4013 context : any ,
4114 workInProgress : Fiber
4215 ) : NodeWidget {
43- const widget = new QDial ( ) ;
16+ const widget = new RNDial ( ) ;
4417 setProps ( widget , newProps , { } ) ;
4518 return widget ;
4619 }
@@ -51,7 +24,7 @@ class DialConfig extends ComponentConfig {
5124 newProps : object ,
5225 finishedWork : Fiber
5326 ) : void {
54- setProps ( instance as QDial , newProps , oldProps ) ;
27+ setProps ( instance as RNDial , newProps , oldProps ) ;
5528 }
5629}
5730
0 commit comments