diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index a244522..d8cbe42 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -36,8 +36,6 @@ jobs: run: npm ci - name: Export Project run: npm run export:web - - name: Copy icon.png - run: cp ./assets/icon.png ./web-build/pwa/icon.png - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: diff --git a/app/components/bar/TabBar.js b/app/components/bar/TabBar.js index c2c34a2..a30c3b4 100755 --- a/app/components/bar/TabBar.js +++ b/app/components/bar/TabBar.js @@ -9,7 +9,6 @@ import SideBar from '~/components/bar/SideBar'; const TabBar = ({ state, descriptors, navigation }) => { const config = React.useContext(ConfigContext) const settings = React.useContext(SettingsContext) - const [isFullScreen, setIsFullScreen] = React.useState(false) React.useEffect(() => { if (config.query === null) { @@ -20,13 +19,11 @@ const TabBar = ({ state, descriptors, navigation }) => { return ( <> { - !isFullScreen ? - settings.isDesktop ? - - : - : null + settings.isDesktop ? + + : } - + ); } diff --git a/app/components/player/BoxDesktopPlayer.js b/app/components/player/BoxDesktopPlayer.js index b39c2ce..397e5f2 100644 --- a/app/components/player/BoxDesktopPlayer.js +++ b/app/components/player/BoxDesktopPlayer.js @@ -14,7 +14,7 @@ import FavoritedButton from '~/components/button/FavoritedButton'; import size from '~/styles/size'; import PlayButton from '~/components/button/PlayButton'; -const BoxDesktopPlayer = ({ fullscreen }) => { +const BoxDesktopPlayer = ({ setFullScreen }) => { const song = React.useContext(SongContext) const songDispatch = React.useContext(SongDispatchContext) const config = React.useContext(ConfigContext) @@ -27,7 +27,7 @@ const BoxDesktopPlayer = ({ fullscreen }) => { fullscreen.set(true)} + onPress={() => setFullScreen(true)} style={{ flexDirection: 'row', flex: 1 }} > { size={17} style={{ padding: 5, paddingHorizontal: 8, marginStart: 15, borderRadius: 4 }} color={theme.primaryLight} - onPress={() => fullscreen.set(true)} + onPress={() => setFullScreen(true)} /> diff --git a/app/components/player/BoxPlayer.js b/app/components/player/BoxPlayer.js index 64fa146..df702ef 100644 --- a/app/components/player/BoxPlayer.js +++ b/app/components/player/BoxPlayer.js @@ -14,7 +14,7 @@ import ImageError from '~/components/ImageError'; import size from '~/styles/size'; import useKeyboardIsOpen from '~/utils/useKeyboardIsOpen'; -const BoxPlayer = ({ fullscreen }) => { +const BoxPlayer = ({ setFullScreen }) => { const song = React.useContext(SongContext) const songDispatch = React.useContext(SongDispatchContext) const config = React.useContext(ConfigContext) @@ -24,7 +24,7 @@ const BoxPlayer = ({ fullscreen }) => { return ( fullscreen.set(true)} + onPress={() => setFullScreen(true)} style={{ position: 'absolute', bottom: (insets.bottom ? insets.bottom : 15) + 53, diff --git a/app/components/player/FullScreenHorizontalPlayer.js b/app/components/player/FullScreenHorizontalPlayer.js index 0b84de1..b009bbb 100644 --- a/app/components/player/FullScreenHorizontalPlayer.js +++ b/app/components/player/FullScreenHorizontalPlayer.js @@ -29,7 +29,7 @@ const color = { secondary: '#c6c6c6' } -const FullScreenHorizontalPlayer = ({ fullscreen }) => { +const FullScreenHorizontalPlayer = ({ setFullScreen }) => { const [isPreview, setIsPreview] = React.useState(preview.COVER) const config = React.useContext(ConfigContext) const insets = useSafeAreaInsets() @@ -49,7 +49,7 @@ const FullScreenHorizontalPlayer = ({ fullscreen }) => { return ( { size={17} style={{ padding: 5, paddingHorizontal: 8, marginStart: 15, borderRadius: 4 }} color={color.primary} - onPress={() => fullscreen.set(false)} + onPress={() => setFullScreen(false)} /> diff --git a/app/components/player/FullScreenPlayer.js b/app/components/player/FullScreenPlayer.js index cf1c8ca..3bbebeb 100644 --- a/app/components/player/FullScreenPlayer.js +++ b/app/components/player/FullScreenPlayer.js @@ -24,7 +24,7 @@ const preview = { LYRICS: 2 } -const FullScreenPlayer = ({ fullscreen }) => { +const FullScreenPlayer = ({ setFullScreen }) => { const [isPreview, setIsPreview] = React.useState(preview.COVER) const song = React.useContext(SongContext) const songDispatch = React.useContext(SongDispatchContext) @@ -42,7 +42,7 @@ const FullScreenPlayer = ({ fullscreen }) => { return ( fullscreen.set(false)} + onRequestClose={() => setFullScreen(false)} > { }} icon="chevron-down" color={theme.primaryLight} - onPress={() => fullscreen.set(false)} /> + onPress={() => setFullScreen(false)} /> { isPreview == preview.COVER && diff --git a/app/components/player/Player.js b/app/components/player/Player.js index 927ffea..8093706 100644 --- a/app/components/player/Player.js +++ b/app/components/player/Player.js @@ -8,22 +8,23 @@ import BoxPlayer from '~/components/player/BoxPlayer' import FullScreenHorizontalPlayer from '~/components/player/FullScreenHorizontalPlayer' import FullScreenPlayer from '~/components/player/FullScreenPlayer' -const Player = ({ state, fullscreen }) => { +const Player = ({ state }) => { const song = React.useContext(SongContext) const settings = React.useContext(SettingsContext) const { height, width } = useWindowDimensions() + const [fullScreen, setFullScreen] = React.useState(false) React.useEffect(() => { - fullscreen.set(false) + setFullScreen(false) }, [state.index]) if (!song?.songInfo) return null - else if (fullscreen.value) { - if (width <= height) return - else return + else if (fullScreen) { + if (width <= height) return + else return } - else if (settings.isDesktop) return - return + else if (settings.isDesktop) return + return } export default Player \ No newline at end of file diff --git a/assets/adaptative-icon.png b/assets/adaptative-icon.png new file mode 100644 index 0000000..741b371 Binary files /dev/null and b/assets/adaptative-icon.png differ diff --git a/assets/icon.svg b/assets/icon.svg index c6a51bf..ae2d799 100644 --- a/assets/icon.svg +++ b/assets/icon.svg @@ -1,9 +1,8 @@ - - + + - - + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - + + + - - - + + + + + + + - - - - - - - + + - - + + + - - - - - - - - + + + + \ No newline at end of file diff --git a/web/manifest.json b/web/manifest.json index 6d89ade..9e53390 100644 --- a/web/manifest.json +++ b/web/manifest.json @@ -5,43 +5,21 @@ "lang": "en", "display": "standalone", "orientation": "portrait", - "background_color": "#121212", + "background_color": "#660000", "theme_color": "#121212", "start_url": "./index.html", "icons": [ { - "src": "./pwa/icon.png", - "sizes": "1024x1024", - "type": "image/png", + "src": "./pwa/icon.svg", + "sizes": "any", + "type": "image/svg+xml", "purpose": "any" }, { - "src": "./pwa/icon.png", + "src": "./pwa/adaptative-icon.png", "sizes": "1024x1024", "type": "image/png", "purpose": "maskable" - }, - { - "src": "./pwa/apple-touch-icon/apple-touch-icon-180.png", - "sizes": "180x180", - "type": "image/png", - "purpose": "any" - }, - { - "src": "./pwa/apple-touch-icon/apple-touch-icon-180.png", - "sizes": "180x180", - "type": "image/png", - "purpose": "maskable" - }, - { - "src": "./favicon-32.png", - "sizes": "32x32", - "type": "image/png" - }, - { - "src": "./favicon-16.png", - "sizes": "16x16", - "type": "image/png" } ] -} \ No newline at end of file +} diff --git a/webpack.config.js b/webpack.config.js index b109134..2614b13 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,6 +1,7 @@ const createExpoWebpackConfigAsync = require("@expo/webpack-config"); const path = require("path"); const WorkboxWebpackPlugin = require("workbox-webpack-plugin"); +const CopyWebpackPlugin = require("copy-webpack-plugin"); // const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer'); module.exports = async function (env, argv) { @@ -26,6 +27,21 @@ module.exports = async function (env, argv) { }) ); + config.plugins.push( + new CopyWebpackPlugin({ + patterns: [ + { + from: path.resolve(__dirname, "assets/icon.svg"), + to: path.resolve(__dirname, "web-build/pwa/icon.svg"), + }, + { + from: path.resolve(__dirname, "assets/adaptative-icon.png"), + to: path.resolve(__dirname, "web-build/pwa/adaptative-icon.png"), + }, + ], + }), + ) + // Uncomment to analyze bundle size // config.plugins.push( // new BundleAnalyzerPlugin({