From 91c91ede869ed2a02edc50c181725c4fed16946b Mon Sep 17 00:00:00 2001 From: JuanMarchetto Date: Thu, 8 Jun 2023 19:10:13 -0300 Subject: [PATCH 1/2] prettier --- ui/helpers/egg.ts | 10 +-- ui/helpers/nameSetter.ts | 5 +- ui/next.config.js | 6 +- ui/pages/egg.tsx | 152 +++++++++++++++++---------------------- ui/postcss.config.js | 2 +- ui/tailwind.config.js | 4 +- 6 files changed, 82 insertions(+), 97 deletions(-) diff --git a/ui/helpers/egg.ts b/ui/helpers/egg.ts index a7ea91a..5b526d0 100644 --- a/ui/helpers/egg.ts +++ b/ui/helpers/egg.ts @@ -2,13 +2,13 @@ import { message } from "@tauri-apps/api/dialog"; import { invoke } from "@tauri-apps/api/tauri"; const egg = () => { - invoke("egg") - .then( - ()=>{console.log("Egg");} - ) + invoke("egg") + .then(() => { + console.log("Egg"); + }) .catch(async (e) => { await message(e, { title: "Error", type: "error" }); }); }; -export default egg; \ No newline at end of file +export default egg; diff --git a/ui/helpers/nameSetter.ts b/ui/helpers/nameSetter.ts index a874cbe..6003e80 100644 --- a/ui/helpers/nameSetter.ts +++ b/ui/helpers/nameSetter.ts @@ -1,3 +1,6 @@ import { egg } from "@/helpers"; -const nameSetter = (name: string, setName: Function) => name === (process.env.egg ?? "Chewing Glass") ? egg() : setName(name); +const nameSetter = (name: string, setName: Function) => { + if (name === (process.env.egg ?? "Chewing Glass")) egg(); + setName(name); +} export default nameSetter; diff --git a/ui/next.config.js b/ui/next.config.js index 3177be8..5cb6b90 100644 --- a/ui/next.config.js +++ b/ui/next.config.js @@ -1,7 +1,7 @@ /** @type {import('next').NextConfig} */ const nextConfig = { reactStrictMode: true, - images:{unoptimized: true} -} + images: { unoptimized: true }, +}; -module.exports = nextConfig +module.exports = nextConfig; diff --git a/ui/pages/egg.tsx b/ui/pages/egg.tsx index 59871a1..ec9afa5 100644 --- a/ui/pages/egg.tsx +++ b/ui/pages/egg.tsx @@ -1,4 +1,3 @@ -import Head from "next/head"; import { useEffect, useState } from "react"; interface Bubble { @@ -16,96 +15,79 @@ export default function Egg() { const id = setInterval(() => { if (bubbles.some((bubble) => bubble.y < 0)) { setIsPlaying(false); + } else { + setBubbles((bubbles) => [ + ...bubbles.map((bubble) => { + return { + ...bubble, + y: bubble.y - Math.random() * Math.sqrt(count ? count * 2 : 2), + }; + }), + ...(Math.sqrt(count ? count : 2) > Math.random() * 10 + ? [ + { + x: Math.random() * 100, + y: 100, + timestamp: Date.now(), + }, + ] + : []), + ]); } - setBubbles((bubbles) => { - const newBubble = { - x: Math.random() * 100, - y: 100, - timestamp: Date.now(), - }; - return Math.random() * 2 > 1.5 - ? [ - ...bubbles.map((bubble) => { - return { - ...bubble, - y: - bubble.y - - (count < 30 - ? Math.random() * 2 - : (Math.random() * count) / 3), - }; - }), - newBubble, - ] - : [ - ...bubbles.map((bubble) => { - return { - ...bubble, - y: - bubble.y - - (count < 30 - ? Math.random() * 2 - : (Math.random() * count) / 10), - }; - }), - ]; - }); }, 300); return () => clearInterval(id); }); return ( - <> - - Soda - - - - -
-
-

- {count} -

- {isPlaying ? bubbles?.map((bubble) => { - console.log(bubble); - return ( -
{ - setBubbles( - bubbles.filter((b) => { - return b.timestamp !== bubble.timestamp; - }) - ); - setCount(count + 1); - }} - > -
-
- ); - }): ( -
- +
+
+

+ {count} +

+ {isPlaying ? ( + bubbles?.map((bubble) => ( +
{ + setBubbles( + bubbles.filter((b) => { + return b.timestamp !== bubble.timestamp; + }) + ); + setCount(count + 1); + }} + > +
- ) - } -
-
- + )) + ) : ( +
+ +
+ )} +
+
); } diff --git a/ui/postcss.config.js b/ui/postcss.config.js index 33ad091..12a703d 100644 --- a/ui/postcss.config.js +++ b/ui/postcss.config.js @@ -3,4 +3,4 @@ module.exports = { tailwindcss: {}, autoprefixer: {}, }, -} +}; diff --git a/ui/tailwind.config.js b/ui/tailwind.config.js index cf9b177..021a414 100644 --- a/ui/tailwind.config.js +++ b/ui/tailwind.config.js @@ -4,7 +4,7 @@ module.exports = { "./app/**/*.{js,ts,jsx,tsx}", "./pages/**/*.{js,ts,jsx,tsx}", "./components/**/*.{js,ts,jsx,tsx}", - + // Or if using `src` directory: "./src/**/*.{js,ts,jsx,tsx}", ], @@ -12,4 +12,4 @@ module.exports = { extend: {}, }, plugins: [], -} +}; From 314a6abdd4ea428304ab608cc45c5b4eb2543b32 Mon Sep 17 00:00:00 2001 From: Marche Date: Thu, 8 Jun 2023 19:46:37 -0300 Subject: [PATCH 2/2] Fix release version (#71) --- .github/workflows/main.yml | 4 ++-- ui/pages/egg.tsx | 2 +- ui/src-tauri/tauri.conf.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5f8f1e4..94a94fa 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -54,8 +54,8 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: projectPath: './ui' - tagName: pre-alpha-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version + tagName: v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version releaseName: 'Soda v__VERSION__' # tauri-action replaces \_\_VERSION\_\_ with the app version. - releaseBody: 'See the assets to download and install this version.' + releaseBody: 'This is a very early unaudited and untested release, DO NOT USE IT unless you now what are you doing.\nIn order to use the program you will need to:\n\nDownload the installation files for your OS\nInstall soda\nDownload the template.zip file\nDecompress template.zip' releaseDraft: true prerelease: false diff --git a/ui/pages/egg.tsx b/ui/pages/egg.tsx index ec9afa5..be433fc 100644 --- a/ui/pages/egg.tsx +++ b/ui/pages/egg.tsx @@ -56,7 +56,7 @@ export default function Egg() { bubbles?.map((bubble) => (