Skip to content

Commit 5f8b882

Browse files
committed
chore(Ref): remove component (#4286)
* chore(Ref): remove component * fix tests
1 parent 9437695 commit 5f8b882

28 files changed

+203
-523
lines changed

docs/src/components/Sidebar/Sidebar.js

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import _ from 'lodash/fp'
33
import PropTypes from 'prop-types'
44
import React, { Component } from 'react'
55
import { Link } from 'react-static'
6-
import { Menu, Icon, Input, Ref } from 'semantic-ui-react'
6+
import { Menu, Icon, Input } from 'semantic-ui-react'
77

88
import CarbonAd from 'docs/src/components/CarbonAd/CarbonAd'
99
import Logo from 'docs/src/components/Logo/Logo'
@@ -229,16 +229,15 @@ class Sidebar extends Component {
229229
</Menu.Menu>
230230
</Menu.Item>
231231
<Menu.Item fitted>
232-
<Ref innerRef={this.handleSearchRef}>
233-
<Input
234-
fluid
235-
icon={{ name: 'filter', color: 'teal', inverted: true, bordered: true }}
236-
placeholder='Press "/" to filter components'
237-
value={query}
238-
onChange={this.handleSearchChange}
239-
onKeyDown={this.handleSearchKeyDown}
240-
/>
241-
</Ref>
232+
<Input
233+
fluid
234+
icon={{ name: 'filter', color: 'teal', inverted: true, bordered: true }}
235+
placeholder='Press "/" to filter components'
236+
ref={this.handleSearchRef}
237+
value={query}
238+
onChange={this.handleSearchChange}
239+
onKeyDown={this.handleSearchKeyDown}
240+
/>
242241
</Menu.Item>
243242
{query ? this.renderSearchItems() : this.menuItemsByType}
244243
</Menu>

docs/src/examples/addons/Ref/Types/RefExampleRef.js

Lines changed: 0 additions & 67 deletions
This file was deleted.

docs/src/examples/addons/Ref/Types/RefForwardingExample.js

Lines changed: 0 additions & 54 deletions
This file was deleted.

docs/src/examples/addons/Ref/Types/index.js

Lines changed: 0 additions & 30 deletions
This file was deleted.

docs/src/examples/addons/Ref/index.js

Lines changed: 0 additions & 38 deletions
This file was deleted.

docs/src/examples/modules/Sidebar/Usage/SidebarExampleTarget.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
Header,
66
Image,
77
Menu,
8-
Ref,
98
Segment,
109
Sidebar,
1110
} from 'semantic-ui-react'
@@ -42,12 +41,10 @@ const SidebarExampleTarget = () => {
4241
<Menu.Item as='a'>Channels</Menu.Item>
4342
</Sidebar>
4443

45-
<Ref innerRef={segmentRef}>
46-
<Segment secondary>
47-
<Header as='h3'>Clickable area</Header>
48-
<p>When you will click there, the sidebar will be closed.</p>
49-
</Segment>
50-
</Ref>
44+
<Segment secondary ref={segmentRef}>
45+
<Header as='h3'>Clickable area</Header>
46+
<p>When you will click there, the sidebar will be closed.</p>
47+
</Segment>
5148

5249
<Segment>
5350
<Header as='h3'>Application Content</Header>

docs/src/examples/modules/Sticky/Types/StickyExampleAdjacentContext.js

Lines changed: 20 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
import _ from 'lodash'
22
import React, { Component, createRef } from 'react'
3-
import {
4-
Grid,
5-
Header,
6-
Image,
7-
Rail,
8-
Ref,
9-
Segment,
10-
Sticky,
11-
} from 'semantic-ui-react'
3+
import { Grid, Header, Image, Rail, Segment, Sticky } from 'semantic-ui-react'
124

135
const Placeholder = () => <Image src='/images/wireframe/paragraph.png' />
146

@@ -19,31 +11,29 @@ export default class StickyExampleAdjacentContext extends Component {
1911
return (
2012
<Grid centered columns={3}>
2113
<Grid.Column>
22-
<Ref innerRef={this.contextRef}>
23-
<Segment>
24-
{_.times(10, (i) => (
14+
<Segment ref={this.contextRef}>
15+
{_.times(10, (i) => (
16+
<Placeholder key={i} />
17+
))}
18+
19+
<Rail position='left'>
20+
{_.times(3, (i) => (
2521
<Placeholder key={i} />
2622
))}
2723

28-
<Rail position='left'>
29-
{_.times(3, (i) => (
30-
<Placeholder key={i} />
31-
))}
32-
33-
<Sticky context={this.contextRef}>
34-
<Header as='h3'>Stuck Content</Header>
35-
<Image src='/images/wireframe/image.png' />
36-
</Sticky>
37-
</Rail>
24+
<Sticky context={this.contextRef}>
25+
<Header as='h3'>Stuck Content</Header>
26+
<Image src='/images/wireframe/image.png' />
27+
</Sticky>
28+
</Rail>
3829

39-
<Rail position='right'>
40-
<Sticky context={this.contextRef}>
41-
<Header as='h3'>Stuck Content</Header>
42-
<Image src='/images/wireframe/image.png' />
43-
</Sticky>
44-
</Rail>
45-
</Segment>
46-
</Ref>
30+
<Rail position='right'>
31+
<Sticky context={this.contextRef}>
32+
<Header as='h3'>Stuck Content</Header>
33+
<Image src='/images/wireframe/image.png' />
34+
</Sticky>
35+
</Rail>
36+
</Segment>
4737
</Grid.Column>
4838
</Grid>
4939
)

docs/src/examples/modules/Sticky/Types/StickyExamplePushing.js

Lines changed: 21 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
import _ from 'lodash'
22
import React, { Component, createRef } from 'react'
3-
import {
4-
Grid,
5-
Header,
6-
Image,
7-
Rail,
8-
Ref,
9-
Segment,
10-
Sticky,
11-
} from 'semantic-ui-react'
3+
import { Grid, Header, Image, Rail, Segment, Sticky } from 'semantic-ui-react'
124

135
const Placeholder = () => <Image src='/images/wireframe/paragraph.png' />
146

@@ -19,31 +11,29 @@ export default class StickyExamplePushing extends Component {
1911
return (
2012
<Grid centered columns={3}>
2113
<Grid.Column>
22-
<Ref innerRef={this.contextRef}>
23-
<Segment>
24-
{_.times(10, (i) => (
25-
<Placeholder key={i} />
26-
))}
14+
<Segment ref={this.contextRef}>
15+
{_.times(10, (i) => (
16+
<Placeholder key={i} />
17+
))}
2718

28-
<Rail position='left'>
29-
<Sticky context={this.contextRef} pushing>
30-
<Header as='h3'>Stuck Content</Header>
31-
<Image src='/images/wireframe/image.png' />
32-
</Sticky>
33-
</Rail>
19+
<Rail position='left'>
20+
<Sticky context={this.contextRef} pushing>
21+
<Header as='h3'>Stuck Content</Header>
22+
<Image src='/images/wireframe/image.png' />
23+
</Sticky>
24+
</Rail>
3425

35-
<Rail position='right'>
36-
{_.times(3, (i) => (
37-
<Placeholder key={i} />
38-
))}
26+
<Rail position='right'>
27+
{_.times(3, (i) => (
28+
<Placeholder key={i} />
29+
))}
3930

40-
<Sticky context={this.contextRef} pushing>
41-
<Header as='h3'>Stuck Content</Header>
42-
<Image src='/images/wireframe/image.png' />
43-
</Sticky>
44-
</Rail>
45-
</Segment>
46-
</Ref>
31+
<Sticky context={this.contextRef} pushing>
32+
<Header as='h3'>Stuck Content</Header>
33+
<Image src='/images/wireframe/image.png' />
34+
</Sticky>
35+
</Rail>
36+
</Segment>
4737
</Grid.Column>
4838
</Grid>
4939
)

0 commit comments

Comments
 (0)