Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Card component #202

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions docs/app/Examples/views/Card/CardExample.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React, { Component } from 'react'
import CardTypeExamples from './Types/CardTypeExamples'

export default class StatisticExamples extends Component {
render() {
return (
<div>
<CardTypeExamples />
</div>
)
}
}
25 changes: 25 additions & 0 deletions docs/app/Examples/views/Card/Types/CardTypeExamples.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React, { Component } from 'react'
import ComponentExample from 'docs/app/Components/ComponentDoc/ComponentExample'
import ExampleSection from 'docs/app/Components/ComponentDoc/ExampleSection'

export default class CardTypeExamples extends Component {
render() {
return (
<ExampleSection title='Types'>
<ComponentExample
title='Card'
description='A card displays site content in a manner similar to a playing card.'
examplePath='views/Statistic/Types/StatisticBottomLabelExample'
/>
<ComponentExample
examplePath='views/Statistic/Types/StatisticTopLabelExample'
/>
<ComponentExample
title='Statistic Group'
description='A group of statistics'
examplePath='views/Statistic/Types/StatisticGroupExample'
/>
</ExampleSection>
)
}
}
2 changes: 2 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ export Dropdown from './modules/Dropdown/Dropdown'
// Views
// ----------------------------------------

export Card from './views/Card/Card'

import _Item from './views/Item/Item'
export { _Item as Item }
export const Items = deprecateComponent('Items', 'Use "Item.Items" instead.', _Item.Items)
Expand Down
31 changes: 31 additions & 0 deletions src/views/Card/Card.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import React from 'react'

export default class Card extends React.Component {
render() {
return (
<div>
Example
<div className='ui card'>
<div className='image'>
<img src='/images/avatar2/large/kristy.png' />
</div>
<div className='content'>
<a className='header'>Kristy</a>
<div className='meta'>
<span className='date'>Joined in 2013</span>
</div>
<div className='description'>
Kristy is an art director living in New York.
</div>
</div>
<div className='extra content'>
<a>
<i className='user icon' />
22 Friends
</a>
</div>
</div>
</div>
)
}
}
8 changes: 8 additions & 0 deletions test/specs/views/Card/Card-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import Card from 'src/views/Card/Card'
import * as common from 'test/specs/commonTests'

describe.only('Card', () => {
common.isConformant(Card)
common.hasUIClassName(Card)
common.rendersChildren(Card)
})