Skip to content

Commit 3559026

Browse files
committed
Use hooks
1 parent 4bd60d9 commit 3559026

32 files changed

Lines changed: 65 additions & 77 deletions

__tests__/html2/provider/InjectStylesElementsComposer/changeNonce.html renamed to __tests__/html2/hooks/useInjectStylesElements/changeNonce.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
testHelpers: { createDirectLineEmulator },
1818
WebChat: {
1919
Components: { ThemeProvider },
20-
internal: { InjectStyleElementsComposer }
20+
internal: { useInjectStyleElements }
2121
}
2222
} = window;
2323

@@ -44,7 +44,7 @@
4444
new Promise(resolve =>
4545
ReactDOM.render(
4646
<ThemeProvider styleOptions={stylesRoot ? { stylesRoot } : {}}>
47-
<InjectStyleElementsComposer nonce={nonce} styleElements={styleElements} />
47+
<RunFunction fn={() => resolve(useInjectStyleElements({ nonce, styleElements }))} />
4848
</ThemeProvider>,
4949
document.getElementById('webchat'),
5050
resolve

__tests__/html2/provider/InjectStylesElementsComposer/changeNonce.html.snap-1.png renamed to __tests__/html2/hooks/useInjectStylesElements/changeNonce.html.snap-1.png

File renamed without changes.

__tests__/html2/provider/InjectStylesElementsComposer/changeNonce.html.snap-2.png renamed to __tests__/html2/hooks/useInjectStylesElements/changeNonce.html.snap-2.png

File renamed without changes.

__tests__/html2/provider/InjectStylesElementsComposer/changeRoot.html renamed to __tests__/html2/hooks/useInjectStylesElements/changeRoot.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
testHelpers: { createDirectLineEmulator },
1717
WebChat: {
1818
Components: { ThemeProvider },
19-
internal: { InjectStyleElementsComposer }
19+
internal: { useInjectStyleElements }
2020
}
2121
} = window;
2222

@@ -42,7 +42,7 @@
4242
new Promise(resolve =>
4343
ReactDOM.render(
4444
<ThemeProvider styleOptions={stylesRoot ? { stylesRoot } : {}}>
45-
<InjectStyleElementsComposer nonce={nonce} styleElements={styleElements} />
45+
<RunFunction fn={() => resolve(useInjectStyleElements({ nonce, styleElements }))} />
4646
</ThemeProvider>,
4747
document.getElementById('webchat'),
4848
resolve

__tests__/html2/provider/InjectStylesElementsComposer/changeRoot.html.snap-1.png renamed to __tests__/html2/hooks/useInjectStylesElements/changeRoot.html.snap-1.png

File renamed without changes.

__tests__/html2/provider/InjectStylesElementsComposer/changeRoot.html.snap-2.png renamed to __tests__/html2/hooks/useInjectStylesElements/changeRoot.html.snap-2.png

File renamed without changes.

__tests__/html2/provider/InjectStylesElementsComposer/css/1.css renamed to __tests__/html2/hooks/useInjectStylesElements/css/1.css

File renamed without changes.

__tests__/html2/provider/InjectStylesElementsComposer/css/2.css renamed to __tests__/html2/hooks/useInjectStylesElements/css/2.css

File renamed without changes.

__tests__/html2/provider/InjectStylesElementsComposer/css/3.css renamed to __tests__/html2/hooks/useInjectStylesElements/css/3.css

File renamed without changes.

__tests__/html2/provider/InjectStylesElementsComposer/dupeElement.html renamed to __tests__/html2/hooks/useInjectStylesElements/dupeElement.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
testHelpers: { createDirectLineEmulator },
1717
WebChat: {
1818
Components: { ThemeProvider },
19-
internal: { InjectStyleElementsComposer }
19+
internal: { useInjectStyleElements }
2020
}
2121
} = window;
2222

@@ -42,7 +42,7 @@
4242
new Promise(resolve =>
4343
ReactDOM.render(
4444
<ThemeProvider styleOptions={stylesRoot ? { stylesRoot } : {}}>
45-
<InjectStyleElementsComposer nonce={nonce} styleElements={styleElements} />
45+
<RunFunction fn={() => resolve(useInjectStyleElements({ nonce, styleElements }))} />
4646
</ThemeProvider>,
4747
document.getElementById('webchat'),
4848
resolve

0 commit comments

Comments
 (0)