Skip to content

Commit

Permalink
Merge pull request zuiidea#581 from zuiidea/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
zuiidea authored Sep 11, 2017
2 parents e42c21f + 36fb5d2 commit b816206
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 66 deletions.
15 changes: 11 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
dist
node_modules
yarn.lock
npm-debug.log
dist
node_modules
yarn.lock
npm-debug.log
# ide
.idea

# Mac General
.DS_Store
.AppleDouble
.LSOverride
19 changes: 11 additions & 8 deletions src/components/Iconfont/Iconfont.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
import React from 'react'
import PropTypes from 'prop-types'
import classnames from 'classnames'
import './iconfont.less'

const Iconfont = ({ type, colorful }) => {
const Iconfont = ({ type, colorful = false, className }) => {
if (colorful) {
return (<span
dangerouslySetInnerHTML={{
__html: `<svg class="colorful-icon" aria-hidden="true"><use xlink:href="#${type.startsWith('#') ? type.replace(/#/, '') : type}"></use></svg>`,
}}
/>)
return (
<svg className={classnames('colorful-icon', className)} aria-hidden="true">
<use xlinkHref={`#${type.startsWith('#') ? type.replace(/#/, '') : type}`} />
</svg>
)
}
return <i className={`antdadmin icon-${type}`} />

return <i className={classnames('antdadmin', [`icon-${type}`], className)} />
}

Iconfont.propTypes = {
type: PropTypes.string,
type: PropTypes.string.isRequired,
colorful: PropTypes.bool,
className: PropTypes.string,
}

export default Iconfont
1 change: 0 additions & 1 deletion src/models/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import modelExtend from 'dva-model-extend'
import { config } from 'utils'
import { create, remove, update } from 'services/user'
import * as usersService from 'services/users'
import queryString from 'query-string'
import { pageModel } from './common'

const { query } = usersService
Expand Down
100 changes: 47 additions & 53 deletions src/routes/UIElement/iconfont/index.less
Original file line number Diff line number Diff line change
@@ -1,53 +1,47 @@
.list {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;

li {
width: 120px;
text-align: center;
cursor: pointer;
height: 100px;
transition: all 0.5s ease;
display: flex;
flex-direction: column;
align-items: center;
margin-bottom: 24px;
box-sizing: border-box;
border: solid 1px transparent;
justify-content: center;

&:hover {
border: solid 1px #f5f5f5;
}
}

.name {
margin-top: 8px;
}

:global {
.colorful-icon {
font-size: 36px;
}

.antdadmin {
font-size: 32px;
line-height: 1;
}
}
}
@media (min-width: 1600px) {
.list {
li {
width: 160px;
}
}
}
@media (max-width: 767px) {
.list {
li {
width: 100px;
}
}
}
.list {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;

li {
width: 120px;
text-align: center;
cursor: pointer;
height: 100px;
transition: all 0.5s ease;
display: flex;
flex-direction: column;
align-items: center;
margin-bottom: 24px;
box-sizing: border-box;
border: solid 1px transparent;
justify-content: center;

&:hover {
border: solid 1px #f5f5f5;
}
}

.name {
margin-top: 8px;
}

.icon {
font-size: 32px;
line-height: 1;
}
}
@media (min-width: 1600px) {
.list {
li {
width: 160px;
}
}
}
@media (max-width: 767px) {
.list {
li {
width: 100px;
}
}
}

0 comments on commit b816206

Please sign in to comment.