Skip to content

Commit

Permalink
temp: remove border
Browse files Browse the repository at this point in the history
  • Loading branch information
myronliu347 committed Apr 30, 2019
1 parent 81bb9a7 commit 36b36b5
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 18 deletions.
2 changes: 1 addition & 1 deletion adaptor/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import AdaptorGenerate from '../umd/adaptor-generate.esm';
import AdaptorGenerate from '../src';

import Adaptor from './adaptor';

Expand Down
7 changes: 1 addition & 6 deletions src/generate/pc/DemoItem.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import Context from './context';
import { renderAdaptor } from '../../utils';

export default class DemoItem extends Component {
Expand All @@ -12,11 +11,8 @@ export default class DemoItem extends Component {
adaptor: PropTypes.object,
}

static contextType = Context;

render() {
const { id, height, background, node, adaptor } = this.props;
const { activeId, changeActiveId } = this.context;

if (!node) return null;
const demoContent = renderAdaptor(adaptor, {
Expand All @@ -25,14 +21,13 @@ export default class DemoItem extends Component {

return (
<div
className={`demo-item ${id === activeId ? 'active' : ''}`}
className="demo-item"
data-demo={JSON.stringify({
id,
height,
background,
node,
})}
onClick={() => changeActiveId && changeActiveId(id)}
style={{
height: height || 'auto',
background: background || '',
Expand Down
10 changes: 3 additions & 7 deletions src/generate/pc/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { normalizeAdaptor, generateDemos, findProp } from '@alifd/adaptor-helper';
import Context from './context';
import StyledContainer from './style-container';
import DemoSection from './DemoSection';

Expand Down Expand Up @@ -135,14 +134,11 @@ export default (Adaptor) => {
}

render() {
const { activeId } = this.state;

return (
<Context.Provider value={{ activeId, changeActiveId: this.changeActiveId }}>
<StyledContainer>
{this.generateDemos()}
</StyledContainer>
</Context.Provider>
<StyledContainer>
{this.generateDemos()}
</StyledContainer>
);
}
}
Expand Down
4 changes: 0 additions & 4 deletions src/generate/pc/style-container.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,6 @@ export default styled.div`
overflow: hidden;
cursor: pointer;
position: relative;
&:hover,
&.active {
border-color: rgb(85, 132, 255);
}
&::before {
content: '';
position: absolute;
Expand Down

0 comments on commit 36b36b5

Please sign in to comment.