Skip to content

Commit 0e99b69

Browse files
authored
Merge pull request #117 from stanleyowen/next
Version 0.4.5
2 parents fd2c8e4 + 7ac254b commit 0e99b69

12 files changed

+579
-578
lines changed

package.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
{
22
"name": "lofi-player",
3-
"version": "0.3.7",
3+
"version": "0.4.5",
44
"private": true,
55
"author": "Stanley Owen <stanleyowen06@gmail.com>",
66
"dependencies": {
77
"@emotion/react": "^11.4.1",
88
"@emotion/styled": "^11.3.0",
9-
"@mui/lab": "^5.0.0-alpha.47",
10-
"@mui/material": "^5.0.0",
11-
"@types/node": "^16.9.6",
9+
"@mui/material": "^5.0.1",
10+
"@types/node": "^16.10.1",
1211
"@types/react": "^17.0.24",
1312
"@types/react-dom": "^17.0.9",
1413
"@types/react-router-dom": "^5.3.0",
1514
"electron-is-dev": "^2.0.0",
16-
"firebase": "^9.0.2",
15+
"firebase": "^9.1.0",
1716
"react": "^17.0.2",
1817
"react-dom": "^17.0.2",
1918
"react-router-dom": "^5.3.0",
@@ -24,11 +23,13 @@
2423
"homepage": "./",
2524
"scripts": {
2625
"start": "react-scripts start",
27-
"build": "react-scripts build",
26+
"build": "GENERATE_SOURCEMAP=false react-scripts build",
27+
"build:win": "cross-env GENERATE_SOURCEMAP=false react-scripts build",
2828
"test": "react-scripts test",
2929
"eject": "react-scripts eject",
3030
"release": "yarn build && electron-builder --publish=always",
3131
"build:electron": "node ./scripts/prebuild.js && yarn build && electron-builder && node ./scripts/postbuild.js",
32+
"build:win:electron": "node ./scripts/prebuild.js && yarn build:win && electron-builder && node ./scripts/postbuild.js",
3233
"start:electron": "concurrently \"cross-env BROWSER=none yarn start\" \"wait-on http://localhost:3000 && electron .\""
3334
},
3435
"build": {
@@ -70,9 +71,9 @@
7071
},
7172
"devDependencies": {
7273
"@testing-library/jest-dom": "^5.14.1",
73-
"@testing-library/react": "^12.1.0",
74+
"@testing-library/react": "^12.1.1",
7475
"@testing-library/user-event": "^13.2.1",
75-
"concurrently": "^6.2.1",
76+
"concurrently": "^6.2.2",
7677
"cross-env": "^7.0.3",
7778
"dotenv": "^10.0.0",
7879
"electron": "^15.0.0",

src/App.css

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ h1, h2, h3, h4, h5, h6, p {
103103
}
104104
#tabs .active { background: rgb(var(--blue) / 15%) }
105105
#tabs :nth-child(3) { margin-top: auto }
106+
#tabs svg { font-size: 1.5em !important; }
106107
.tab {
107108
font-weight: 525;
108109
color: rgb(var(--black) / 70%) !important;
@@ -242,6 +243,9 @@ svg {
242243
text-decoration: none;
243244
}
244245
#version a:hover { text-decoration: underline }
246+
#version svg { font-size: 1.2em !important }
247+
#version .MuiPaper-root:before{ display: none !important }
248+
245249
.small { font-size: 12px; font-weight: normal !important; }
246250
button {
247251
border: none;
@@ -310,16 +314,35 @@ button {
310314
/* Search */
311315
.search { width: 50% }
312316

317+
/* Scroll Bar */
318+
::-webkit-scrollbar {
319+
width: 15px;
320+
background: transparent;
321+
}
322+
::-webkit-scrollbar-thumb {
323+
background: rgb(var(--black) / 75%);
324+
border-radius: 7px;
325+
/* border-radius: calc(15px / 2); */
326+
background-clip: content-box;
327+
border: 4px solid transparent;
328+
}
329+
::-webkit-scrollbar-thumb:hover {
330+
background: rgb(var(--black));
331+
background-clip: content-box;
332+
}
333+
313334
@media only screen and (max-width: 1200px) {
314335
.col-3 { grid-template-columns: 50% 50% }
315336
#version .w-50 { width: 70% !important }
337+
.w-50.audio { width: 70% !important }
316338
.col-4 { grid-template-columns: 33.3% 33.3% 33.3% }
317339
.search { width: 60% }
318340
}
319341
@media only screen and (max-width: 800px) {
320342
.col-3 { grid-template-columns: 100% }
321343
.col-4 { grid-template-columns: 50% 50% }
322344
#version .w-50 { width: 90% !important }
345+
.w-50.audio { width: 100% !important }
323346
}
324347
@media only screen and (max-width: 700px) {
325348
.search { width: 100% }

src/components/about.component.tsx

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,22 @@
11
import React from 'react'
22
import { Button, Accordion, AccordionSummary } from '@mui/material'
3-
import { AboutOutline, PrivacyPolicy, ExpandMoreIcon, License } from '../lib/icons.component'
3+
44
import { version } from '../../package.json'
5+
import { Themes, License, AboutOutline, PrivacyPolicy, Expand } from '../lib/icons.component'
56

67
const About = ({ properties }: any) => {
8+
const setTheme = (url: string | Boolean) => {
9+
const background = document.getElementById('backdrop-image')
10+
if(url)
11+
import (`../../src/img/${url}`)
12+
.then(image => {
13+
if(background) background.style.background = `url(${image.default})`
14+
// localStorage.setItem('theme-session', )
15+
})
16+
.catch(() => console.log('Error in Rendering Image'))
17+
else background?.removeAttribute('style')
18+
}
19+
720
return (
821
<div className="m-10" id="version">
922
<div className="flex w-50 card p-15">
@@ -16,12 +29,27 @@ const About = ({ properties }: any) => {
1629
</div>
1730
<Button variant="outlined" onClick={() => navigator.clipboard.writeText(`Version: ${version}`)}>Copy</Button>
1831
</div>
32+
1933
<Accordion className="w-50 card mt-10">
20-
<AccordionSummary expandIcon={<ExpandMoreIcon />}>
21-
<div className="flex w-80">
22-
<PrivacyPolicy />
23-
<p className="ml-10">Privacy Policy</p>
34+
<AccordionSummary expandIcon={<Expand />}>
35+
<div className="flex w-80">
36+
<Themes />
37+
<p className="ml-10">Themes</p>
38+
</div>
39+
</AccordionSummary>
40+
<div className="p-10">
41+
<Button onClick={() => setTheme(false)}>Default</Button>
42+
<Button onClick={() => setTheme('a9d4d30d6b483ee638a0dddab5bb047e.webp')}>Nature</Button>
43+
<Button onClick={() => setTheme('d14c82db65be85a729c042492447dc5d.webp')}>Sunset</Button>
2444
</div>
45+
</Accordion>
46+
47+
<Accordion className="w-50 card mt-10">
48+
<AccordionSummary expandIcon={<Expand />}>
49+
<div className="flex w-80">
50+
<PrivacyPolicy />
51+
<p className="ml-10">Privacy Policy</p>
52+
</div>
2553
</AccordionSummary>
2654
<div className="p-10">
2755
<p><i>Personal Information Collection</i></p>
@@ -30,8 +58,9 @@ const About = ({ properties }: any) => {
3058
<p>LoFi Player does not collect, store, share or publish any non-personal information.</p>
3159
</div>
3260
</Accordion>
61+
3362
<Accordion className="w-50 card mt-10">
34-
<AccordionSummary expandIcon={<ExpandMoreIcon />}>
63+
<AccordionSummary expandIcon={<Expand />}>
3564
<div className="flex w-80">
3665
<License />
3766
<p className="ml-10">License</p>

src/components/app.component.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import React, { useState, useEffect, useCallback } from 'react'
22
import { initializeApp } from 'firebase/app'
33
import { getDatabase, ref, onValue } from 'firebase/database'
4-
import { Alert } from '@mui/lab'
5-
import { Slide, Snackbar } from '@mui/material'
4+
import { Alert, Slide, Snackbar, LinearProgress, SlideProps } from '@mui/material'
65

76
import Navbar from './navbar.component'
87
import BaseLayout from './base.component'

src/components/home.component.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useState, useEffect } from 'react'
2-
import { Skeleton } from '@mui/lab'
2+
import { Skeleton } from '@mui/material'
33

44
const Home = ({ song, songData, handleSong }: any) => {
55
const [greeting, setGreeting] = useState<string>()

src/components/navbar.component.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,21 @@ const Navbar = ({ properties, handleChange }: any) => {
1515
})
1616
}, [properties])
1717

18-
const goBackward = (e: React.MouseEvent<HTMLElement>) => handleChange({ id: 'activeTab', value: properties.previousTab, goBackward: true })
19-
const goForward = (e: React.MouseEvent<HTMLElement>) => handleChange({ id: 'activeTab', value: properties.nextTab, goForward: true })
18+
const triggerAction = (type: 'next' | 'previous') => {
19+
if(type === 'previous') handleChange({ id: 'activeTab', value: properties.previousTab, goBackward: true })
20+
else handleChange({ id: 'activeTab', value: properties.nextTab, goForward: true })
21+
}
2022

2123
return (
2224
<div className="navbar">
2325
<div className="m-10-auto">
2426
<Tooltip title="Go Back" enterDelay={500} enterNextDelay={500}><div>
25-
<IconButton onClick={goBackward} disabled={property.disablePrevious}><ChevronLeft /></IconButton>
27+
<IconButton onClick={() => triggerAction('previous')} disabled={property.disablePrevious}><ChevronLeft /></IconButton>
2628
</div></Tooltip>
2729
</div>
2830
<div className="m-10-auto">
2931
<Tooltip title="Go Forward" enterDelay={500} enterNextDelay={500}><div>
30-
<IconButton onClick={goForward} disabled={property.disableForward}><ChevronRight /></IconButton>
32+
<IconButton onClick={() => triggerAction('next')} disabled={property.disableForward}><ChevronRight /></IconButton>
3133
</div></Tooltip>
3234
</div>
3335
<div className="mrl-10">

src/components/search.component.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React, { useState, useEffect } from 'react'
2-
import { Skeleton } from '@mui/lab'
32
import { Close } from '../lib/icons.component'
4-
import { TextField, IconButton } from '@mui/material'
3+
import { Skeleton, TextField, IconButton } from '@mui/material'
54

65
const Search = ({ songData }: any) => {
76
const items: any = []

src/components/sidebar.component.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ const SideBar = ({ handleChange, properties }: any) => {
5959
</DialogContent>
6060
<DialogActions>
6161
<Button onClick={() => setDialog(false)}>Cancel</Button>
62-
<Button color="secondary" onClick={() => window.location.href = String(process.env.REACT_APP_BETA)}>Continue</Button>
62+
<Button color="error" onClick={() => window.location.href = String(process.env.REACT_APP_BETA)}>Continue</Button>
6363
</DialogActions>
6464
</Dialog>
6565
</div>
92.2 KB
Loading
31.5 KB
Loading

0 commit comments

Comments
 (0)