diff --git a/licenses/github.com/FortAwesome/Font-Awesome/LICENSE.txt b/licenses/github.com/FortAwesome/Font-Awesome/LICENSE.txt new file mode 100644 index 0000000..e69c5e3 --- /dev/null +++ b/licenses/github.com/FortAwesome/Font-Awesome/LICENSE.txt @@ -0,0 +1,165 @@ +Fonticons, Inc. (https://fontawesome.com) + +-------------------------------------------------------------------------------- + +Font Awesome Free License + +Font Awesome Free is free, open source, and GPL friendly. You can use it for +commercial projects, open source projects, or really almost whatever you want. +Full Font Awesome Free license: https://fontawesome.com/license/free. + +-------------------------------------------------------------------------------- + +# Icons: CC BY 4.0 License (https://creativecommons.org/licenses/by/4.0/) + +The Font Awesome Free download is licensed under a Creative Commons +Attribution 4.0 International License and applies to all icons packaged +as SVG and JS file types. + +-------------------------------------------------------------------------------- + +# Fonts: SIL OFL 1.1 License + +In the Font Awesome Free download, the SIL OFL license applies to all icons +packaged as web and desktop font files. + +Copyright (c) 2024 Fonticons, Inc. (https://fontawesome.com) +with Reserved Font Name: "Font Awesome". + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + +SIL OPEN FONT LICENSE +Version 1.1 - 26 February 2007 + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting — in part or in whole — any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. + +-------------------------------------------------------------------------------- + +# Code: MIT License (https://opensource.org/licenses/MIT) + +In the Font Awesome Free download, the MIT license applies to all non-font and +non-icon files. + +Copyright 2024 Fonticons, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in the +Software without restriction, including without limitation the rights to use, copy, +modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, +and to permit persons to whom the Software is furnished to do so, subject to the +following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +-------------------------------------------------------------------------------- + +# Attribution + +Attribution is required by MIT, SIL OFL, and CC BY licenses. Downloaded Font +Awesome Free files already contain embedded comments with sufficient +attribution, so you shouldn't need to do anything additional when using these +files normally. + +We've kept attribution comments terse, so we ask that you do not actively work +to remove them from files, especially code. They're a great way for folks to +learn about Font Awesome. + +-------------------------------------------------------------------------------- + +# Brand Icons + +All brand icons are trademarks of their respective owners. The use of these +trademarks does not indicate endorsement of the trademark holder by Font +Awesome, nor vice versa. **Please do not use brand logos for any purpose except +to represent the company, product, or service to which they refer.** diff --git a/v1/app.go b/v1/app.go index d7119d9..19488d4 100644 --- a/v1/app.go +++ b/v1/app.go @@ -5,6 +5,7 @@ import ( "encoding/json" "fmt" "log" + "net/http" "os" "sync" "time" @@ -71,30 +72,6 @@ func (a *App) log() error { func (a *App) startup(ctx context.Context) { a.ctx = ctx a.api.Startup(ctx) - - db, err := config.Database() - if err != nil { - log.Fatal(err) - } - - services, err := models.NewServices( - models.WithDatabase(db), - models.WithAccountService(), - models.WithChannelService(), - models.WithAccountChannelService(), - ) - if err != nil { - log.Fatal(err) - } - - err = services.AutoMigrate() - if err != nil { - log.Fatal(err) - } - - a.services = services - - // TODO: check for update - if available, pop up window } func (a *App) shutdown(ctx context.Context) { @@ -122,6 +99,102 @@ func (a *App) shutdown(ctx context.Context) { a.logFileMu.Unlock() } +func (a *App) Start() (bool, error) { + + runtime.EventsEmit(a.ctx, "StartupMessage", "Initializing database...") + err := a.initServices() + if err != nil { + a.logError.Println("error initializing services:", err) + return false, fmt.Errorf("Error starting Rum Goggles. Try restarting.") + } + runtime.EventsEmit(a.ctx, "StartupMessage", "Initializing database complete.") + + runtime.EventsEmit(a.ctx, "StartupMessage", "Verifying account sessions...") + count, err := a.verifyAccounts() + if err != nil { + a.logError.Println("error verifying accounts:", err) + return false, fmt.Errorf("Error starting Rum Goggles. Try restarting.") + } + runtime.EventsEmit(a.ctx, "StartupMessage", "Verifying account sessions complete.") + + // TODO: check for update - if available, pop up window + // runtime.EventsEmit(a.ctx, "StartupMessage", "Checking for updates...") + // update, err = a.checkForUpdate() + // runtime.EventsEmit(a.ctx, "StartupMessage", "Checking for updates complete.") + + signin := true + if count > 0 { + signin = false + } + + return signin, nil +} + +func (a *App) initServices() error { + db, err := config.Database() + if err != nil { + return fmt.Errorf("error getting database config: %v", err) + } + + services, err := models.NewServices( + models.WithDatabase(db), + models.WithAccountService(), + models.WithChannelService(), + models.WithAccountChannelService(), + ) + if err != nil { + return fmt.Errorf("error initializing services: %v", err) + } + + err = services.AutoMigrate() + if err != nil { + return fmt.Errorf("error auto-migrating services: %v", err) + } + + a.services = services + + return nil +} + +func (a *App) verifyAccounts() (int, error) { + accounts, err := a.services.AccountS.All() + if err != nil { + return -1, fmt.Errorf("error querying all accounts: %v", err) + } + + a.clientsMu.Lock() + defer a.clientsMu.Unlock() + for _, account := range accounts { + if account.Cookies != nil { + var cookies []*http.Cookie + err = json.Unmarshal([]byte(*account.Cookies), &cookies) + if err != nil { + return -1, fmt.Errorf("error un-marshaling cookie string: %v", err) + } + client, err := rumblelivestreamlib.NewClient(rumblelivestreamlib.NewClientOptions{Cookies: cookies}) + if err != nil { + return -1, fmt.Errorf("error creating new client: %v", err) + } + if account.Username == nil { + return -1, fmt.Errorf("account username is nil") + } + loggedIn, err := client.LoggedIn() + if err != nil { + return -1, fmt.Errorf("error check if account is logged in: %v", err) + } + if loggedIn { + a.clients[*account.Username] = client + } else { + account.Cookies = nil + err = a.services.AccountS.Update(&account) + fmt.Errorf("error updating account: %v", err) + } + } + } + + return len(accounts), nil +} + func (a *App) AddPage(apiKey string) error { client := rumblelivestreamlib.Client{StreamKey: apiKey} resp, err := client.Request() @@ -302,6 +375,20 @@ func (a *App) Logout(id int64) error { } if acct.Cookies != nil { + if !exists { + var cookies []*http.Cookie + err = json.Unmarshal([]byte(*acct.Cookies), &cookies) + if err != nil { + a.logError.Println("error un-marshaling cookie string:", err) + return fmt.Errorf("Error logging out. Try again.") + } + client, err = rumblelivestreamlib.NewClient(rumblelivestreamlib.NewClientOptions{Cookies: cookies}) + err = client.Logout() + if err != nil { + a.logError.Println("error logging out:", err) + return fmt.Errorf("Error logging out. Try again.") + } + } acct.Cookies = nil err = a.services.AccountS.Update(acct) if err != nil { diff --git a/v1/frontend/src/App.jsx b/v1/frontend/src/App.jsx index 39affbd..f650a0d 100644 --- a/v1/frontend/src/App.jsx +++ b/v1/frontend/src/App.jsx @@ -1,14 +1,16 @@ import { useState } from 'react'; import { MemoryRouter as Router, Route, Routes, Link } from 'react-router-dom'; import './App.css'; -import { NavDashboard, NavSignIn } from './Navigation'; +import { NavDashboard, NavSignIn, NavStartup } from './Navigation'; import Dashboard from './screens/Dashboard'; import SignIn from './screens/SignIn'; +import Startup from './screens/Startup'; function App() { return ( + } /> } /> } /> diff --git a/v1/frontend/src/Navigation.jsx b/v1/frontend/src/Navigation.jsx index 2293540..77a5756 100644 --- a/v1/frontend/src/Navigation.jsx +++ b/v1/frontend/src/Navigation.jsx @@ -1,2 +1,3 @@ export const NavDashboard = '/dashboard'; -export const NavSignIn = '/'; +export const NavSignIn = '/signin'; +export const NavStartup = '/'; diff --git a/v1/frontend/src/assets/icons/Font-Awesome/LICENSE.txt b/v1/frontend/src/assets/icons/Font-Awesome/LICENSE.txt new file mode 100644 index 0000000..e69c5e3 --- /dev/null +++ b/v1/frontend/src/assets/icons/Font-Awesome/LICENSE.txt @@ -0,0 +1,165 @@ +Fonticons, Inc. (https://fontawesome.com) + +-------------------------------------------------------------------------------- + +Font Awesome Free License + +Font Awesome Free is free, open source, and GPL friendly. You can use it for +commercial projects, open source projects, or really almost whatever you want. +Full Font Awesome Free license: https://fontawesome.com/license/free. + +-------------------------------------------------------------------------------- + +# Icons: CC BY 4.0 License (https://creativecommons.org/licenses/by/4.0/) + +The Font Awesome Free download is licensed under a Creative Commons +Attribution 4.0 International License and applies to all icons packaged +as SVG and JS file types. + +-------------------------------------------------------------------------------- + +# Fonts: SIL OFL 1.1 License + +In the Font Awesome Free download, the SIL OFL license applies to all icons +packaged as web and desktop font files. + +Copyright (c) 2024 Fonticons, Inc. (https://fontawesome.com) +with Reserved Font Name: "Font Awesome". + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + +SIL OPEN FONT LICENSE +Version 1.1 - 26 February 2007 + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting — in part or in whole — any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. + +-------------------------------------------------------------------------------- + +# Code: MIT License (https://opensource.org/licenses/MIT) + +In the Font Awesome Free download, the MIT license applies to all non-font and +non-icon files. + +Copyright 2024 Fonticons, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in the +Software without restriction, including without limitation the rights to use, copy, +modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, +and to permit persons to whom the Software is furnished to do so, subject to the +following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +-------------------------------------------------------------------------------- + +# Attribution + +Attribution is required by MIT, SIL OFL, and CC BY licenses. Downloaded Font +Awesome Free files already contain embedded comments with sufficient +attribution, so you shouldn't need to do anything additional when using these +files normally. + +We've kept attribution comments terse, so we ask that you do not actively work +to remove them from files, especially code. They're a great way for folks to +learn about Font Awesome. + +-------------------------------------------------------------------------------- + +# Brand Icons + +All brand icons are trademarks of their respective owners. The use of these +trademarks does not indicate endorsement of the trademark holder by Font +Awesome, nor vice versa. **Please do not use brand logos for any purpose except +to represent the company, product, or service to which they refer.** diff --git a/v1/frontend/src/assets/icons/Font-Awesome/chess-rook.png b/v1/frontend/src/assets/icons/Font-Awesome/chess-rook.png new file mode 100644 index 0000000..7c314df Binary files /dev/null and b/v1/frontend/src/assets/icons/Font-Awesome/chess-rook.png differ diff --git a/v1/frontend/src/assets/icons/twbs/LICENSE b/v1/frontend/src/assets/icons/twbs/LICENSE new file mode 100644 index 0000000..47f06b6 --- /dev/null +++ b/v1/frontend/src/assets/icons/twbs/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2019-2021 The Bootstrap Authors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/v1/frontend/src/assets/icons/chevron-right.png b/v1/frontend/src/assets/icons/twbs/chevron-right.png similarity index 100% rename from v1/frontend/src/assets/icons/chevron-right.png rename to v1/frontend/src/assets/icons/twbs/chevron-right.png diff --git a/v1/frontend/src/assets/icons/circle-green-background.png b/v1/frontend/src/assets/icons/twbs/circle-green-background.png similarity index 100% rename from v1/frontend/src/assets/icons/circle-green-background.png rename to v1/frontend/src/assets/icons/twbs/circle-green-background.png diff --git a/v1/frontend/src/assets/icons/circle-red-background.png b/v1/frontend/src/assets/icons/twbs/circle-red-background.png similarity index 100% rename from v1/frontend/src/assets/icons/circle-red-background.png rename to v1/frontend/src/assets/icons/twbs/circle-red-background.png diff --git a/v1/frontend/src/assets/icons/eye-red.png b/v1/frontend/src/assets/icons/twbs/eye-red.png similarity index 100% rename from v1/frontend/src/assets/icons/eye-red.png rename to v1/frontend/src/assets/icons/twbs/eye-red.png diff --git a/v1/frontend/src/assets/icons/eye-slash.png b/v1/frontend/src/assets/icons/twbs/eye-slash.png similarity index 100% rename from v1/frontend/src/assets/icons/eye-slash.png rename to v1/frontend/src/assets/icons/twbs/eye-slash.png diff --git a/v1/frontend/src/assets/icons/eye.png b/v1/frontend/src/assets/icons/twbs/eye.png similarity index 100% rename from v1/frontend/src/assets/icons/eye.png rename to v1/frontend/src/assets/icons/twbs/eye.png diff --git a/v1/frontend/src/assets/icons/gear-fill.png b/v1/frontend/src/assets/icons/twbs/gear-fill.png similarity index 100% rename from v1/frontend/src/assets/icons/gear-fill.png rename to v1/frontend/src/assets/icons/twbs/gear-fill.png diff --git a/v1/frontend/src/assets/icons/hand-thumbs-down-fill.png b/v1/frontend/src/assets/icons/twbs/hand-thumbs-down-fill.png similarity index 100% rename from v1/frontend/src/assets/icons/hand-thumbs-down-fill.png rename to v1/frontend/src/assets/icons/twbs/hand-thumbs-down-fill.png diff --git a/v1/frontend/src/assets/icons/hand-thumbs-up-fill.png b/v1/frontend/src/assets/icons/twbs/hand-thumbs-up-fill.png similarity index 100% rename from v1/frontend/src/assets/icons/hand-thumbs-up-fill.png rename to v1/frontend/src/assets/icons/twbs/hand-thumbs-up-fill.png diff --git a/v1/frontend/src/assets/icons/heart-fill.png b/v1/frontend/src/assets/icons/twbs/heart-fill.png similarity index 100% rename from v1/frontend/src/assets/icons/heart-fill.png rename to v1/frontend/src/assets/icons/twbs/heart-fill.png diff --git a/v1/frontend/src/assets/icons/pause-circle-green.png b/v1/frontend/src/assets/icons/twbs/pause-circle-green.png similarity index 100% rename from v1/frontend/src/assets/icons/pause-circle-green.png rename to v1/frontend/src/assets/icons/twbs/pause-circle-green.png diff --git a/v1/frontend/src/assets/icons/pause-circle.png b/v1/frontend/src/assets/icons/twbs/pause-circle.png similarity index 100% rename from v1/frontend/src/assets/icons/pause-circle.png rename to v1/frontend/src/assets/icons/twbs/pause-circle.png diff --git a/v1/frontend/src/assets/icons/pause-fill.png b/v1/frontend/src/assets/icons/twbs/pause-fill.png similarity index 100% rename from v1/frontend/src/assets/icons/pause-fill.png rename to v1/frontend/src/assets/icons/twbs/pause-fill.png diff --git a/v1/frontend/src/assets/icons/play-circle-green.png b/v1/frontend/src/assets/icons/twbs/play-circle-green.png similarity index 100% rename from v1/frontend/src/assets/icons/play-circle-green.png rename to v1/frontend/src/assets/icons/twbs/play-circle-green.png diff --git a/v1/frontend/src/assets/icons/play-circle.png b/v1/frontend/src/assets/icons/twbs/play-circle.png similarity index 100% rename from v1/frontend/src/assets/icons/play-circle.png rename to v1/frontend/src/assets/icons/twbs/play-circle.png diff --git a/v1/frontend/src/assets/icons/play-fill.png b/v1/frontend/src/assets/icons/twbs/play-fill.png similarity index 100% rename from v1/frontend/src/assets/icons/play-fill.png rename to v1/frontend/src/assets/icons/twbs/play-fill.png diff --git a/v1/frontend/src/assets/icons/plus-circle-fill.png b/v1/frontend/src/assets/icons/twbs/plus-circle-fill.png similarity index 100% rename from v1/frontend/src/assets/icons/plus-circle-fill.png rename to v1/frontend/src/assets/icons/twbs/plus-circle-fill.png diff --git a/v1/frontend/src/assets/icons/star-fill.png b/v1/frontend/src/assets/icons/twbs/star-fill.png similarity index 100% rename from v1/frontend/src/assets/icons/star-fill.png rename to v1/frontend/src/assets/icons/twbs/star-fill.png diff --git a/v1/frontend/src/assets/icons/x-lg.png b/v1/frontend/src/assets/icons/twbs/x-lg.png similarity index 100% rename from v1/frontend/src/assets/icons/x-lg.png rename to v1/frontend/src/assets/icons/twbs/x-lg.png diff --git a/v1/frontend/src/assets/index.js b/v1/frontend/src/assets/index.js index 36a6bae..cbe6f02 100644 --- a/v1/frontend/src/assets/index.js +++ b/v1/frontend/src/assets/index.js @@ -1,20 +1,22 @@ -import chevron_right from './icons/chevron-right.png'; -import circle_green_background from './icons/circle-green-background.png'; -import circle_red_background from './icons/circle-red-background.png'; -import eye from './icons/eye.png'; -import eye_red from './icons/eye-red.png'; -import eye_slash from './icons/eye-slash.png'; -import gear_fill from './icons/gear-fill.png'; -import heart from './icons/heart-fill.png'; -import pause from './icons/pause-circle-green.png'; -import play from './icons/play-circle-green.png'; -import plus_circle from './icons/plus-circle-fill.png'; -import star from './icons/star-fill.png'; -import thumbs_down from './icons/hand-thumbs-down-fill.png'; -import thumbs_up from './icons/hand-thumbs-up-fill.png'; -import x_lg from './icons/x-lg.png'; +import chess_rook from './icons/Font-Awesome/chess-rook.png'; +import chevron_right from './icons/twbs/chevron-right.png'; +import circle_green_background from './icons/twbs/circle-green-background.png'; +import circle_red_background from './icons/twbs/circle-red-background.png'; +import eye from './icons/twbs/eye.png'; +import eye_red from './icons/twbs/eye-red.png'; +import eye_slash from './icons/twbs/eye-slash.png'; +import gear_fill from './icons/twbs/gear-fill.png'; +import heart from './icons/twbs/heart-fill.png'; +import pause from './icons/twbs/pause-circle-green.png'; +import play from './icons/twbs/play-circle-green.png'; +import plus_circle from './icons/twbs/plus-circle-fill.png'; +import star from './icons/twbs/star-fill.png'; +import thumbs_down from './icons/twbs/hand-thumbs-down-fill.png'; +import thumbs_up from './icons/twbs/hand-thumbs-up-fill.png'; +import x_lg from './icons/twbs/x-lg.png'; import logo from './logo/logo.png'; +export const ChessRook = chess_rook; export const ChevronRight = chevron_right; export const CircleGreenBackground = circle_green_background; export const CircleRedBackground = circle_red_background; diff --git a/v1/frontend/src/components/PageDetails.jsx b/v1/frontend/src/components/PageDetails.jsx index b135847..d56ffeb 100644 --- a/v1/frontend/src/components/PageDetails.jsx +++ b/v1/frontend/src/components/PageDetails.jsx @@ -11,6 +11,7 @@ import { Star, ThumbsDown, ThumbsUp, + ChessRook, } from '../assets'; import './PageDetails.css'; import { @@ -638,7 +639,9 @@ function PageEvent(props) {
{props.event.followed_on && } - {props.event.subscribed_on && } + {props.event.subscribed_on && ( + + )}
{props.event.username} diff --git a/v1/frontend/src/screens/SignIn.jsx b/v1/frontend/src/screens/SignIn.jsx index 2f04f9f..624769b 100644 --- a/v1/frontend/src/screens/SignIn.jsx +++ b/v1/frontend/src/screens/SignIn.jsx @@ -17,17 +17,17 @@ function SignIn() { const [username, setUsername] = useState(''); const updateUsername = (event) => setUsername(event.target.value); - useEffect(() => { - SignedIn() - .then((signedIn) => { - if (signedIn) { - navigate(NavDashboard); - } - }) - .catch((error) => { - setError(error); - }); - }, []); + // useEffect(() => { + // SignedIn() + // .then((signedIn) => { + // if (signedIn) { + // navigate(NavDashboard); + // } + // }) + // .catch((error) => { + // setError(error); + // }); + // }, []); useEffect(() => { if (signingIn) { diff --git a/v1/frontend/src/screens/Start.css b/v1/frontend/src/screens/Start.css deleted file mode 100644 index e69de29..0000000 diff --git a/v1/frontend/src/screens/Start.jsx b/v1/frontend/src/screens/Start.jsx deleted file mode 100644 index e69de29..0000000 diff --git a/v1/frontend/src/screens/Startup.css b/v1/frontend/src/screens/Startup.css new file mode 100644 index 0000000..0a6e45f --- /dev/null +++ b/v1/frontend/src/screens/Startup.css @@ -0,0 +1,93 @@ +.startup-body { + align-items: center; + background-color: #f3f5f8; + background-image: linear-gradient(to bottom, #85c742, #061726); + /* background-color: #85c742; */ + display: flex; + flex-direction: column; + justify-content: space-evenly; + height: 100vh; +} + +.startup-center { + align-items: center; + display: flex; + height: 60%; + justify-content: center; + width: 100%; +} + +.startup-error { + color: #f23160; + font-family: monospace; + font-size: 20px; + text-align: center; +} + +.startup-footer { + align-items: center; + display: flex; + flex-direction: column; + justify-content: center; + height: 20%; + width: 100%; +} + +.startup-footer-description { + color: #eee; + font-family: sans-serif; +} + +.startup-header { + align-items: center; + display: flex; + flex-direction: row; + height: 20%; + justify-content: space-evenly; + width: 100%; +} + +.startup-logo { + height: 100px; + width: 100px; +} + +.startup-message { + color: #eee; + font-family: monospace; + font-size: 20px; + text-align: center; +} + +.startup-window { + align-items: center; + background-color: #061726; + border-radius: 12px; + display: flex; + flex-direction: column; + justify-content: space-evenly; + height: 425px; + max-width: 450px; + padding: 20px; + width: 80%; +} + +.startup-window-header { + align-items: center; + display: flex; + flex-direction: column; +} + +.startup-window-message { + align-items: center; + display: flex; + flex-direction: column; + justify-content: center; +} + +.startup-window-title { + color: #eee; + font-family: sans-serif; + font-size: 24px; + font-weight: bold; +} \ No newline at end of file diff --git a/v1/frontend/src/screens/Startup.jsx b/v1/frontend/src/screens/Startup.jsx new file mode 100644 index 0000000..73b60a6 --- /dev/null +++ b/v1/frontend/src/screens/Startup.jsx @@ -0,0 +1,64 @@ +import { useEffect, useState } from 'react'; +import { Navigate, useNavigate } from 'react-router-dom'; +import { NavDashboard, NavSignIn } from '../Navigation'; +import { EventsOn } from '../../wailsjs/runtime/runtime'; +import { Start } from '../../wailsjs/go/main/App'; +import { Logo } from '../assets'; +import './Startup.css'; + +function Startup() { + const [error, setError] = useState(''); + const [message, setMessage] = useState(''); + const navigate = useNavigate(); + const [starting, setStarting] = useState(true); + + useEffect(() => { + EventsOn('StartupMessage', (event) => { + setMessage(event); + }); + setStarting(false); + }, []); + + useEffect(() => { + if (!starting) { + Start() + .then((signin) => { + if (signin) { + navigate(NavSignIn); + } else { + navigate(NavDashboard); + } + }) + .catch((err) => { + setError(err); + }); + } + }, [starting]); + + return ( +
+
+ +
+
+
+
+ Starting Rum Goggles +
+
+ {error !== '' && {error}} + {message !== '' && error === '' && ( + {message} + )} +
+
+
+
+ Rum Goggles by Tyler Travis + Follow @tylertravisty +
+
+ ); +} + +export default Startup;