Skip to content

Commit 91f67ff

Browse files
committed
Adds docs back
1 parent 34c1ca1 commit 91f67ff

File tree

2 files changed

+43
-4
lines changed

2 files changed

+43
-4
lines changed

src/components/Dial/RNDial.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,23 @@ import { ViewProps, setViewProps } from "../View/RNView";
33
import { RNWidget } from "../config";
44
import { throwUnsupported } from "../../utils/helpers";
55

6+
/**
7+
* The Dial provides ability to add and manipulate native dial slider widgets. It is based on
8+
* [NodeGui's QDial](https://docs.nodegui.org/docs/api/generated/classes/qdial/).
9+
* ## Example
10+
* ```javascript
11+
* import React from "react";
12+
* import { Renderer, Dial, Window } from "@nodegui/react-nodegui";
13+
* const App = () => {
14+
* return (
15+
* <Window>
16+
* <Dial />
17+
* </Window>
18+
* );
19+
* };
20+
* Renderer.render(<App />);
21+
* ```
22+
*/
623
export interface DialProps extends ViewProps<QDialSignals> {
724
notchesVisible?: boolean;
825
wrapping?: boolean;
@@ -23,7 +40,7 @@ const setDialProps = (
2340
},
2441
set notchTarget(notchTarget: number) {
2542
widget.setNotchTarget(notchTarget);
26-
}
43+
},
2744
};
2845
Object.assign(setter, newProps);
2946
setViewProps(widget, newProps, oldProps);

src/components/Image/RNImage.ts

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,35 @@ import {
44
AspectRatioMode,
55
NodeWidget,
66
QSize,
7-
TransformationMode
7+
TransformationMode,
88
} from "@nodegui/nodegui";
99
import { TextProps, setTextProps } from "../Text/RNText";
1010
import { RNWidget } from "../config";
1111
import { throwUnsupported, isValidUrl } from "../../utils/helpers";
1212
import phin from "phin";
1313

14+
/**
15+
* The Image component provides the ability to render images. It is based on
16+
* [NodeGui's QPixmap](https://docs.nodegui.org/docs/api/generated/classes/qpixmap).
17+
* ## Example
18+
* ```javascript
19+
* import React from "react";
20+
* import { Renderer, Image, Window } from "@nodegui/react-nodegui";
21+
* import { AspectRatioMode } from "@nodegui/nodegui";
22+
* const App = () => {
23+
* return (
24+
* <Window>
25+
* <Image
26+
* aspectRatioMode={AspectRatioMode.KeepAspectRatio}
27+
* size={{ height: 200, width: 150 }}
28+
* src="https://place-hold.it/200x150"
29+
* ></Image>
30+
* </Window>
31+
* );
32+
* };
33+
* Renderer.render(<App />);
34+
* ```
35+
*/
1436
export interface ImageProps extends TextProps {
1537
src?: string;
1638
aspectRatioMode?: AspectRatioMode;
@@ -29,7 +51,7 @@ const setImageProps = (
2951
return;
3052
}
3153
getLoadedPixmap(imageUrlOrPath)
32-
.then(pixmap => widget.setPixmap(pixmap))
54+
.then((pixmap) => widget.setPixmap(pixmap))
3355
.catch(console.warn);
3456
},
3557
set buffer(imageBuffer: Buffer) {
@@ -42,7 +64,7 @@ const setImageProps = (
4264
},
4365
set transformationMode(mode: TransformationMode) {
4466
widget.setTransformationMode(mode);
45-
}
67+
},
4668
};
4769
Object.assign(setter, newProps);
4870
setTextProps(widget, newProps, oldProps);

0 commit comments

Comments
 (0)