diff --git a/src/App.css b/src/App.css index 0ca984d..bdefc1c 100644 --- a/src/App.css +++ b/src/App.css @@ -1,8 +1,34 @@ -.GamePlaySessionQuestionUnanswered > .card { +.PublicLayout { + padding-top: 82px; +} + +.PublicLayout nav { + height: 82px; +} + +.PublicLayout main { + padding: 30px 10px; +} + +.PublicLayout main > .container { + min-height: calc(100vh - 198px); + transition: height 0.3s; + max-width: 1024px; +} + +.PublicLayout footer { + height: 56px; +} + +.PublicLayout main .btn.btn-primary { + box-shadow: rgba(64, 60, 67, 0.4) 1px 2px 4px 1px !important; +} + +.PublicLayout .GamePlaySessionQuestionUnanswered > .card { text-shadow: 1px 1px 1px #707070; } -.GamePlaySessionQuestionUnanswered > .card code { +.PublicLayout .GamePlaySessionQuestionUnanswered > .card code { text-shadow: none; padding: 4px 6px; border-radius: 6px; @@ -11,7 +37,7 @@ margin: 0 0.1rem; } -.GamePlaySessionQuestionUnanswered > .card pre { +.PublicLayout .GamePlaySessionQuestionUnanswered > .card pre { overflow: visible; white-space: pre-wrap; /* css-3 */ white-space: -moz-pre-wrap; /* Mozilla, since 1999 */ @@ -19,29 +45,10 @@ word-wrap: break-word; /* Internet Explorer 5.5+ */ } -.GamePlaySessionQuestionUnanswered > .card > .card-header code { +.PublicLayout .GamePlaySessionQuestionUnanswered > .card > .card-header code { font-size: 1rem; } -.GamePlaySessionQuestionUnanswered > .card > .card-body > .form-check p { +.PublicLayout .GamePlaySessionQuestionUnanswered > .card > .card-body > .form-check p { line-height: 165%; } - -main .btn.btn-primary { - box-shadow: rgba(64, 60, 67, 0.4) 1px 2px 4px 1px !important; -} - -main input[type="text"], input[type="password"] { - background-color: #ffffff; - color: #5c5c5c; -} - -input[type="text"]:focus, input[type="password"]:focus { - color: #5c5c5c; - background-color: #ffffff; - border: 1px solid #a8a8a8; -} - -input[type="text"]::placeholder, input[type="password"]::placeholder { - color: #c5c5c5; -} diff --git a/src/app/Infrastructure/InMemory/games.ts b/src/app/Infrastructure/InMemory/games.ts index de44078..6035304 100644 --- a/src/app/Infrastructure/InMemory/games.ts +++ b/src/app/Infrastructure/InMemory/games.ts @@ -1,6 +1,6 @@ import Game from '../../Domain/Game/Game.ts' -import games from './games.json' +import games from '../../../database/static/games.json' export default function (): Game[] { return games as unknown as Game[] diff --git a/src/config/dependencies.ts b/src/config/dependencies.ts index d471eef..ba4b658 100644 --- a/src/config/dependencies.ts +++ b/src/config/dependencies.ts @@ -7,27 +7,31 @@ import InMemoryGameRepository from '../app/Infrastructure/InMemory/InMemoryGameR import SupabaseGameRepository from '../app/Infrastructure/Supabase/SupabaseGameRepository.ts' import { mode } from './env.ts' -const factory = (binds: Record unknown>) => { +const binds: Record unknown>> = { + http: { + AuthRepository: () => HttpAuthRepository.build(), + // GameRepository: () => HttpGameRepository.build(), + }, + memory: { + // AuthRepository: () => new InMemoryAuthRepository(), + GameRepository: () => new InMemoryGameRepository(), + }, + supabase: { + AuthRepository: () => SupabaseAuthRepository.build(), + GameRepository: () => SupabaseGameRepository.build(), + }, +} + +const factory = (token: string): [string, { useFactory: () => unknown }] => { const bind = binds[mode()] - return bind && bind() + const useFactory = bind[token] + return [token, { useFactory }] } export default function () { container.register('AuthService', { useClass: AuthService }) - container.register('AuthRepository', { - useFactory: () => { - return factory({ - http: () => HttpAuthRepository.build(), - supabase: () => SupabaseAuthRepository.build(), - }) - } - }) - container.register('GameRepository', { - useFactory: () => factory({ - memory: () => new InMemoryGameRepository(), - supabase: () => SupabaseGameRepository.build(), - }) - }) + container.register(...factory('AuthRepository')) + container.register(...factory('GameRepository')) return container } diff --git a/src/config/env.ts b/src/config/env.ts index 5b636a3..85d4481 100644 --- a/src/config/env.ts +++ b/src/config/env.ts @@ -1 +1 @@ -export const mode = () => localStorage.getItem('mode') || import.meta.env.VITE_BACKEND_MODE || 'supabase' +export const mode = (): string => localStorage.getItem('mode') || import.meta.env.VITE_BACKEND_MODE || 'supabase' diff --git a/src/config/i18n.ts b/src/config/i18n.ts index 5f3be39..bc34936 100644 --- a/src/config/i18n.ts +++ b/src/config/i18n.ts @@ -75,6 +75,9 @@ const resources = { waiting: 'Recomeçar em {{timer}} segundos', restart: 'Começar de novo' } + }, + dashboard: { + soon: 'Em breve!' } }, components: { diff --git a/src/app/Infrastructure/InMemory/games.json b/src/database/static/games.json similarity index 100% rename from src/app/Infrastructure/InMemory/games.json rename to src/database/static/games.json diff --git a/src/index.css b/src/index.css index 424310d..b9378d9 100644 --- a/src/index.css +++ b/src/index.css @@ -1,31 +1,24 @@ -#root { - height: 100%; - width: 100%; - position: relative; -} - body { background-image: linear-gradient(90deg, #33b7e2, #a680da, #fd81b8); } -.PublicLayout { - padding-top: 82px; -} - -.PublicLayout nav { - height: 82px; +#root { + height: 100%; + width: 100%; + position: relative; } -.PublicLayout main { - padding: 30px 10px; +input[type="text"], input[type="password"] { + background-color: #ffffff; + color: #5c5c5c; } -.PublicLayout main > .container { - min-height: calc(100vh - 198px); - transition: height 0.3s; - max-width: 1024px; +input[type="text"]:focus, input[type="password"]:focus { + color: #5c5c5c; + background-color: #ffffff; + border: 1px solid #a8a8a8; } -.PublicLayout footer { - height: 56px; +input[type="text"]::placeholder, input[type="password"]::placeholder { + color: #c5c5c5; } diff --git a/src/view/pages/DashboardPage.tsx b/src/view/pages/DashboardPage.tsx index 24d7160..65c4817 100644 --- a/src/view/pages/DashboardPage.tsx +++ b/src/view/pages/DashboardPage.tsx @@ -1,7 +1,14 @@ +import { useTranslation } from 'react-i18next' + export function DashboardPage () { + const { t } = useTranslation( + 'default', + { keyPrefix: 'pages.dashboard' } + ) + return (

- Eu sou uma página privada + {t('soon')}

) } diff --git a/src/view/pages/HomePage.tsx b/src/view/pages/HomePage.tsx index 9c13848..731879c 100644 --- a/src/view/pages/HomePage.tsx +++ b/src/view/pages/HomePage.tsx @@ -7,6 +7,7 @@ export function HomePage () { 'default', { keyPrefix: 'pages.home' } ) + return (

{t('title')}