Skip to content

Commit

Permalink
Replace octoface icon with spinner in SelectMenu component (#1355)
Browse files Browse the repository at this point in the history
* Replace octoface with spinner

* Create few-flowers-play.md
  • Loading branch information
colebemis authored Jul 27, 2021
1 parent 0fd0eb3 commit 3cc7be7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 21 deletions.
5 changes: 5 additions & 0 deletions .changeset/few-flowers-play.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/components": patch
---

Replace octoface icon with spinner in SelectMenu component
25 changes: 4 additions & 21 deletions src/SelectMenu/SelectMenuLoadingAnimation.tsx
Original file line number Diff line number Diff line change
@@ -1,30 +1,13 @@
import React from 'react'
import styled, {keyframes} from 'styled-components'
import StyledOcticon from '../StyledOcticon'
import {OctofaceIcon} from '@primer/octicons-react'
import {get, COMMON, SystemCommonProps} from '../constants'
import styled from 'styled-components'
import {COMMON, get, SystemCommonProps} from '../constants'
import Spinner from '../Spinner'
import {ComponentProps} from '../utils/types'

const pulseKeyframes = keyframes`
0% {
opacity: 0.3;
}
10% {
opacity: 1;
}
100% {
opacity: 0.3;
}
`

const Animation = styled.div<SystemCommonProps>`
padding: ${get('space.6')} ${get('space.4')};
text-align: center;
background-color: ${get('colors.bg.overlay')};
animation-name: ${pulseKeyframes};
animation-duration: 2s;
animation-timing-function: linear;
animation-iteration-count: infinite;
${COMMON}
`

Expand All @@ -33,7 +16,7 @@ export type SelectMenuLoadingAnimationProps = ComponentProps<typeof Animation>
const SelectMenuLoadingAnimation = (props: SelectMenuLoadingAnimationProps) => {
return (
<Animation {...props}>
<StyledOcticon size={32} icon={OctofaceIcon} />
<Spinner />
</Animation>
)
}
Expand Down

0 comments on commit 3cc7be7

Please sign in to comment.