StarUser.tsx 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * <<
  3. * Davinci
  4. * ==
  5. * Copyright (C) 2016 - 2017 EDP
  6. * ==
  7. * Licensed under the Apache License, Version 2.0 (the "License");
  8. * you may not use this file except in compliance with the License.
  9. * You may obtain a copy of the License at
  10. *
  11. * http://www.apache.org/licenses/LICENSE-2.0
  12. *
  13. * Unless required by applicable law or agreed to in writing, software
  14. * distributed under the License is distributed on an "AS IS" BASIS,
  15. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16. * See the License for the specific language governing permissions and
  17. * limitations under the License.
  18. * >>
  19. */
  20. import React from 'react'
  21. import { Modal } from 'antd'
  22. const styles = require('./Star.less')
  23. import { IStarUserList } from './types'
  24. import Avatar from 'components/Avatar'
  25. import { IStarUser } from 'containers/Projects/types'
  26. const StarUsr: React.FC<IStarUserList> = ({
  27. visible,
  28. starUser,
  29. closeUserListModal
  30. }) => {
  31. return (
  32. <Modal title={null} visible={visible} footer={null} onCancel={closeUserListModal}>
  33. <div className={styles.formWrapper}>
  34. <div className={styles.header}>
  35. <div className={styles.title}>点赞用户</div>
  36. </div>
  37. <div className={styles.body}>
  38. {starUser
  39. ? starUser.map((user: IStarUser, index) => (
  40. <div className={styles.avatar} key={`star${index}list`}>
  41. <Avatar path={user.avatar} size="small" enlarge={true} />
  42. <p className={styles.title}>{user.username}</p>
  43. </div>
  44. ))
  45. : ''}
  46. </div>
  47. </div>
  48. </Modal>
  49. )
  50. }
  51. export default StarUsr