Skip to content

Commit af4c1e0

Browse files
authored
feat: implement word (jargon) metatab - First Iteration (#45)
This Pull Request implements the word (jargon) metatab; this is a tab that seats under the word title on the `word.astro` layout; It's a tab planned to hold the available interactive features/functions that can be performed on a word (jargon). This PR implements the first of this functions... see below... - The `Edit Word` Function - this is a button with a link to a jargons editor `edit` word session for the specific word. ### Changes Made - Implemented a boilerplate metatab div on the word layout with the following sections to start with - the WIP Feature section - a commented out placeholder divs to fantasize about the next features to implement on the metatab - the Edit word button - a link to the edit session for a word on the jargons editor, with `Suggest Improvements` as link text - Computed and Integrated the edit url for the `edit button` section of the metatab ### Screenshot ![image](https://github.com/babblebey/jargons.dev/assets/25631971/b2241354-252d-4cdb-8ba0-0ef05e5806da) 📖
1 parent 20b55ba commit af4c1e0

1 file changed

Lines changed: 22 additions & 1 deletion

File tree

src/layouts/word.astro

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import Search from "../components/islands/search.jsx";
55
import { $dictionary } from "../lib/stores/dictionary.js";
66
77
const { frontmatter } = Astro.props;
8+
const editUrl = `/editor/edit/${frontmatter.url.split("/")[2]}`;
89
---
910

1011
<BaseLayout pageTitle={ frontmatter.title }>
@@ -17,7 +18,27 @@ const { frontmatter } = Astro.props;
1718
<h1 class="text-3xl md:text-7xl font-black">
1819
{ frontmatter.title }
1920
</h1>
20-
<!-- Other metadata here -->
21+
<!-- Metatab -->
22+
<div class="flex mt-6 justify-between">
23+
<!-- WIP Meta Features -->
24+
<!-- <div class="grow flex items-center space-x-2">
25+
<div class="w-10 h-10 bg-neutral-100 rounded-full" />
26+
<div class="w-2/5 h-3 bg-neutral-100 rounded-lg" />
27+
</div> -->
28+
29+
<!-- Edit Button -->
30+
<a href={editUrl}
31+
class="flex items-center space-x-0.5 text-xs"
32+
>
33+
<svg class="w-4 h-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
34+
<path fill-rule="evenodd" d="M11.32 6.176H5c-1.105 0-2 .949-2 2.118v10.588C3 20.052 3.895 21 5 21h11c1.105 0 2-.948 2-2.118v-7.75l-3.914 4.144A2.46 2.46 0 0 1 12.81 16l-2.681.568c-1.75.37-3.292-1.263-2.942-3.115l.536-2.839c.097-.512.335-.983.684-1.352l2.914-3.086Z" clip-rule="evenodd"/>
35+
<path fill-rule="evenodd" d="M19.846 4.318a2.148 2.148 0 0 0-.437-.692 2.014 2.014 0 0 0-.654-.463 1.92 1.92 0 0 0-1.544 0 2.014 2.014 0 0 0-.654.463l-.546.578 2.852 3.02.546-.579a2.14 2.14 0 0 0 .437-.692 2.244 2.244 0 0 0 0-1.635ZM17.45 8.721 14.597 5.7 9.82 10.76a.54.54 0 0 0-.137.27l-.536 2.84c-.07.37.239.696.588.622l2.682-.567a.492.492 0 0 0 .255-.145l4.778-5.06Z" clip-rule="evenodd"/>
36+
</svg>
37+
<span>
38+
Suggest Improvement
39+
</span>
40+
</a>
41+
</div>
2142
</div>
2243

2344
<!-- Meaning -->

0 commit comments

Comments
 (0)