Skip to content

Commit aa0a8cc

Browse files
alburkerkgabrieljablonski
authored andcommitted
feat: add exemple in App.tsx
1 parent 3a741fa commit aa0a8cc

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

src/App.tsx

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { TooltipProvider, TooltipWrapper } from 'components/TooltipProvider'
55
import { IPosition } from 'components/Tooltip/TooltipTypes.d'
66
import { useState } from 'react'
77
import styles from './styles.module.css'
8+
import { inline, offset } from './index'
89

910
function WithProviderMinimal() {
1011
return (
@@ -202,6 +203,65 @@ function App() {
202203
content="Showing tooltip and calling afterShow method"
203204
/>
204205
</div>
206+
207+
<div
208+
style={{
209+
width: 700,
210+
position: 'relative',
211+
overflow: 'hidden',
212+
marginTop: '1rem',
213+
214+
boxSizing: 'border-box',
215+
}}
216+
>
217+
<p>
218+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
219+
<span id="withoutCustomMiddleware" style={{ color: 'blue', fontWeight: 'bold' }}>
220+
labore et dolore magna aliqua
221+
</span>
222+
. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
223+
commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
224+
dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
225+
culpa qui officia deserunt mollit anim id est laborum.
226+
</p>
227+
228+
<Tooltip
229+
place="top"
230+
anchorId="withoutCustomMiddleware"
231+
content="Showing tooltip with default middlewares"
232+
positionStrategy="fixed"
233+
/>
234+
</div>
235+
236+
<div
237+
style={{
238+
width: 700,
239+
position: 'relative',
240+
overflow: 'hidden',
241+
marginTop: '1rem',
242+
243+
boxSizing: 'border-box',
244+
}}
245+
>
246+
<p>
247+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
248+
<span id="withCustomMiddleware" style={{ color: 'blue', fontWeight: 'bold' }}>
249+
labore et dolore magna aliqua
250+
</span>
251+
. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
252+
commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
253+
dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
254+
culpa qui officia deserunt mollit anim id est laborum.
255+
</p>
256+
257+
<Tooltip
258+
place="top"
259+
anchorId="withCustomMiddleware"
260+
content="Showing tooltip with custom inline middleware"
261+
positionStrategy="fixed"
262+
middlewares={[inline(), offset(10)]}
263+
/>
264+
</div>
205265
</main>
206266
)
207267
}

0 commit comments

Comments
 (0)