Skip to content

Commit

Permalink
Dark Mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Goytai committed Apr 25, 2021
1 parent a583219 commit 14b2046
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/components/Player/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { useEffect, useRef, useState } from 'react'
import Slider from 'rc-slider'

import { usePlayer } from '../../contexts/PlayerContext'
import { useTheme } from '../../contexts/ThemeContext'

import 'rc-slider/assets/index.css'

Expand All @@ -28,6 +29,8 @@ export function Player() {
clearPlayerState
} = usePlayer()

const {isDark} = useTheme()

const audioRef = useRef<HTMLAudioElement>(null)
const episode = episodeList[currentEpisodeIndex]
const [progress, setProgess] = useState(0)
Expand Down Expand Up @@ -92,9 +95,9 @@ export function Player() {
max={episode.duration}
value={progress}
onChange={handleSeek}
trackStyle={{backgroundColor: '#04d361'}}
railStyle={{backgroundColor: '#9f75ff'}}
handleStyle={{borderColor: '#04d361', borderWidth: 4}}
trackStyle={isDark ? {backgroundColor: 'rgb(4, 211, 97)'} : {backgroundColor: '#04d361'}}
railStyle={isDark ? {backgroundColor: '#9F75FF'} : {backgroundColor: '#9f75ff'}}
handleStyle={isDark ? {borderColor: 'rgb(4, 211, 97)', borderWidth: 4} : {borderColor: '#04d361', borderWidth: 4}}
/>
) : (
<div className={styles.emptySlider} />
Expand Down
2 changes: 1 addition & 1 deletion src/components/Player/styles.module.sass
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
&[data-action='play']
width: 4rem
height: 4rem
background: var(--purple-300)
background: var(--bg-play)
border-radius: 1rem

&:hover:not(:disabled)
Expand Down
2 changes: 2 additions & 0 deletions src/styles/globals.sass
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ html
--bg-pages: #F7F8FA
--bg-player: #8257E5
--bg-items: #FFF
--bg-play: #9F75FF

--gradient-player: linear-gradient(143.8deg,rgba(145, 100, 250, 0.8) 0%,rgba(0, 0, 0, 0) 100%)

Expand All @@ -40,6 +41,7 @@ html
--bg-pages: #242424
--bg-player: #4a4a4a
--bg-items: #3b3b3b
--bg-play: #3b3b3b

--gradient-player: linear-gradient(143.8deg,rgba(59, 59, 59, 0.8) 0%,rgba(0, 0, 0, 0) 100%)

Expand Down

1 comment on commit 14b2046

@vercel
Copy link

@vercel vercel bot commented on 14b2046 Apr 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

Please sign in to comment.