Skip to content

Commit

Permalink
Merge pull request #110 from jbolns/dev
Browse files Browse the repository at this point in the history
Improvs > Misc Formatting & Add Gateway
  • Loading branch information
jbolns authored Dec 14, 2024
2 parents 9c55a5b + 0c3f087 commit 1abdb23
Show file tree
Hide file tree
Showing 8 changed files with 113 additions and 18 deletions.
7 changes: 2 additions & 5 deletions src/components/CategoriesPreview.astro
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
---
// IMPORTS
// Config & content
import { languages } from "@i18n/ui";
// TYPES
type MultiArray = { [key: string]: string[] };
import { languages } from "@i18n/ui";
// FUNCTIONS & ACTIONS
// ACTIONS
const { tags, locale, current } = Astro.props;
let dict: MultiArray = {};
Expand Down
1 change: 1 addition & 0 deletions src/components/MainNavLangs.astro
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { getRoutes, sanitizeRoutes } from "@i18n/utils";
// ACTIONS
// Get locale
const { locale } = Astro.props;
// Determine current slug from pathname
const currentPath = Astro.url.pathname;
const parts = currentPath.split("/");
Expand Down
17 changes: 11 additions & 6 deletions src/i18n/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@ import type { Multi, Links, Misc } from "@types"

// ALL LANGUAGES
export const languages: Multi = {
en: 'English',
es: 'Español',
fi: 'Suomi',
en: "English",
es: "Español",
fi: "Suomi",
};


// DEFAULT LANGUAGE
export const defaultLang = 'en';
export const defaultLang = "en";

// COLLECTION NAMES
export const listOfCollections = ["blog"]

// TOP-LEVEL NAVIGATION
//
Expand Down Expand Up @@ -68,7 +70,8 @@ export type Sections = {
[key: string]: Multi
}

// VARIOUS STRINGS USED ACROSS WEBSITE
// MISC STRINGS
// Strings for animation wrapper
export const wrapperStrings: Misc = {
w1: {
en: "Click here to load animation",
Expand Down Expand Up @@ -97,6 +100,7 @@ export const wrapperStrings: Misc = {
}
}

// Strings used in CV
export const cvStrings: Misc = {
mode: {
en: "View mode",
Expand Down Expand Up @@ -135,6 +139,7 @@ export const cvStrings: Misc = {
}
}

// Strings for tag and icon labels requiring small adjustments
export const labelStrings: Misc = {
coding: {
en: "coding",
Expand All @@ -153,9 +158,9 @@ export const labelStrings: Misc = {
},
}

// OG strings used in header
export const ogStrings: Multi = {
en: "en_GB",
es: "es_ES",
fi: "fi_FI"

}
2 changes: 1 addition & 1 deletion src/i18n/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function getRoutes(slug = ""): Multi | string {
let match = -1

const allRoutes = Object.values(routes)
allRoutes.forEach((group,i) => Object.values(group).map((val) => val === slug ? match = i : ""))
allRoutes.forEach((group,i) => Object.values(group).map((val) => val === decodeURI(slug) ? match = i : ""))

let group
match >= 0 ? group = allRoutes[match] : ""
Expand Down
3 changes: 1 addition & 2 deletions src/layouts/BlogRoll.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
// IMPORTS
import BaseLayout from "@layouts/BaseLayout.astro";
import { site, sections } from "@i18n/sections";
import CategoriesPreview from "@components/CategoriesPreview.astro";
// ACTIONS
// Get props from child component
const { tags, locale, section } = Astro.props;
const { locale, section } = Astro.props;
---

<BaseLayout
Expand Down
2 changes: 1 addition & 1 deletion src/pages/blog/[lang]/[...page].astro
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export async function getStaticPaths({ paginate }: GetStaticPathsOptions) {
const { splitTags, page } = Astro.props;
const locale = Astro.params.lang;
const current = "none";
---

<BlogRollLayout page={page} tags={splitTags} locale={locale} section="blog">
Expand Down
94 changes: 94 additions & 0 deletions src/pages/en/gateway.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
---
// IMPORTS
import BaseLayout from "@layouts/BaseLayout.astro";
import { site } from "@i18n/sections";
import { defaultLang } from "@i18n/ui";
// ACTIONS
// Get locale from folder structure
const locale = defaultLang;
---

<BaseLayout
siteTitle={site.title[locale]}
description="Online payments gateway"
pageTitle="Online payments gateway"
locale={locale}
>
<section>
<p class="text-sm">
(For clarity, this page is only available in English.)
</p>

<h3>Services</h3>
<p>Click the button below to pay for services rendered.<sup>1, 2</sup></p>
<p>Do NOT use this gateway to book services.<sup>3</sup></p>

<div class="text-right">
<a
href="https://buy.stripe.com/eVa16F6XJ6XB8PS4gk"
target="_blank"
rel="noreferrer noopener"
>
<button
class="w-3/4 p-1 border border-black bg-yellow-200 rounded-lg shadow-lg hover:bg-yellow-300 dark:text-black dark:border-white "
>
Pay (services)<sup>4</sup>
</button>
</a>
<p class="m-0 text-sm text-blue-700 underline">
<a href="/en/terms">Terms & Conditions</a><sup>4</sup>
</p>
</div>

<h3>Products</h3>
<p>
All products I offer can be used in "ugly mode" without
activation. To make a voluntary payment to get make the user interface prettier, click the button below.<sup>1, 2, 5</sup>
</p>

<div class="text-right">
<a
href="https://buy.stripe.com/28o16Fci381F7LOeUX"
target="_blank"
rel="noreferrer noopener"
>
<button
class="w-3/4 p-1 border border-black bg-yellow-200 rounded-lg shadow-lg hover:bg-yellow-300 dark:text-black dark:border-white "
>
Pay (open source products)<sup>4</sup>
</button>
</a>
<p class="m-0 text-sm text-blue-700 underline">
<a href="/en/terms">Terms & Conditions</a><sup>4</sup>
</p>
</div>

<span class="text-sm">
<strong>Notes</strong>
<ol>
<li>
Payments are final and confirm satisfaction with products/services.
</li>
<li>Payments are handled via Stripe.</li>
<li>
Payments for services that have not been pre-arranged, agreed, and
contracted with me will be treated as voluntary payments relating to
an open-source or open-access resource of my choice.
</li>
<li>
By clicking the button you accept the applicable sections of the <a
href="/en/terms" class="text-blue-700 underline">Terms & Conditions</a
>.
</li>

<li>
After payment, Stripe will send an invoice to the email you entered in
the payment information. The invoice number is the activation code
needed to disable "ugly mode".
</li>

</ol>
</span>
</section>
</BaseLayout>
5 changes: 2 additions & 3 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
import type { Multi } from "@types";
import { ViewTransitions } from "astro:transitions";
import BaseHead from "@components/BaseHead.astro";
import { languages } from "@i18n/ui";
import { languages, defaultLang } from "@i18n/ui";
import { sanitizeRoutes } from "@i18n/utils";
import { site } from "@i18n/sections";
import { defaultLang } from "@i18n/ui";
// FUNCTIONS & ACTIONS
// ACTIONS
const locale: keyof Multi = defaultLang;
---

Expand Down

0 comments on commit 1abdb23

Please sign in to comment.