Skip to content

Commit

Permalink
style: optically center card spinners
Browse files Browse the repository at this point in the history
  • Loading branch information
robinpyon committed Jan 7, 2021
1 parent beef859 commit 8a37e59
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions src/components/Card/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ const Card = (props: Props) => {
<Box
flex={1}
style={{
cursor: 'pointer'
cursor: 'pointer',
position: 'relative'
}}
>
<Image
Expand All @@ -160,6 +161,23 @@ const Card = (props: Props) => {
transition: 'opacity 1000ms'
}}
/>

{/* Spinner */}
{updating && (
<Flex
align="center"
justify="center"
style={{
height: '100%',
left: 0,
position: 'absolute',
top: 0,
width: '100%'
}}
>
<Spinner />
</Flex>
)}
</Box>

{/* Footer */}
Expand Down Expand Up @@ -221,23 +239,6 @@ const Card = (props: Props) => {
</Tooltip>
</Box>
)}

{/* Spinner */}
{updating && (
<Flex
align="center"
justify="center"
style={{
height: '100%',
left: 0,
position: 'absolute',
top: 0,
width: '100%'
}}
>
<Spinner />
</Flex>
)}
</Container>
</>
)
Expand Down

0 comments on commit 8a37e59

Please sign in to comment.