import styled from 'styled-components'; import { cssUnitCalc } from 'utils'; import Icon from 'kwai-icon'; import { Spinner } from '../spinner'; export const Spin = styled(Spinner)` width: 32px; height: 32px; `; export const Wrapper = styled.div` display: inline-flex; cursor: pointer; position: relative; justify-content: center; align-items: center; border-radius: 50%; background: #e1e1e1; width: ${p => cssUnitCalc(p.width)}; height: ${p => cssUnitCalc(p.width)}; :hover .overlay { opacity: 1; } svg.uploadIcon { width: 32px; height: 32px; circle { fill: white; } } `; export const Img = styled.img` object-fit: contain; border-radius: 50%; width: 100%; height: 100%; `; export const OverLay = styled.div` position: absolute; border-radius: 50%; top: 0; left: 0; bottom: 0; height: 100%; background: rgba(0, 0, 0, 0.4); overflow: hidden; width: 100%; opacity: 0; transition: 0.08s ease; display: inline-flex; flex-direction: column; justify-content: center; align-items: center; `; export const UploadIcon = styled(Icon).attrs(() => ({ name: 'Camera', color: 'white', }))``; export const Span = styled.span` margin-top: 3px; font-size: 12px; color: #ffffff; letter-spacing: 0.3px; line-height: 20px; `; export const HiddenFileInput = styled.input.attrs(() => ({ type: 'file', }))` display: none; `;