Download spectrum/src/components/avatar/style.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 3.01 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/src/components/avatar/style.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/spectrum/src/components/avatar/style.js
-
curl -L -o style.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/src/components/avatar/style.js
3.01 kB
| // @flow | |
| import theme from 'shared/theme'; | |
| import styled, { css } from 'styled-components'; | |
| import ReactImage from 'react-image'; | |
| import { zIndex } from '../globals'; | |
| import { Link } from 'react-router-dom'; | |
| import { ProfileHeaderAction } from '../profile/style'; | |
| import { MEDIA_BREAK } from 'src/components/layout'; | |
| export const Container = styled.div` | |
| position: relative; | |
| display: inline-block; | |
| width: ${props => (props.size ? `${props.size}px` : '32px')}; | |
| height: ${props => (props.size ? `${props.size}px` : '32px')}; | |
| border-radius: ${props => | |
| props.type === 'community' ? `${props.size / 8}px` : '100%'}; | |
| border: none; | |
| background-color: ${theme.bg.default}; | |
| ${props => | |
| props.mobilesize && | |
| css` | |
| @media (max-width: ${MEDIA_BREAK}px) { | |
| width: ${props => `${props.mobilesize}px`}; | |
| height: ${props => `${props.mobilesize}px`}; | |
| } | |
| `}; | |
| `; | |
| export const AvatarLink = styled(Link)` | |
| display: flex; | |
| flex: none; | |
| flex-direction: column; | |
| height: 100%; | |
| width: 100%; | |
| justify-content: center; | |
| align-items: center; | |
| pointer-events: auto; | |
| border-radius: ${props => | |
| props.type === 'community' ? `${props.size / 8}px` : '100%'}; | |
| `; | |
| export const CoverAction = styled(ProfileHeaderAction)` | |
| position: absolute; | |
| top: 12px; | |
| right: 12px; | |
| z-index: ${zIndex.tooltip + 1}; | |
| `; | |
| export const Img = styled(ReactImage)` | |
| display: inline-block; | |
| width: ${props => (props.size ? `${props.size}px` : '32px')}; | |
| height: ${props => (props.size ? `${props.size}px` : '32px')}; | |
| border-radius: ${props => | |
| props.type === 'community' ? `${props.size / 8}px` : '100%'}; | |
| object-fit: cover; | |
| background-color: ${theme.bg.default}; | |
| ${props => | |
| props.mobilesize && | |
| css` | |
| @media (max-width: ${MEDIA_BREAK}px) { | |
| width: ${props => `${props.mobilesize}px`}; | |
| height: ${props => `${props.mobilesize}px`}; | |
| } | |
| `}; | |
| `; | |
| export const FallbackImg = styled.img` | |
| display: inline-block; | |
| width: ${props => (props.size ? `${props.size}px` : '32px')}; | |
| height: ${props => (props.size ? `${props.size}px` : '32px')}; | |
| border-radius: ${props => | |
| props.type === 'community' ? `${props.size / 8}px` : '100%'}; | |
| object-fit: cover; | |
| background-color: ${theme.bg.wash}; | |
| ${props => | |
| props.mobilesize && | |
| css` | |
| @media (max-width: ${MEDIA_BREAK}px) { | |
| width: ${props => `${props.mobilesize}px`}; | |
| height: ${props => `${props.mobilesize}px`}; | |
| } | |
| `}; | |
| `; | |
| export const LoadingImg = styled.div` | |
| display: inline-block; | |
| width: ${props => (props.size ? `${props.size}px` : '32px')}; | |
| height: ${props => (props.size ? `${props.size}px` : '32px')}; | |
| border-radius: ${props => | |
| props.type === 'community' ? `${props.size / 8}px` : '100%'}; | |
| background: ${theme.bg.wash}; | |
| ${props => | |
| props.mobilesize && | |
| css` | |
| @media (max-width: ${MEDIA_BREAK}px) { | |
| width: ${props => `${props.mobilesize}px`}; | |
| height: ${props => `${props.mobilesize}px`}; | |
| } | |
| `}; | |
| `; | |