Skip to content

Commit

Permalink
refactor: better auth page
Browse files Browse the repository at this point in the history
  • Loading branch information
vorban committed Jun 13, 2024
1 parent 3f22be7 commit dffb3fd
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 34 deletions.
2 changes: 2 additions & 0 deletions resources/views/components/box.blade.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@props(['title' => null])

<div class="overflow-hidden rounded-lg bg-white shadow-sm">
@isset($title)
<div class="flex items-center justify-between border-b border-[#E1E6EA] px-5 py-4 text-lg font-medium leading-none">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
@props(['title' => 'Log in on Helium'])

<!doctype html>
<html lang="fr">

<head>
<meta charset="UTF-8">
<title>Login on Helium</title>
<title>{{ $title }}</title>
<meta name="viewport"
content="width=device-width, initial-scale=1.0">
@vite('resources/css/vendor/helium/app.css')
</head>

<body class="flex min-h-screen items-center justify-center bg-slate-200">
@yield('content')
{{ $slot }}
@vite('resources/js/vendor/helium/app.js')
</body>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
@props([
'title' => 'Helium',
'css',
'cssStack',
'topbar',
'js',
'jsStack',
])

<!DOCTYPE html>
<html lang="fr">

Expand All @@ -7,35 +16,35 @@
content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible"
content="ie=edge">
@yield('css')
@stack('css-stack')
{{-- todo @val: this path won't work in a real environment --}}
@vite('packages/helium-core/resources/css/app.css')
<title>Helium</title>
@vite('resources/css/vendor/helium/app.css')
{{ $css }}
{{ $cssStack }}

<title>{{ $title }}</title>
</head>

<body class="bg-[#F0F2F4] pb-10 text-base text-slate-800 antialiased">
<main class="flex">
<div class="fixed inset-y-0 left-0 w-64 overflow-auto border-r border-[#E1E6EA] bg-white pb-4 pt-5">
<div class="flex flex-shrink-0 flex-grow flex-col px-3 pb-[70px]">
<x-hui::layout.icon class="mb-5 w-10" />
<x-hui::layout.element.icon class="mb-5 w-10" />
<x-hui::menu />
</div>
<div class="fixed bottom-0 w-64 border-r border-[#E1E6EA] bg-white">
<x-hui::layout.profil />
<x-hui::layout.element.profil />
</div>
</div>
<div class="ml-[16rem] grow">
@yield('topbar')
{{ $topbar }}
<div class="max-w mx-auto w-[90%] space-y-5 pt-10">
@yield('content')
{{ $slot }}
</div>
</div>
</main>
{{-- todo @val: this path won't work in a real environment --}}
@vite('packages/helium-core/resources/js/app.js')
@yield('js')
@stack('js-stack')

@vite('resources/js/vendor/helium/app.js')
{{ $js }}
{{ $jsStack }}
</body>

</html>
34 changes: 15 additions & 19 deletions resources/views/pages/login.blade.php
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
@extends('hui::layout.auth')

@section('content')
<x-hui::layout.auth title="Log in">
<form action="{{ route('helium::postLogin') }}"
method="post">
@csrf
<div class="form-group">
<label for="email">Email</label>
<input type="email"
name="email"
id="email"
required>
</div>
<div class="form-group">
<label for="password">Password</label>
<input type="password"
name="password"
id="password"
required>
</div>
<button type="submit">Login</button>
<x-hui::box>
<x-hui::form.input label="Email"
type="email"
name="email"
required />

<x-hui::form.input label="Password"
type="password"
name="password"
required />
<x-hui::button label="Login"
class="mt-3 w-full" />
</x-hui::box>
</form>
@endsection
</x-hui::layout.auth>

0 comments on commit dffb3fd

Please sign in to comment.