Skip to content

Commit 4d40b77

Browse files
committed
Updated templates
1 parent 421f7a0 commit 4d40b77

File tree

8 files changed

+47
-15
lines changed

8 files changed

+47
-15
lines changed

resources/views/components/endpoint-info.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/* @var Matchory\Herodot\Entities\Endpoint $endpoint */
33
44
?>
5-
<div {{ $attributes->merge([ 'class' => 'flex-grow-0 flex-shrink-0 w-1/2' ]) }}>
5+
<div {{ $attributes->merge([ 'class' => '' ]) }}>
66
<div class="text-base leading-relaxed mb-4">
77
@if ($endpoint->getDescription())
88
<div class="markdown">{!! trim($description()) !!}</div>

resources/views/components/endpoint-sample.blade.php

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,30 @@
22
/* @var Matchory\Herodot\Entities\Endpoint $endpoint */
33
44
?>
5-
<div {{ $attributes->merge([ 'class' => 'sticky top-16 flex-grow-0 flex-shrink-0 w-1/2' ]) }}>
6-
<pre class="ml-4 p-4 rounded-lg bg-gray-800 text-gray-50">
7-
<code class=""> code sample here</code>
8-
<code> code sample here</code>
9-
<code> code sample here</code>
10-
</pre>
5+
<div {{ $attributes->merge([ 'class' => 'sticky top-16' ]) }}>
6+
<div class="lg:ml-4 px-4 py-2 rounded-lg bg-gray-800">
7+
<header class="flex items-center mb-4 text-gray-400">
8+
<span class="uppercase text-xs mr-auto">Request</span>
9+
10+
<label class="mr-2">
11+
<select class="bg-transparent text-xs">
12+
<option disabled selected>Language</option>
13+
<option>PHP</option>
14+
<option>Go</option>
15+
<option>JavaScript</option>
16+
<option>Python</option>
17+
<option>curl</option>
18+
</select>
19+
</label>
20+
21+
<button>
22+
<span class="sr-only">Copy to clipboard</span>
23+
<span class="material-icons text-base">content_copy</span>
24+
</button>
25+
</header>
26+
27+
<pre class="text-gray-100 py-2" data-sample-js>fetch()</pre>
28+
</div>
1129

1230
{{ $slot }}
1331
</div>

resources/views/components/endpoint-uri.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/* @var Matchory\Herodot\Entities\Endpoint $endpoint */
33
44
?>
5-
<code {{ $attributes->merge([ 'class' => 'flex items-center w-1/2 p-4 text-sm rounded bg-gray-100 dark:bg-gray-800' ]) }}>
5+
<code {{ $attributes->merge([ 'class' => 'flex items-center lg:w-1/2 p-4 text-sm rounded bg-gray-100 dark:bg-gray-800' ]) }}>
66
<span class="py-1 px-2 rounded bg-blue-500 text-gray-100">{{ $methods() }}</span>
77
<span class="flex items-center ml-3 text-gray-700 dark:text-gray-300">
88
@foreach ($segments() as $segment)

resources/views/components/endpoint.blade.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<section {{ $attributes->merge([ 'class' => 'p-8' ]) }}>
22
<x-herodot-endpoint-header :endpoint="$endpoint" />
33

4-
<div class="flex items-start justify-evenly">
5-
<x-herodot-endpoint-info :endpoint="$endpoint" />
6-
<x-herodot-endpoint-sample :endpoint="$endpoint" />
4+
<div class="flex flex-col lg:flex-row items-start justify-evenly">
5+
<x-herodot-endpoint-info :endpoint="$endpoint" class="flex-grow-0 flex-shrink-0 w-full lg:w-1/2" />
6+
<x-herodot-endpoint-sample :endpoint="$endpoint" class="flex-grow-0 flex-shrink-0 w-full lg:w-1/2" />
77
</div>
88

99
{{ $slot }}

resources/views/components/group.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<section class="herodot-endpoint-groups__endpoint-group">
1+
<section class="xl:p-16">
22
@if ($name)
33
<header class="mx-8 pb-4">
44
<h2 class="text-3xl leading-relaxed" id="{{ Str::slug($name) }}">

resources/views/components/page.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<article class="mb-8">
1+
<article class="mb-8 xl:p-16">
22
<header class="mx-8 pb-4">
33
<h2 class="text-3xl leading-relaxed" id="{{ $page->slug() }}">
44
<a href="#{{ $page->slug() }}">{{ $page->title() }}</a>

resources/views/layouts/default.blade.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
<html lang="en">
22
<head>
33
<title>@yield('title') | {{ config('app.name') }}</title>
4+
<meta name="viewport" content="width=device-width, initial-scale=1">
5+
<meta name="theme-color" content="#fafafa">
6+
7+
<meta property="og:title" content="@yield('title') | {{ config('app.name') }}">
8+
<meta property="og:type" content="website">
9+
<meta property="og:url" content="{{ config('app.url') }}">
10+
411
<link rel="preconnect" href="https://fonts.gstatic.com">
512
<link href="https://fonts.googleapis.com/css2?family=Material+Icons&family=JetBrains+Mono:wght@400;700&family=Open+Sans:wght@300;400;600&display=swap"
613
rel="stylesheet">
7-
<link href="{{ asset('vendor/matchory/main.min.css') }}" rel="stylesheet" />
14+
<link href="{{ asset('vendor/matchory/main.css') }}" rel="stylesheet" />
815
<script>
916
if ( localStorage.theme === 'dark' ) {
1017
document.documentElement.classList.add( 'dark' );
@@ -28,6 +35,6 @@
2835
@yield('footer')
2936
</main>
3037

31-
<script src="{{ asset('vendor/matchory/bundle.min.js') }}"></script>
38+
<script src="{{ asset('vendor/matchory/bundle.js') }}"></script>
3239
</body>
3340
</html>

src/View/Components/EndpointSample.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,11 @@ public function render(): ViewContract
1818
{
1919
return View::make('herodot::components.endpoint-sample');
2020
}
21+
22+
public function sampleJavaScript(): string
23+
{
24+
$url = $this->endpoint->getUri();
25+
26+
return "fetch({$url});";
27+
}
2128
}

0 commit comments

Comments
 (0)