From 1aa0ee03b40ecabc1e1922dde98f68511649ef6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Geonizeli?= Date: Tue, 26 Jul 2022 15:00:38 -0300 Subject: [PATCH] fix login page style --- app/javascript/components/Appbar/Appbar.tsx | 7 +++++-- app/javascript/pages/session/SignIn.tsx | 23 --------------------- app/javascript/pages/session/index.ts | 1 - app/javascript/react-app-env.d.ts | 5 +++++ app/javascript/routes/routes.tsx | 8 +------ app/views/devise/sessions/new.html.erb | 18 ++++++++++++++++ package.json | 2 +- 7 files changed, 30 insertions(+), 34 deletions(-) delete mode 100644 app/javascript/pages/session/SignIn.tsx create mode 100644 app/javascript/react-app-env.d.ts create mode 100644 app/views/devise/sessions/new.html.erb diff --git a/app/javascript/components/Appbar/Appbar.tsx b/app/javascript/components/Appbar/Appbar.tsx index e8c968c..d86bfcf 100644 --- a/app/javascript/components/Appbar/Appbar.tsx +++ b/app/javascript/components/Appbar/Appbar.tsx @@ -13,6 +13,9 @@ import { turnOff } from '../../services/store/unsavedChanges'; import { CurrentUserAvatar } from "../CurrentUserAvatar"; import { localFetch } from '../../utils/localFetch'; +import unifesoLogoCompact from "../../assets/images/logoImgUnifeso.png"; +import unifesoLogo from "../../assets/images/unifeso-logo-branco.svg"; + const UserMenu: FC = () => { const { user } = useCurrentUser(); const history = useHistory(); @@ -205,12 +208,12 @@ const Logo: FC = () => ( Símbolo do Unifeso Logotipo do Unifeso ) diff --git a/app/javascript/pages/session/SignIn.tsx b/app/javascript/pages/session/SignIn.tsx deleted file mode 100644 index f51911c..0000000 --- a/app/javascript/pages/session/SignIn.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import React from "react"; - -import { Button } from "../../components"; - -export const SignIn = () => { - const handleLogin = async () => { - } - - return ( -
-
- Logo do Unifeso -
- -
-
-
- ); -}; diff --git a/app/javascript/pages/session/index.ts b/app/javascript/pages/session/index.ts index de7a75b..3c1cc19 100644 --- a/app/javascript/pages/session/index.ts +++ b/app/javascript/pages/session/index.ts @@ -1,3 +1,2 @@ -export { SignIn } from "./SignIn"; export { Profile } from "./Profile"; export { UnauthorizedAccess } from "./UnauthorizedAccess"; diff --git a/app/javascript/react-app-env.d.ts b/app/javascript/react-app-env.d.ts new file mode 100644 index 0000000..a3ec540 --- /dev/null +++ b/app/javascript/react-app-env.d.ts @@ -0,0 +1,5 @@ +declare module "@ckeditor/ckeditor5-react"; +declare module "ckeditor5-mathtype/build/ckeditor"; +declare module "boring-avatars"; +declare module "*.svg" +declare module "*.png" \ No newline at end of file diff --git a/app/javascript/routes/routes.tsx b/app/javascript/routes/routes.tsx index 7e1d2fb..5fbe156 100644 --- a/app/javascript/routes/routes.tsx +++ b/app/javascript/routes/routes.tsx @@ -3,7 +3,7 @@ import { Switch, Route, Redirect } from "react-router-dom"; import { Dashboard } from '../pages/dashboard' import { List, New, Show, Review, Edit } from "../pages/question"; -import { Profile, SignIn } from "../pages/session"; +import { Profile } from "../pages/session"; import { QuestionRoutePaths, SessionRoutePaths, DashboardRoutePaths } from './paths' export const PrivateRoutes = () => ( @@ -20,9 +20,3 @@ export const PrivateRoutes = () => ( ); - -export const PublicRoutes = () => ( - - - -); \ No newline at end of file diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb new file mode 100644 index 0000000..1ce636b --- /dev/null +++ b/app/views/devise/sessions/new.html.erb @@ -0,0 +1,18 @@ +
+
+ Logo do Unifeso +
+ <%- resource_class.omniauth_providers.each do |provider| %> + <%= link_to "Faça login no Google", + omniauth_authorize_path(resource_name, provider), + method: :post, + class: "transition duration-300 ease-in-out block text-center cursor-pointer p-2 px-8 rounded shadow-lg hover:shadow-lg bg-gray-200 hover:bg-gray-400 text-gray-800" + %> + <% end %> +
+
+
\ No newline at end of file diff --git a/package.json b/package.json index 181fafc..1a4316d 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "uuid": "^8.3.2" }, "scripts": { - "build": "esbuild app/javascript/*.* --bundle --sourcemap --outdir=app/assets/builds --public-path=assets", + "build": "esbuild app/javascript/*.* --bundle --sourcemap --outdir=app/assets/builds --public-path=assets --loader:.png=file --loader:.svg=file", "build-styles": "postcss app/assets/stylesheets/tailwind.css -o app/assets/stylesheets/main.css" }, "devDependencies": {