Skip to content

Commit

Permalink
Adding updates
Browse files Browse the repository at this point in the history
  • Loading branch information
tnylea committed Apr 24, 2024
1 parent 29f0a76 commit c755c52
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 9 deletions.
17 changes: 17 additions & 0 deletions config/devdojo/auth/customizations.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,22 @@
'type' => 'svg', // image, svg
'src' => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 151 201" fill="none"><path fill="#000" fill-rule="evenodd" d="M75.847.132c-28.092 23.884-45.7 25-75 25v96.125c0 15.285 4.238 26.069 12.393 35.442l17.526-33.718.345-.661 5.06-9.74L76.496 35l40.323 77.58c20.95 2.616 30.894 8.93 30.894 8.93a219.818 219.818 0 0 0-24.117 1.321l-1.371.15c-1.345.158-2.69.326-4.017.502a227.52 227.52 0 0 0-41.712 9.705C50.36 141.907 30.44 153.7 18.4 161.993c9.303 8.615 22.183 16.475 38.353 26.344 5.927 3.616 12.296 7.503 19.093 11.795 6.796-4.292 13.165-8.179 19.091-11.795 16.494-10.066 29.564-18.042 38.907-26.861a205.398 205.398 0 0 0-35.223-19.64 225.71 225.71 0 0 1 30.106-6.358l10.533 20.272c7.627-9.153 11.586-19.721 11.586-34.493V25.132c-29.3 0-46.909-1.117-75-25Zm.649 112.615c-6.892.793-14.306 1.973-22.26 3.655l2.566-4.923 19.694-37.896 19.693 37.896c-6.582.089-13.155.513-19.693 1.268Z" clip-rule="evenodd"/></svg>',
'height' => '36'
],
'heading' => [
'align' => 'center'
],
'login' => [
'text' => [
'headline' => 'Sign in',
'subheadline' => 'Login to your account below',
],
'show_subheadline' => false
],
'register' => [
'text' => [
'headline' => 'Sign up',
'subheadline' => 'Register for your free account below.',
],
'show_subheadline' => false,
]
];
2 changes: 1 addition & 1 deletion config/devdojo/auth/settings.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* You can place your custom package configuration in here.
* These are some default authentication settings
*/
return [
'dev' => env('DEVDOJO_AUTH_DEV', false),
Expand Down
25 changes: 21 additions & 4 deletions resources/views/components/elements/heading.blade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
<div class="sm:mx-auto sm:w-full sm:max-w-md">
<div class="flex justify-center items-center w-full">
@props([
'align' => 'center',
'text' => 'Heading Text',
'description' => '',
'show_subheadline' => false
])

<div @class([
'flex flex-col sm:mx-auto sm:w-full sm:max-w-md',
'items-center' => $align == 'center',
'items-start' => $align == 'left'
])
>
<div @class([
'flex flex-col w-full',
'items-center' => $align == 'center',
'items-start' => $align == 'left',
])
>
<x-auth::elements.link href="/" class="block w-auto" style="height:{{ config('devdojo.auth.customizations.logo.height') }}px">
@if(config('devdojo.auth.customizations.logo.type') == 'image')
<img src="{{ config('devdojo.auth.customizations.logo.src') }}" class="w-auto h-full" />
Expand All @@ -8,8 +25,8 @@
@endif
</x-auth::elements.link>
</div>
<h1 id="auth-heading" class="mt-1 text-xl font-medium leading-9 text-center text-gray-800 dark:text-gray-200">{{ $text ?? '' }}</h1>
@if($description ?? false)
<h1 id="auth-heading" class="mt-1 text-xl font-medium leading-9 text-gray-800 dark:text-gray-200">{{ $text ?? '' }}</h1>
@if(($description ?? false) && $show_subheadline)
<p class="mb-1.5 space-x-0.5 text-sm leading-5 text-center text-gray-500 dark:text-gray-400">{{ $description ?? '' }}</p>
@endif
</div>
2 changes: 1 addition & 1 deletion resources/views/components/layouts/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@endif

</head>
<body class="bg-zinc-950">
<body class="overflow-x-hidden bg-zinc-950">
<div class="flex flex-col justify-center items-stretch py-10 w-screen min-h-screen sm:items-center">
{{ $slot }}
</div>
Expand Down
10 changes: 8 additions & 2 deletions resources/views/pages/auth/login.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@
public $showPasswordField = false;
public $authData = [];
public $customizations = [];
public function mount(){
$this->authData = config('devdojo.auth.pages.login');
$this->customizations = config('devdojo.auth.customizations');
}
public function editIdentity(){
Expand Down Expand Up @@ -57,8 +59,12 @@ public function authenticate()
<x-auth::layouts.app>
@volt('auth.login')
<x-auth::elements.container>

<x-auth::elements.heading :text="$authData['heading'] ?? ''" />

<x-auth::elements.heading
:text="($customizations['login']['text']['headline'] ?? 'No Heading')"
:align="($customizations['heading']['align'] ?? 'center')"
:description="($customizations['login']['text']['subheadline'] ?? 'No Description')"
:show_subheadline="($customizations['login']['show_subheadline'] ?? false)" />

<form wire:submit="authenticate" class="mt-5 space-y-5">

Expand Down
12 changes: 11 additions & 1 deletion resources/views/pages/auth/register.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@
#[Validate('required|min:8|same:passwordConfirmation')]
public $password = '';
public $customizations = [];
public function mount(){
$this->customizations = config('devdojo.auth.customizations');
}
public function register()
{
$this->validate();
Expand All @@ -47,7 +53,11 @@ public function register()
@volt('auth.register')
<x-auth::elements.container>

<x-auth::elements.heading text="Sign up" />
<x-auth::elements.heading
:text="($customizations['register']['text']['headline'] ?? 'No Heading')"
:align="($customizations['heading']['align'] ?? 'center')"
:description="($customizations['register']['text']['subheadline'] ?? 'No Description')"
:show_subheadline="($customizations['register']['show_subheadline'] ?? false)" />

<form wire:submit="register" class="mt-5 space-y-5">
{{-- <x-auth::elements.input label="Name" type="text" wire:model="name" /> --}}
Expand Down

0 comments on commit c755c52

Please sign in to comment.