Skip to content

Commit

Permalink
chore(Ref): remove component (#4286)
Browse files Browse the repository at this point in the history
* chore(Ref): remove component

* fix tests
  • Loading branch information
layershifter committed Feb 1, 2022
1 parent 9c5c985 commit 3cecf2f
Show file tree
Hide file tree
Showing 28 changed files with 203 additions and 523 deletions.
21 changes: 10 additions & 11 deletions docs/src/components/Sidebar/Sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import _ from 'lodash/fp'
import PropTypes from 'prop-types'
import React, { Component } from 'react'
import { Link } from 'react-static'
import { Menu, Icon, Input, Ref } from 'semantic-ui-react'
import { Menu, Icon, Input } from 'semantic-ui-react'

import CarbonAd from 'docs/src/components/CarbonAd/CarbonAd'
import Logo from 'docs/src/components/Logo/Logo'
Expand Down Expand Up @@ -229,16 +229,15 @@ class Sidebar extends Component {
</Menu.Menu>
</Menu.Item>
<Menu.Item fitted>
<Ref innerRef={this.handleSearchRef}>
<Input
fluid
icon={{ name: 'filter', color: 'teal', inverted: true, bordered: true }}
placeholder='Press "/" to filter components'
value={query}
onChange={this.handleSearchChange}
onKeyDown={this.handleSearchKeyDown}
/>
</Ref>
<Input
fluid
icon={{ name: 'filter', color: 'teal', inverted: true, bordered: true }}
placeholder='Press "/" to filter components'
ref={this.handleSearchRef}
value={query}
onChange={this.handleSearchChange}
onKeyDown={this.handleSearchKeyDown}
/>
</Menu.Item>
{query ? this.renderSearchItems() : this.menuItemsByType}
</Menu>
Expand Down
67 changes: 0 additions & 67 deletions docs/src/examples/addons/Ref/Types/RefExampleRef.js

This file was deleted.

54 changes: 0 additions & 54 deletions docs/src/examples/addons/Ref/Types/RefForwardingExample.js

This file was deleted.

30 changes: 0 additions & 30 deletions docs/src/examples/addons/Ref/Types/index.js

This file was deleted.

38 changes: 0 additions & 38 deletions docs/src/examples/addons/Ref/index.js

This file was deleted.

11 changes: 4 additions & 7 deletions docs/src/examples/modules/Sidebar/Usage/SidebarExampleTarget.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
Header,
Image,
Menu,
Ref,
Segment,
Sidebar,
} from 'semantic-ui-react'
Expand Down Expand Up @@ -42,12 +41,10 @@ const SidebarExampleTarget = () => {
<Menu.Item as='a'>Channels</Menu.Item>
</Sidebar>

<Ref innerRef={segmentRef}>
<Segment secondary>
<Header as='h3'>Clickable area</Header>
<p>When you will click there, the sidebar will be closed.</p>
</Segment>
</Ref>
<Segment secondary ref={segmentRef}>
<Header as='h3'>Clickable area</Header>
<p>When you will click there, the sidebar will be closed.</p>
</Segment>

<Segment>
<Header as='h3'>Application Content</Header>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
import _ from 'lodash'
import React, { Component, createRef } from 'react'
import {
Grid,
Header,
Image,
Rail,
Ref,
Segment,
Sticky,
} from 'semantic-ui-react'
import { Grid, Header, Image, Rail, Segment, Sticky } from 'semantic-ui-react'

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

Expand All @@ -19,31 +11,29 @@ export default class StickyExampleAdjacentContext extends Component {
return (
<Grid centered columns={3}>
<Grid.Column>
<Ref innerRef={this.contextRef}>
<Segment>
{_.times(10, (i) => (
<Segment ref={this.contextRef}>
{_.times(10, (i) => (
<Placeholder key={i} />
))}

<Rail position='left'>
{_.times(3, (i) => (
<Placeholder key={i} />
))}

<Rail position='left'>
{_.times(3, (i) => (
<Placeholder key={i} />
))}

<Sticky context={this.contextRef}>
<Header as='h3'>Stuck Content</Header>
<Image src='/images/wireframe/image.png' />
</Sticky>
</Rail>
<Sticky context={this.contextRef}>
<Header as='h3'>Stuck Content</Header>
<Image src='/images/wireframe/image.png' />
</Sticky>
</Rail>

<Rail position='right'>
<Sticky context={this.contextRef}>
<Header as='h3'>Stuck Content</Header>
<Image src='/images/wireframe/image.png' />
</Sticky>
</Rail>
</Segment>
</Ref>
<Rail position='right'>
<Sticky context={this.contextRef}>
<Header as='h3'>Stuck Content</Header>
<Image src='/images/wireframe/image.png' />
</Sticky>
</Rail>
</Segment>
</Grid.Column>
</Grid>
)
Expand Down
52 changes: 21 additions & 31 deletions docs/src/examples/modules/Sticky/Types/StickyExamplePushing.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
import _ from 'lodash'
import React, { Component, createRef } from 'react'
import {
Grid,
Header,
Image,
Rail,
Ref,
Segment,
Sticky,
} from 'semantic-ui-react'
import { Grid, Header, Image, Rail, Segment, Sticky } from 'semantic-ui-react'

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

Expand All @@ -19,31 +11,29 @@ export default class StickyExamplePushing extends Component {
return (
<Grid centered columns={3}>
<Grid.Column>
<Ref innerRef={this.contextRef}>
<Segment>
{_.times(10, (i) => (
<Placeholder key={i} />
))}
<Segment ref={this.contextRef}>
{_.times(10, (i) => (
<Placeholder key={i} />
))}

<Rail position='left'>
<Sticky context={this.contextRef} pushing>
<Header as='h3'>Stuck Content</Header>
<Image src='/images/wireframe/image.png' />
</Sticky>
</Rail>
<Rail position='left'>
<Sticky context={this.contextRef} pushing>
<Header as='h3'>Stuck Content</Header>
<Image src='/images/wireframe/image.png' />
</Sticky>
</Rail>

<Rail position='right'>
{_.times(3, (i) => (
<Placeholder key={i} />
))}
<Rail position='right'>
{_.times(3, (i) => (
<Placeholder key={i} />
))}

<Sticky context={this.contextRef} pushing>
<Header as='h3'>Stuck Content</Header>
<Image src='/images/wireframe/image.png' />
</Sticky>
</Rail>
</Segment>
</Ref>
<Sticky context={this.contextRef} pushing>
<Header as='h3'>Stuck Content</Header>
<Image src='/images/wireframe/image.png' />
</Sticky>
</Rail>
</Segment>
</Grid.Column>
</Grid>
)
Expand Down
Loading

0 comments on commit 3cecf2f

Please sign in to comment.