Skip to content

Commit

Permalink
fix: number, add github address
Browse files Browse the repository at this point in the history
  • Loading branch information
uniquemo committed May 15, 2020
1 parent 03aef4a commit a560127
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 2 deletions.
Binary file added src/assets/image/github-logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion src/components/Layout/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Icon } from '@blueprintjs/core'
import Navbar from './Navbar'
import Searcher from './Searcher'
import { PlayMusicStateContext, PlayMusicDispatchContext, ACTIONS } from 'reducers/playMusic'
import { REPOSITORY } from 'constants/github'
import styles from './style.module.css'

const { useContext } = React
Expand Down Expand Up @@ -56,8 +57,12 @@ const Header = () => {
<div>
{!showLyric && <Navbar />}
</div>
<div>
<div className={styles.operations}>
<Searcher />
<div
className={styles.githubLogo}
onClick={() => window.open(REPOSITORY)}
/>
</div>
</div>
</div>
Expand Down
16 changes: 16 additions & 0 deletions src/components/Layout/Header/style.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,19 @@
width: calc(100% - sidebarWidth);
padding: 0 20px;
}

.operations {
display: flex;
align-items: center;
}

.githubLogo {
width: 30px;
height: 30px;
border-radius: 50%;
margin-left: 10px;
background-color: rgba(0, 0, 0, 0.5);
background-image: url(~assets/image/github-logo.png);
background-size: 100% 100%;
cursor: pointer;
}
2 changes: 1 addition & 1 deletion src/components/ProgressBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const ProgressBar: React.FC<IProps> = ({ donePercent, renderLabel, onBarClick, c
onBarClick(percent)
}, [getPercent, onBarClick])

const width = useMemo(() => `${donePercent * 100}%`, [donePercent])
const width = useMemo(() => `${Math.floor(donePercent * 100)}%`, [donePercent])

return (
<div
Expand Down
1 change: 1 addition & 0 deletions src/constants/github.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const REPOSITORY: string = 'https://github.com/Unique111/react-netease-music'

0 comments on commit a560127

Please sign in to comment.