Skip to content
This repository was archived by the owner on Dec 11, 2021. It is now read-only.

Commit 5cb7005

Browse files
committed
Build home page and header dropdown
1 parent fbb4bdd commit 5cb7005

File tree

5 files changed

+59
-11
lines changed

5 files changed

+59
-11
lines changed

src/stubs/resources/js/app.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,7 @@ Vue.component('example-component', require('./components/ExampleComponent.vue').
2929

3030
const app = new Vue({
3131
el: '#app',
32+
data: {
33+
dropdownOpen: false,
34+
},
3235
});
Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
<template>
2-
<div>
3-
2+
<div class="flex items-center justify-center mt-16 mx-6 w-full">
3+
<div class="p-6 bg-white shadow rounded-md max-w-xl w-full">
4+
<h3 class="text-gray-700 text-lg">Example Component</h3>
5+
6+
<p class="text-gray-600 mt-3">I'm an example component.</p>
7+
</div>
48
</div>
59
</template>
610

711
<script>
8-
export default {}
9-
</script>
12+
export default {
13+
mounted() {
14+
console.log('Component mounted.')
15+
}
16+
}
17+
</script>
Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,32 @@
11
@extends('layouts.app')
22

33
@section('content')
4-
{{-- WIP --}}
4+
<div class="flex items-center justify-center mt-16 mx-6">
5+
<div class="p-6 max-w-sm w-full bg-white shadow rounded-md">
6+
<h3 class="text-gray-700 text-xl text-center">{{ __('Confirm Password') }}</h3>
7+
8+
<p class="text-gray-600 mt-3">{{ __('Please confirm your password before continuing.') }}</p>
9+
10+
<form class="mt-4" method="POST" action="{{ route('password.confirm') }}">
11+
@csrf
12+
13+
<label class="block mt-3">
14+
<span class="text-gray-700 text-sm">{{ __('Password') }}</span>
15+
<input id="password" type="password" class="form-input mt-1 block w-full rounded-md" name="password" required autocomplete="current-password">
16+
17+
@error('password')
18+
<span class="text-sm text-red-500" role="alert">
19+
<strong>{{ $message }}</strong>
20+
</span>
21+
@enderror
22+
</label>
23+
24+
<div class="mt-6">
25+
<button type="submit" class="w-full py-2 px-4 text-center bg-blue-600 rounded-md text-white text-sm hover:bg-blue-500 focus:outline-none">
26+
{{ __('Confirm Password') }}
27+
</button>
28+
</div>
29+
</form>
30+
</div>
31+
</div>
532
@endsection

src/stubs/resources/views/home.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
@section('content')
44
<div class="flex items-center justify-center mt-16 mx-6">
5-
<div class="p-6 bg-white shadow rounded-md">
5+
<div class="p-6 bg-white shadow rounded-md max-w-xl w-full">
66
<h3 class="text-gray-700 text-lg">{{ __('Dashboard') }}</h3>
77

88

src/stubs/resources/views/layouts/app.blade.php

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,21 @@
3232
<a href="{{ route('login') }}" class="text-gray-700 font-light mx-4 hover:underline">{{ __('Login') }}</a>
3333
<a href="{{ route('register') }}" class="text-gray-700 font-light hover:underline">{{ __('Register') }}</a>
3434
@else
35-
<a href="{{ route('logout') }}" class="text-gray-700 font-light mx-4 hover:underline"
36-
onclick="event.preventDefault();
37-
document.getElementById('logout-form').submit();">
38-
{{ Auth::user()->name }}
39-
</a>
35+
<div class="relative">
36+
<button @click="dropdownOpen = !dropdownOpen" class="relative z-10 block text-gray-700 font-light focus:outline-none">
37+
{{ Auth::user()->name }}
38+
</button>
39+
40+
<div v-if="dropdownOpen" @click="dropdownOpen = false" class="fixed inset-0 h-full w-full z-10"></div>
41+
42+
<div v-if="dropdownOpen" class="absolute right-0 mt-2 py-2 w-48 bg-white rounded-md shadow-xl z-20">
43+
<a href="{{ route('logout') }}" class="block px-4 py-2 text-sm text-gray-700 hover:bg-indigo-600 hover:text-white"
44+
onclick="event.preventDefault();
45+
document.getElementById('logout-form').submit();">
46+
{{ __('Logout') }}
47+
</a>
48+
</div>
49+
</div>
4050

4151
<form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
4252
@csrf

0 commit comments

Comments
 (0)